esp_int_wdt.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef __ESP_INT_WDT_H
  14. #define __ESP_INT_WDT_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /** @addtogroup Watchdog_APIs
  19. * @{
  20. */
  21. /*
  22. This routine enables a watchdog to catch instances of processes disabling
  23. interrupts for too long, or code within interrupt handlers taking too long.
  24. It does this by setting up a watchdog which gets fed from the FreeRTOS
  25. task switch interrupt. When this watchdog times out, initially it will call
  26. a high-level interrupt routine that will panic FreeRTOS in order to allow
  27. for forensic examination of the state of the both CPUs. When this interrupt
  28. handler is not called and the watchdog times out a second time, it will
  29. reset the SoC.
  30. This uses the TIMERG1 WDT.
  31. */
  32. /**
  33. * @brief Initialize the non-CPU-specific parts of interrupt watchdog.
  34. * This is called in the init code if the interrupt watchdog
  35. * is enabled in menuconfig.
  36. *
  37. */
  38. void esp_int_wdt_init(void);
  39. /**
  40. * @brief Enable the interrupt watchdog on the current CPU. This is called
  41. * in the init code by both CPUs if the interrupt watchdog is enabled
  42. * in menuconfig.
  43. *
  44. */
  45. void esp_int_wdt_cpu_init(void);
  46. /**
  47. * @}
  48. */
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif