1 // Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef __ESP_INT_WDT_H
16 #define __ESP_INT_WDT_H
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 /** @addtogroup Watchdog_APIs
23   * @{
24   */
25 
26 /*
27 This routine enables a watchdog to catch instances of processes disabling
28 interrupts for too long, or code within interrupt handlers taking too long.
29 It does this by setting up a watchdog which gets fed from the FreeRTOS
30 task switch interrupt. When this watchdog times out, initially it will call
31 a high-level interrupt routine that will panic FreeRTOS in order to allow
32 for forensic examination of the state of the both CPUs. When this interrupt
33 handler is not called and the watchdog times out a second time, it will
34 reset the SoC.
35 
36 This uses the TIMERG1 WDT.
37 */
38 
39 
40 /**
41   * @brief  Initialize the non-CPU-specific parts of interrupt watchdog.
42   *         This is called in the init code if the interrupt watchdog
43   *         is enabled in menuconfig.
44   *
45   */
46 void esp_int_wdt_init(void);
47 
48 /**
49   * @brief  Enable the interrupt watchdog on the current CPU. This is called
50   *         in the init code by both CPUs if the interrupt watchdog is enabled
51   *         in menuconfig.
52   *
53   */
54 void esp_int_wdt_cpu_init(void);
55 
56 
57 
58 /**
59   * @}
60   */
61 
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif
68