esp_task_wdt.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright 2015-2016 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_TASK_WDT_H
  14. #define __ESP_TASK_WDT_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /** \defgroup Watchdog_APIs Watchdog APIs
  19. * @brief Watchdog APIs
  20. */
  21. /** @addtogroup Watchdog_APIs
  22. * @{
  23. */
  24. /*
  25. This routine enables a more general-purpose task watchdog: tasks can individually
  26. feed the watchdog and the watchdog will bark if one or more tasks haven't fed the
  27. watchdog within the specified time. Optionally, the idle tasks can also configured
  28. to feed the watchdog in a similar fashion, to detect CPU starvation.
  29. This uses the TIMERG0 WDT.
  30. */
  31. /**
  32. * @brief Initialize the task watchdog. This is called in the init code, if the
  33. * task watchdog is enabled in menuconfig.
  34. *
  35. */
  36. void esp_task_wdt_init();
  37. /**
  38. * @brief Feed the watchdog. After the first feeding session, the watchdog will expect the calling
  39. * task to keep feeding the watchdog until task_wdt_delete() is called.
  40. *
  41. */
  42. void esp_task_wdt_feed();
  43. /**
  44. * @brief Delete the watchdog for the current task.
  45. *
  46. */
  47. void esp_task_wdt_delete();
  48. /**
  49. * @}
  50. */
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif