Control GPIO in deep sleep wake stub
Posted: Sat Feb 02, 2019 10:23 am
I'd like to control a GPIO PIN in the deep sleep wake stub.
I tried the following code but the GPIO does not turn on.
Do I need to enable somethng else before I can control the GPIOs?
Thank you
I tried the following code but the GPIO does not turn on.
Code: Select all
#define SU_HARDWARE_PWRREG GPIO_NUM_23
void RTC_IRAM_ATTR esp_wake_deep_sleep(void)
{
esp_default_wake_deep_sleep();
gpio_pad_select_gpio(SU_HARDWARE_PWRREG);
// Ripped from gpio_set_level
if(SU_HARDWARE_PWRREG < 32)
GPIO.out_w1ts = (1 << SU_HARDWARE_PWRREG);
else
GPIO.out1_w1ts.data = (1 << (SU_HARDWARE_PWRREG - 32));
// Ripped from gpio_set_direction
if(SU_HARDWARE_PWRREG < 32)
GPIO.enable_w1ts = (0x1 << SU_HARDWARE_PWRREG);
else
GPIO.enable1_w1ts.data = (0x1 << (SU_HARDWARE_PWRREG - 32));
gpio_matrix_out(SU_HARDWARE_PWRREG, SIG_GPIO_OUT_IDX, false, false);
}
Thank you