Merge branch 'dev' into dev

This commit is contained in:
discip
2024-08-24 13:04:38 +02:00
committed by GitHub
48 changed files with 244 additions and 84 deletions

View File

@@ -7,6 +7,7 @@
void GUIDelay(); //
bool checkForUnderVoltage(void); //
uint32_t getSleepTimeout(void); //
uint32_t getHallEffectSleepTimeout(void); //
bool shouldBeSleeping(); //
bool shouldShutdown(void); //
void printVoltage(void); //

View File

@@ -0,0 +1,13 @@
#include "OperatingModeUtilities.h"
#ifndef NO_SLEEP_MODE
#ifdef HALL_SENSOR
uint32_t getHallEffectSleepTimeout(void) {
if (getSettingValue(SettingsOptions::HallEffectSensitivity) && getSettingValue(SettingsOptions::HallEffectSleepTime)) {
uint32_t sleepThres = getSettingValue(SettingsOptions::HallEffectSleepTime) * 5 * TICKS_SECOND;
return sleepThres;
}
return TICKS_SECOND;
}
#endif
#endif

View File

@@ -32,7 +32,7 @@ bool shouldBeSleeping() {
if (lastHallEffectSleepStart == 0) {
lastHallEffectSleepStart = xTaskGetTickCount();
}
if ((xTaskGetTickCount() - lastHallEffectSleepStart) > TICKS_SECOND) {
if ((xTaskGetTickCount() - lastHallEffectSleepStart) > getHallEffectSleepTimeout()) {
return true;
}
} else {