2022-05-05 03:38:49 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2016-10-25 06:18:11 -04:00
|
|
|
|
|
|
|
#ifndef __ESP_INT_WDT_H
|
|
|
|
#define __ESP_INT_WDT_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** @addtogroup Watchdog_APIs
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2016-10-26 00:23:01 -04:00
|
|
|
/*
|
|
|
|
This routine enables a watchdog to catch instances of processes disabling
|
2020-11-10 02:40:01 -05:00
|
|
|
interrupts for too long, or code within interrupt handlers taking too long.
|
2016-10-26 00:23:01 -04:00
|
|
|
It does this by setting up a watchdog which gets fed from the FreeRTOS
|
|
|
|
task switch interrupt. When this watchdog times out, initially it will call
|
|
|
|
a high-level interrupt routine that will panic FreeRTOS in order to allow
|
2018-01-11 08:43:58 -05:00
|
|
|
for forensic examination of the state of the both CPUs. When this interrupt
|
2020-11-10 02:40:01 -05:00
|
|
|
handler is not called and the watchdog times out a second time, it will
|
2016-10-26 00:23:01 -04:00
|
|
|
reset the SoC.
|
|
|
|
|
|
|
|
This uses the TIMERG1 WDT.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-10-25 06:18:11 -04:00
|
|
|
/**
|
2018-01-11 08:43:58 -05:00
|
|
|
* @brief Initialize the non-CPU-specific parts of interrupt watchdog.
|
|
|
|
* This is called in the init code if the interrupt watchdog
|
|
|
|
* is enabled in menuconfig.
|
2016-10-25 06:18:11 -04:00
|
|
|
*
|
|
|
|
*/
|
2019-07-16 05:33:30 -04:00
|
|
|
void esp_int_wdt_init(void);
|
2016-10-21 05:59:57 -04:00
|
|
|
|
2018-01-11 08:43:58 -05:00
|
|
|
/**
|
|
|
|
* @brief Enable the interrupt watchdog on the current CPU. This is called
|
|
|
|
* in the init code by both CPUs if the interrupt watchdog is enabled
|
|
|
|
* in menuconfig.
|
|
|
|
*
|
|
|
|
*/
|
2019-07-16 05:33:30 -04:00
|
|
|
void esp_int_wdt_cpu_init(void);
|
2018-01-11 08:43:58 -05:00
|
|
|
|
|
|
|
|
2016-10-25 06:18:11 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-01-11 08:43:58 -05:00
|
|
|
#endif
|