mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
fix potential overflow on uptime (#21965)
* fix potential overflow * fix potential overflow * fix potential overflow * fix potential overflow
This commit is contained in:
parent
30cffa1acc
commit
851f11dcdd
@ -213,14 +213,12 @@ void ShutterAllowPreStartProcedure(uint8_t i) {
|
|||||||
// Prestart allow e.g. to release a LOCK or something else before the movement start
|
// Prestart allow e.g. to release a LOCK or something else before the movement start
|
||||||
// Anyway, as long var1 != 99 this is skipped (luckily)
|
// Anyway, as long var1 != 99 this is skipped (luckily)
|
||||||
#ifdef USE_RULES
|
#ifdef USE_RULES
|
||||||
uint32_t uptime_Local = 0;
|
|
||||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Delay Start? var%d <99>=<%s>, max10s?"),i + 1, rules_vars[i]);
|
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Delay Start? var%d <99>=<%s>, max10s?"),i + 1, rules_vars[i]);
|
||||||
uptime_Local = TasmotaGlobal.uptime;
|
// wait for response from rules
|
||||||
while (uptime_Local + 10 > TasmotaGlobal.uptime
|
uint32_t start_time = millis();
|
||||||
&& (String)rules_vars[i] == "99") {
|
while (TimePassedSince(start_time) < 10000 && (String)rules_vars[i] == "99") {
|
||||||
loop();
|
delay(1);
|
||||||
}
|
}
|
||||||
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Delay Start. Done"));
|
|
||||||
#endif // USE_RULES
|
#endif // USE_RULES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,13 +731,12 @@ void ShutterAllowPreStartProcedure(uint8_t i) {
|
|||||||
// What PreStartProcedure do you want to execute here?
|
// What PreStartProcedure do you want to execute here?
|
||||||
// Anyway, as long var1 != 99 this is skipped (luckily)
|
// Anyway, as long var1 != 99 this is skipped (luckily)
|
||||||
#ifdef USE_RULES
|
#ifdef USE_RULES
|
||||||
uint32_t uptime_Local=0;
|
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Delay Start? var%d <99>=<%s>, max10s?"),i + 1, rules_vars[i]);
|
||||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Delay Start? var%d <99>=<%s>, max10s?"),i+1, rules_vars[i]);
|
// wait for response from rules
|
||||||
uptime_Local = TasmotaGlobal.uptime;
|
uint32_t start_time = millis();
|
||||||
while (uptime_Local+10 > TasmotaGlobal.uptime && (String)rules_vars[i] == "99") {
|
while (TimePassedSince(start_time) < 10000 && (String)rules_vars[i] == "99") {
|
||||||
loop();
|
delay(1);
|
||||||
}
|
}
|
||||||
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Delay Start. Done"));
|
|
||||||
#endif // USE_RULES
|
#endif // USE_RULES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user