mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-20 10:21:28 +10: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:
co-authored by
Tom Fifield
parent
1afd61698b
commit
e8829b8f52
+4
-1
@@ -5,6 +5,7 @@
|
||||
#endif
|
||||
|
||||
#include "ButtonThread.h"
|
||||
#include "Default.h"
|
||||
#include "Led.h"
|
||||
#include "MeshRadio.h"
|
||||
#include "MeshService.h"
|
||||
@@ -28,6 +29,7 @@
|
||||
|
||||
esp_sleep_source_t wakeCause; // the reason we booted this time
|
||||
#endif
|
||||
#include "Throttle.h"
|
||||
|
||||
#ifndef INCLUDE_vTaskSuspend
|
||||
#define INCLUDE_vTaskSuspend 0
|
||||
@@ -168,7 +170,8 @@ static void waitEnterSleep(bool skipPreflight = false)
|
||||
while (!doPreflightSleep()) {
|
||||
delay(100); // Kinda yucky - wait until radio says say we can shutdown (finished in process sends/receives)
|
||||
|
||||
if (millis() - now > 30 * 1000) { // If we wait too long just report an error and go to sleep
|
||||
if (!Throttle::isWithinTimespanMs(now,
|
||||
THIRTY_SECONDS_MS)) { // If we wait too long just report an error and go to sleep
|
||||
RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_SLEEP_ENTER_WAIT);
|
||||
assert(0); // FIXME - for now we just restart, need to fix bug #167
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user