minor fix
This commit is contained in:
parent
54460724db
commit
0b493ffa56
|
|
@ -698,10 +698,11 @@ void StartNewIteration() {
|
|||
}
|
||||
}
|
||||
uint32_t sleep_time_sec;
|
||||
if ((wait_time + 2) < CATCFG_T_INTERVAL) {
|
||||
sleep_time_sec = CATCFG_T_INTERVAL - wait_time - 2;
|
||||
if (wait_time < CATCFG_T_INTERVAL) {
|
||||
sleep_time_sec = CATCFG_T_INTERVAL - wait_time;
|
||||
} else {
|
||||
sleep_time_sec = 0;
|
||||
// minimal sleep time is 5 seconds
|
||||
sleep_time_sec = 5;
|
||||
}
|
||||
if (!fUsbPower) {
|
||||
DoDeepSleep(sleep_time_sec);
|
||||
|
|
@ -711,7 +712,7 @@ void StartNewIteration() {
|
|||
startNewIterationCb);
|
||||
}
|
||||
else {
|
||||
gCatena.SafePrintf("%010d - light sleep; os_setTimedCallback for startNewIterationCb in %d...\n", millis(), CATCFG_T_INTERVAL);
|
||||
gCatena.SafePrintf("%010d - light sleep; os_setTimedCallback for startNewIterationCb in %d...\n", millis(), sleep_time_sec);
|
||||
os_setTimedCallback(
|
||||
&iterationJob,
|
||||
os_getTime() + sec2osticks(sleep_time_sec),
|
||||
|
|
|
|||
Loading…
Reference in New Issue