How can I set a digital pin's state from wake stub, go sleep and preserve pin's state throughout deep sleep?

eiswiesel
Posts: 4
Joined: Wed Jan 18, 2023 2:39 pm

How can I set a digital pin's state from wake stub, go sleep and preserve pin's state throughout deep sleep?

Postby eiswiesel » 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

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
}
Calling gpio_hold_en() and gpio_deep_sleep_hold_en() doesn't work in the stub. How to resolve this?

eiswiesel
Posts: 4
Joined: Wed Jan 18, 2023 2:39 pm

Re: How can I set a digital pin's state from wake stub, go sleep and preserve pin's state throughout deep sleep?

Postby eiswiesel » Sun Jun 04, 2023 4:57 pm

Nothing? Any hints? What am I missing?

Who is online

Users browsing this forum: No registered users and 92 guests