Best way to restart from ISR?

apurvapatel
Posts: 1
Joined: Thu May 19, 2022 2:20 pm

Best way to restart from ISR?

Postby apurvapatel » Thu May 19, 2022 2:36 pm

Hello. The idea is that I am setting a flag in ISR and want to restart immediately to run normal loop + flagged code.
1) What is the fastest/efficient/most graceful way to restart immediately inside of the ISR? Some of the ways I can think of would be:
  • esp_restart()
  • Code: Select all

    esp_sleep_enable_timer_wakeup(1);
    esp_deep_sleep_start();
  • Code: Select all

    esp_sleep_enable_timer_wakeup(1);
    esp_light_sleep_start();
2) My code involves usage of wifi in the normal loop. When the interrupt is triggered, I tried to deinit wifi in the ISR, but ISR watchdog got triggered. I removed that code and have not faced any issue since. However, I was wondering, is there any impact on memory in the long run of restarting from ISR without deinitializing wifi?

Who is online

Users browsing this forum: arunbm123, Bing [Bot] and 84 guests