@@ -437,11 +437,11 @@ void MHZ19::autoCalibration(bool isON, byte ABCPeriod)
437
437
}
438
438
/* If no period was defined (for safety, even though default argument is given)*/
439
439
else
440
- ABCPeriod = 160 ; // Default bytes
440
+ ABCPeriod = MHZ19_ABC_PERIOD_DEF ; // Default bytes
441
441
}
442
442
/* If ABC is OFF */
443
443
else
444
- ABCPeriod = 0x00 ; // Set command byte to Zero to match command format.
444
+ ABCPeriod = MHZ19_ABC_PERIOD_OFF ; // Set command byte to Zero to match command format.
445
445
446
446
/* Update storage */
447
447
this ->storage .settings .ABCRepeat = !isON; // Set to opposite, as repeat command is sent only when ABC is OFF.
@@ -756,19 +756,16 @@ byte MHZ19::getCRC(byte inBytes[])
756
756
}
757
757
758
758
void MHZ19::ABCCheck ()
759
- {
760
- /* check timer interval if dynamic hours have passed and if ABC_OFF was set to true */
761
- if (((millis () - ABCRepeatTimer) >= 4.32e7 ) && (this ->storage .settings .ABCRepeat == true ))
762
- {
763
- /* update timer inerval */
764
- ABCRepeatTimer = millis ();
765
-
766
- /* construct ABC_OFF command */
767
- constructCommand (ABC);
768
-
769
- /* write to serial */
770
- write (this ->storage .constructedCommand );
771
- }
759
+ {
760
+ /* check timer interval if dynamic hours have passed and if ABC_OFF was set to true */
761
+ if (((millis () - ABCRepeatTimer) >= 4.32e7 ) && (this ->storage .settings .ABCRepeat == true ))
762
+ {
763
+ /* update timer inerval */
764
+ ABCRepeatTimer = millis ();
765
+
766
+ /* construct command to skip next ABC cycle */
767
+ provisioning (ABC, MHZ19_ABC_PERIOD_OFF);
768
+ }
772
769
}
773
770
774
771
void MHZ19::makeByte (int inInt, byte *high, byte *low)
0 commit comments