- implement shutdown (deep sleep forever) on ESP32

- Clean up shutdown and delayed shutdown code conditionals.
- clean up inputbroker includes
This commit is contained in:
Thomas Göttgens
2023-03-11 22:40:33 +01:00
parent c9686d2f62
commit a83d5ada86
5 changed files with 22 additions and 24 deletions

View File

@@ -18,31 +18,16 @@ void powerCommandsCheck()
#endif
}
#if defined(ARCH_NRF52) || defined(HAS_PMU)
#if defined(ARCH_ESP32) || defined(ARCH_NRF52)
if (shutdownAtMsec) {
screen->startShutdownScreen();
playBeep();
#ifdef PIN_LED1
ledOff(PIN_LED1);
#endif
#ifdef PIN_LED2
ledOff(PIN_LED2);
#endif
#ifdef PIN_LED3
ledOff(PIN_LED3);
#endif
}
#endif
if (shutdownAtMsec && millis() > shutdownAtMsec) {
LOG_INFO("Shutting down from admin command\n");
#ifdef HAS_PMU
if (pmu_found == true) {
playShutdownMelody();
power->shutdown();
}
#elif defined(ARCH_NRF52)
playShutdownMelody();
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
power->shutdown();
#else
LOG_WARN("FIXME implement shutdown for this platform");