mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-01 23:50:38 +00:00
Refactor and consolidate time window logic (#4826)
* Refactor and consolidate windowing logic * Trunk * Fixes * More * Fix braces and remove unused now variables. There was a brace in src/mesh/RadioLibInterface.cpp that was breaking compile on some architectures. Additionally, there were some brace errors in src/modules/Telemetry/AirQualityTelemetry.cpp src/modules/Telemetry/EnvironmentTelemetry.cpp src/mesh/wifi/WiFiAPClient.cpp Move throttle include in WifiAPClient.cpp to top. Add Default.h to sleep.cpp rest of files just remove unused now variables. * Remove a couple more meows --------- Co-authored-by: Tom Fifield <tom@tomfifield.net>
This commit is contained in:
@@ -24,4 +24,12 @@ bool Throttle::execute(uint32_t *lastExecutionMs, uint32_t minumumIntervalMs, vo
|
||||
onDefer();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// @brief Check if the last execution time is within the interval
|
||||
/// @param lastExecutionMs The last execution time in milliseconds
|
||||
/// @param timeSpanMs The interval in milliseconds of the timespan
|
||||
bool Throttle::isWithinTimespanMs(uint32_t lastExecutionMs, uint32_t timeSpanMs)
|
||||
{
|
||||
return (millis() - lastExecutionMs) < timeSpanMs;
|
||||
}
|
||||
Reference in New Issue
Block a user