mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-18 00:32:38 +00:00
tlora-pager wake on button, and kb backlight toggling (#8090)
This commit is contained in:
@@ -411,12 +411,16 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
||||
// assert(uart_set_wakeup_threshold(UART_NUM_0, 3) == ESP_OK);
|
||||
// assert(esp_sleep_enable_uart_wakeup(0) == ESP_OK);
|
||||
#endif
|
||||
#ifdef BUTTON_PIN
|
||||
#ifdef ROTARY_PRESS
|
||||
// The enableLoraInterrupt() method is using ext0_wakeup, so we are forced to use GPIO wakeup
|
||||
gpio_wakeup_enable((gpio_num_t)ROTARY_PRESS, GPIO_INTR_LOW_LEVEL);
|
||||
#endif
|
||||
#ifdef KB_INT
|
||||
gpio_wakeup_enable((gpio_num_t)KB_INT, GPIO_INTR_LOW_LEVEL);
|
||||
#endif
|
||||
#ifdef BUTTON_PIN
|
||||
gpio_num_t pin = (gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN);
|
||||
|
||||
gpio_wakeup_enable(pin, GPIO_INTR_LOW_LEVEL);
|
||||
esp_sleep_enable_gpio_wakeup();
|
||||
#endif
|
||||
#ifdef INPUTDRIVER_ENCODER_BTN
|
||||
gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL);
|
||||
@@ -450,7 +454,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
|
||||
// commented out because it's not that crucial;
|
||||
// if it sporadically happens the node will go into light sleep during the next round
|
||||
// assert(res == ESP_OK);
|
||||
|
||||
#ifdef ROTARY_PRESS
|
||||
gpio_wakeup_disable((gpio_num_t)ROTARY_PRESS);
|
||||
#endif
|
||||
#ifdef KB_INT
|
||||
gpio_wakeup_disable((gpio_num_t)KB_INT);
|
||||
#endif
|
||||
#ifdef BUTTON_PIN
|
||||
// Disable wake-on-button interrupt. Re-attach normal button-interrupts
|
||||
gpio_wakeup_disable(pin);
|
||||
|
||||
Reference in New Issue
Block a user