mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
cosmetics
This commit is contained in:
parent
cc23deac00
commit
ef6d5bb340
@ -46,7 +46,6 @@ struct sds011data {
|
|||||||
uint16_t pm25;
|
uint16_t pm25;
|
||||||
} novasds_data;
|
} novasds_data;
|
||||||
|
|
||||||
//Put sensor to sleep
|
|
||||||
void NovaSdsSetWorkPeriod()
|
void NovaSdsSetWorkPeriod()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -57,7 +56,6 @@ void NovaSdsSetWorkPeriod()
|
|||||||
novasds_workperiod[4] = WORKING_PERIOD;
|
novasds_workperiod[4] = WORKING_PERIOD;
|
||||||
novasds_workperiod[17] = ((novasds_workperiod[2] + novasds_workperiod[3] + novasds_workperiod[4] + novasds_workperiod[15] + novasds_workperiod[16]) & 0xFF); //checksum
|
novasds_workperiod[17] = ((novasds_workperiod[2] + novasds_workperiod[3] + novasds_workperiod[4] + novasds_workperiod[15] + novasds_workperiod[16]) & 0xFF); //checksum
|
||||||
|
|
||||||
|
|
||||||
NovaSdsSerial->write(novasds_workperiod, sizeof(novasds_workperiod));
|
NovaSdsSerial->write(novasds_workperiod, sizeof(novasds_workperiod));
|
||||||
|
|
||||||
NovaSdsSerial->flush();
|
NovaSdsSerial->flush();
|
||||||
@ -127,10 +125,12 @@ void NovaSdsSecond() // Every second
|
|||||||
void NovaSdsInit()
|
void NovaSdsInit()
|
||||||
{
|
{
|
||||||
novasds_type = 0;
|
novasds_type = 0;
|
||||||
if ((pin[GPIO_SDS0X1_RX] < 99) && (pin[GPIO_SDS0X1_TX] < 99)) {
|
if (pin[GPIO_SDS0X1_RX] < 99 && pin[GPIO_SDS0X1_TX] < 99) {
|
||||||
NovaSdsSerial = new TasmotaSerial(pin[GPIO_SDS0X1_RX], pin[GPIO_SDS0X1_TX], 1);
|
NovaSdsSerial = new TasmotaSerial(pin[GPIO_SDS0X1_RX], pin[GPIO_SDS0X1_TX], 1);
|
||||||
if (NovaSdsSerial->begin(9600)) {
|
if (NovaSdsSerial->begin(9600)) {
|
||||||
if (NovaSdsSerial->hardwareSerial()) { ClaimSerial(); }
|
if (NovaSdsSerial->hardwareSerial()) {
|
||||||
|
ClaimSerial();
|
||||||
|
}
|
||||||
novasds_type = 1;
|
novasds_type = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user