mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-08 21:51:46 +00:00
![GUVWAF](/assets/img/avatar_default.png)
* Make input_source case insensitive * Implement reboot for RP2040 * Remove EXT_NOTFIFY_OUT as it conflicts with I2C and module is not supported * RP2040 has screen, button and wire * Add default I2C pins also for Pico W
38 lines
932 B
C
38 lines
932 B
C
#include "buzz.h"
|
|
#include "configuration.h"
|
|
#include "graphics/Screen.h"
|
|
#include "main.h"
|
|
#include "power.h"
|
|
|
|
void powerCommandsCheck()
|
|
{
|
|
if (rebootAtMsec && millis() > rebootAtMsec) {
|
|
LOG_INFO("Rebooting\n");
|
|
#if defined(ARCH_ESP32)
|
|
ESP.restart();
|
|
#elif defined(ARCH_NRF52)
|
|
NVIC_SystemReset();
|
|
#elif defined(ARCH_RP2040)
|
|
rp2040.reboot();
|
|
#else
|
|
rebootAtMsec = -1;
|
|
LOG_WARN("FIXME implement reboot for this platform. Skipping for now.\n");
|
|
#endif
|
|
}
|
|
|
|
#if defined(ARCH_ESP32) || defined(ARCH_NRF52)
|
|
if (shutdownAtMsec) {
|
|
screen->startShutdownScreen();
|
|
}
|
|
#endif
|
|
|
|
if (shutdownAtMsec && millis() > shutdownAtMsec) {
|
|
LOG_INFO("Shutting down from admin command\n");
|
|
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
|
playShutdownMelody();
|
|
power->shutdown();
|
|
#else
|
|
LOG_WARN("FIXME implement shutdown for this platform");
|
|
#endif
|
|
}
|
|
} |