Hi I have Configured a gpio 35 for deepsleep interrupt which is working fine . The isr is not being triggered for the -ve edge
My requirement is as follows . The board needs to wake up from deep sleep on positive edge on the interrupt pin and do some work and detect a negative edge on the same interrupt pin it should trigger the isr.
Steps I have followed :
1)disable deepsleep wakeup
2)enable gpio interrupt and Isr
3)disable gpio interrupt
4)enable deep sleep wakeup
5)goto sleep
edit:
Below are the API's I have used
int_pin = GPIO_NUM_35
Deep Sleep interrupt Enable : esp_sleep_enable_ext1_wakeup((1ULL<<int_pin), ESP_EXT1_WAKEUP_ANY_HIGH);
deep sleep interrupt disable : esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_EXT1);
Interrupt disable :
ret = gpio_isr_handler_remove(int_pin);
ret = gpio_intr_disable(int_pin);
ret = gpio_reset_pin(int_pin);
interrupt enable :esp_err_t ret;
gpio_config_t io_conf;
//enable interrupt
io_conf.intr_type = GPIO_PIN_INTR_ANYEDGE;
//bit mask of the pins that you want to set
io_conf.pin_bit_mask = (1ULL<<int_pin);
//set as input mode
io_conf.mode = GPIO_MODE_INPUT;
//disable internal pull-down
io_conf.pull_down_en = 0;
//disable internal pull-up
io_conf.pull_up_en = 0;
//configure GPIO with the given settings
ret = gpio_config(&io_conf);
//install gpio isr service
gpio_install_isr_service(ESP_INTR_FLAG_DEFAULT);
//hook isr handler for specific gpio pin
gpio_isr_handler_add(int_pin, isr_handler, (void*) int_pin);
-ve edge Not detected after waking up from deepsleep
-
- Posts: 9725
- Joined: Thu Nov 26, 2015 4:08 am
Re: -ve edge Not detected after waking up from deepsleep
Not sure if it's the issue here, but one thing I see is you allocate io_conf on the stack without clearing it. Suggest changing that line to gpio_config_t io_conf={0};
Who is online
Users browsing this forum: No registered users and 95 guests