How can I set a digital pin's state from wake stub, go sleep and preserve pin's state throughout deep sleep?
Posted: Sun May 28, 2023 3:44 pm
I want to set a pin's state in wake stub, but this code doesn't hold the pin's state when going to sleep
Calling gpio_hold_en() and gpio_deep_sleep_hold_en() doesn't work in the stub. How to resolve this?
Code: Select all
void RTC_IRAM_ATTR esp_wake_deep_sleep(void) {
esp_default_wake_deep_sleep();
REG_SET_BIT(GPIO_ENABLE_REG, BIT2);
REG_WRITE(GPIO_OUT_W1TS_REG, BIT2);
//the pin is on for 1/10 second
ets_delay_us(100000);
[...]code for going to sleep[...]
//the pin is off in deep sleep
}