Added Wakeup

If put in Hibernation it would not wakeup
This commit is contained in:
gjelsoe 2026-02-14 12:19:32 +01:00
parent 64e89359e4
commit 88337fc058
2 changed files with 24 additions and 0 deletions

View file

@ -110,6 +110,18 @@ public:
const char *getManufacturerName() const override { return "RadioMaster Bandit"; }
// Add wake-enabled power off
void powerOff() override {
#if defined(PIN_USER_BTN)
esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_USER_BTN, LOW); // Wake when button pressed (LOW)
#elif defined(PIN_USER_JOYSTICK)
// For analog joystick, you'd need to use the center button GPIO
esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_USER_JOYSTICK, LOW);
#endif
// Enter deep sleep
esp_deep_sleep_start();
}
void onBeforeTransmit() override {
// Use user-defined TX LED color
for (byte i = 2; i <= 6; i++) {

View file

@ -67,6 +67,18 @@ const int NUM_CAL_POINTS = sizeof(calibration) / sizeof(calibration[0]);
class BanditNanoBoard : public ESP32Board {
private:
public:
// Add wake-enabled power off
void powerOff() override {
#if defined(PIN_USER_BTN)
esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_USER_BTN, LOW); // Wake when button pressed (LOW)
#elif defined(PIN_USER_JOYSTICK)
// For analog joystick, you'd need to use the center button GPIO
esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_USER_JOYSTICK, LOW);
#endif
// Enter deep sleep
esp_deep_sleep_start();
}
// Return fake battery status, battery/fixed power is not monitored.
uint16_t getBattMilliVolts() override { return 5000; }