mirror of https://github.com/arendst/Tasmota.git
Fix early return in `startLowPowerPeriodicMeasurement`
In method `FrogMoreScd40::startLowPowerPeriodicMeasurement` the `return` statement appeared before the update of the `DuringMeasurement` flag. Thus, the class would wrongly assume not be in measurement mode and a subsequent `stopPeriodicMeasurement` would fail. Moved the `return` statement to after setting the flag.
This commit is contained in:
parent
7a3035756e
commit
94e2c2f9da
|
@ -691,8 +691,8 @@ int FrogmoreScd40::startLowPowerPeriodicMeasurement(void)
|
|||
if (DuringMeasurement) {
|
||||
return (ERROR_SCD40_BUSY_MEASURING);
|
||||
}
|
||||
return (sendCommand(COMMAND_SCD40_START_LOW_POWER_PERIODIC_MEASUREMENT));
|
||||
DuringMeasurement = 1;
|
||||
return (sendCommand(COMMAND_SCD40_START_LOW_POWER_PERIODIC_MEASUREMENT));
|
||||
}
|
||||
|
||||
int FrogmoreScd40::getDataReadyStatus(bool *pIsAvailable)
|
||||
|
|
Loading…
Reference in New Issue