Skip to content

Commit

Permalink
system: disable interrupts in esp_restart_noos_dig
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Dec 22, 2022
1 parent 490216a commit 35135d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/esp_system/esp_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ static shutdown_handler_t shutdown_handlers[SHUTDOWN_HANDLERS_NO];

void IRAM_ATTR esp_restart_noos_dig(void)
{
// In case any of the calls below results in re-enabling of interrupts
// (for example, by entering a critical section), disable all the
// interrupts (e.g. from watchdogs) here.
#ifdef CONFIG_IDF_TARGET_ARCH_RISCV
rv_utils_intr_global_disable();
#else
xt_ints_off(0xFFFFFFFF);
#endif

// make sure all the panic handler output is sent from UART FIFO
if (CONFIG_ESP_CONSOLE_UART_NUM >= 0) {
esp_rom_uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM);
Expand Down

0 comments on commit 35135d7

Please sign in to comment.