Add raspbian reboot and shutdown behavior

This commit is contained in:
Jonathan Bennett
2023-12-14 19:53:42 -06:00
parent ded1cbf4dd
commit 6c1db94ae7
6 changed files with 25 additions and 4 deletions
+11 -1
View File
@@ -1,6 +1,8 @@
#include "api/WiFiServerAPI.h"
#include "buzz.h"
#include "configuration.h"
#include "graphics/Screen.h"
#include "input/LinuxInputImpl.h"
#include "main.h"
#include "power.h"
@@ -15,7 +17,13 @@ void powerCommandsCheck()
#elif defined(ARCH_RP2040)
rp2040.reboot();
#elif defined(ARCH_RASPBERRY_PI)
exit(EXIT_SUCCESS);
deInitApiServer();
if (aLinuxInputImpl)
aLinuxInputImpl->deInit();
SPI.end();
Wire.end();
Serial1.end();
reboot();
#else
rebootAtMsec = -1;
LOG_WARN("FIXME implement reboot for this platform. Note that some settings require a restart to be applied.\n");
@@ -33,6 +41,8 @@ void powerCommandsCheck()
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
playShutdownMelody();
power->shutdown();
#elif ARCH_RASPBERRY_PI
exit(EXIT_SUCCESS);
#else
LOG_WARN("FIXME implement shutdown for this platform");
#endif