mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 19:56:30 +00:00
fix potential overflow on uptime 2nd try (#21966)
* fix potential overflow * fix potential overflow * fix overflow on millis() * fix overflow on millis() * Update xdrv_27_shutter.ino --------- Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
This commit is contained in:
parent
1b24378da5
commit
6d2647fd5f
@ -1383,7 +1383,8 @@ void ShutterUpdateVelocity(uint8_t i)
|
|||||||
|
|
||||||
void ShutterWaitForMotorStart(uint8_t i)
|
void ShutterWaitForMotorStart(uint8_t i)
|
||||||
{
|
{
|
||||||
while (millis() < Shutter[i].last_stop_time + ShutterSettings.shutter_motorstop) {
|
uint32_t start_time = Shutter[i].last_stop_time;
|
||||||
|
while (TimePassedSince(start_time) < ShutterSettings.shutter_motorstop && TimePassedSince(start_time) > 0) {
|
||||||
loop();
|
loop();
|
||||||
}
|
}
|
||||||
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Stoptime done"));
|
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Stoptime done"));
|
||||||
|
@ -654,7 +654,8 @@ void ShutterWaitForMotorStop(uint8_t i)
|
|||||||
|
|
||||||
void ShutterWaitForMotorStart(uint8_t i)
|
void ShutterWaitForMotorStart(uint8_t i)
|
||||||
{
|
{
|
||||||
while (millis() < Shutter[i].last_stop_time + Settings->shutter_motorstop) {
|
uint32_t start_time = Shutter[i].last_stop_time;
|
||||||
|
while (TimePassedSince(start_time) < Settings->shutter_motorstop && TimePassedSince(start_time) > 0) {
|
||||||
loop();
|
loop();
|
||||||
}
|
}
|
||||||
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Stoptime done"));
|
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Stoptime done"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user