mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-10 16:59:52 +01:00
Fix: Prevent unpredicted behavior on overflows of millis()
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2025 Thomas Basler and others
|
||||
*/
|
||||
#include "TimeoutHelper.h"
|
||||
#include <Arduino.h>
|
||||
@@ -29,5 +29,5 @@ void TimeoutHelper::reset()
|
||||
|
||||
bool TimeoutHelper::occured() const
|
||||
{
|
||||
return millis() > (startMillis + timeout);
|
||||
}
|
||||
return millis() - startMillis > timeout;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user