esp_task_wdt.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include "sdkconfig.h"
  8. #include "esp_err.h"
  9. #if CONFIG_ESP_TASK_WDT_EN
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /**
  14. * @brief Type used to define the context of a Task WatchDog Timer implementation.
  15. * This is used internally in the TWDT driver, it is implementation specific.
  16. */
  17. typedef void* twdt_ctx_t;
  18. /**
  19. * @brief Type of the function used as an ISR callback.
  20. */
  21. typedef void (*twdt_isr_callback)(void*);
  22. /**
  23. * @brief Stop the Task Watchdog Timer (TWDT)
  24. *
  25. * This function will temporarily stop the timer until it is restarted by a call to esp_task_wdt_restart().
  26. * @note esp_task_wdt_stop() must not be called by multiple tasks simultaneously.
  27. * @return
  28. * - ESP_OK: TWDT successfully stopped
  29. * - Other: Failed to stop the TWDT
  30. */
  31. esp_err_t esp_task_wdt_stop(void);
  32. /**
  33. * @brief Restart the Task Watchdog Timer (TWDT)
  34. *
  35. * This function will restart the timer after it has been stopped by esp_task_wdt_stop().
  36. * @note esp_task_wdt_restart() must not be called by multiple tasks simultaneously.
  37. * @return
  38. * - ESP_OK: TWDT successfully stopped
  39. * - Other: Failed to stop the TWDT
  40. */
  41. esp_err_t esp_task_wdt_restart(void);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif // CONFIG_ESP_TASK_WDT_EN