mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Add a sleep timeout setting for hall sensor (#1969)
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_readme (push) Waiting to run
Some checks are pending
Docs / deploy-docs (push) Waiting to run
CI / build (MHP30) (push) Waiting to run
CI / build (Pinecil) (push) Waiting to run
CI / build (Pinecilv2) (push) Waiting to run
CI / build (S60) (push) Waiting to run
CI / build (S60P) (push) Waiting to run
CI / build (T55) (push) Waiting to run
CI / build (TS100) (push) Waiting to run
CI / build (TS101) (push) Waiting to run
CI / build (TS80) (push) Waiting to run
CI / build (TS80P) (push) Waiting to run
CI / build_multi-lang (Pinecil) (push) Waiting to run
CI / build_multi-lang (Pinecilv2) (push) Waiting to run
CI / upload_metadata (push) Blocked by required conditions
CI / tests (push) Waiting to run
CI / check_c-cpp (push) Waiting to run
CI / check_python (push) Waiting to run
CI / check_shell (push) Waiting to run
CI / check_readme (push) Waiting to run
* Add a sleep timeout setting for hall sensor * Update Settings.h to reorder HallEffectSleepTime to the end * Update Settings.cpp to reorder HallEffectSleepTime to the end * add HallEffSleepTimeout to rest of translations * mix misaligned number in Settings.cpp * fix clang-format issue in getHallEffectSleepTimeout
This commit is contained in:
@@ -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); //
|
||||
|
||||
@@ -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
|
||||
@@ -32,7 +32,7 @@ bool shouldBeSleeping() {
|
||||
if (lastHallEffectSleepStart == 0) {
|
||||
lastHallEffectSleepStart = xTaskGetTickCount();
|
||||
}
|
||||
if ((xTaskGetTickCount() - lastHallEffectSleepStart) > TICKS_SECOND) {
|
||||
if ((xTaskGetTickCount() - lastHallEffectSleepStart) > getHallEffectSleepTimeout()) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user