mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
Moved button thread to its own file (#1260)
* Moved button thread to its own file * Move some debug code blocks into their own files * Shutdown refactoring * Removed GENIEBLOCKS
This commit is contained in:
41
src/shutdown.h
Normal file
41
src/shutdown.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "configuration.h"
|
||||
#include "graphics/Screen.h"
|
||||
#include "power.h"
|
||||
#include "buzz.h"
|
||||
#include "main.h"
|
||||
|
||||
void powerCommandsCheck()
|
||||
{
|
||||
if (rebootAtMsec && millis() > rebootAtMsec) {
|
||||
#ifndef NO_ESP32
|
||||
DEBUG_MSG("Rebooting for update\n");
|
||||
ESP.restart();
|
||||
#else
|
||||
DEBUG_MSG("FIXME implement reboot for this platform");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NRF52_SERIES
|
||||
if (shutdownAtMsec) {
|
||||
screen->startShutdownScreen();
|
||||
playBeep();
|
||||
ledOff(PIN_LED1);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (shutdownAtMsec && millis() > shutdownAtMsec) {
|
||||
DEBUG_MSG("Shutting down from admin command\n");
|
||||
#ifdef TBEAM_V10
|
||||
if (axp192_found == true) {
|
||||
setLed(false);
|
||||
power->shutdown();
|
||||
}
|
||||
#elif NRF52_SERIES
|
||||
playShutdownMelody();
|
||||
power->shutdown();
|
||||
#else
|
||||
DEBUG_MSG("FIXME implement shutdown for this platform");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user