system_internal.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright 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. #pragma once
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include "esp_system.h"
  19. #define TG0_WDT_TICK_US 500
  20. /**
  21. * @brief Internal function to restart PRO and APP CPUs.
  22. *
  23. * @note This function should not be called from FreeRTOS applications.
  24. * Use esp_restart instead.
  25. *
  26. * This is an internal function called by esp_restart. It is called directly
  27. * by the panic handler and brownout detector interrupt.
  28. */
  29. void esp_restart_noos(void) __attribute__ ((noreturn));
  30. /**
  31. * @brief Internal function to set reset reason hint
  32. *
  33. * The hint is used do distinguish different reset reasons when software reset
  34. * is performed.
  35. *
  36. * The hint is stored in RTC store register, RTC_RESET_CAUSE_REG.
  37. *
  38. * @param hint Desired esp_reset_reason_t value for the real reset reason
  39. */
  40. void esp_reset_reason_set_hint(esp_reset_reason_t hint);
  41. /**
  42. * @brief Internal function to get the reset hint value
  43. * @return - Reset hint value previously stored into RTC_RESET_CAUSE_REG using
  44. * esp_reset_reason_set_hint function
  45. * - ESP_RST_UNKNOWN if the value in RTC_RESET_CAUSE_REG is invalid
  46. */
  47. esp_reset_reason_t esp_reset_reason_get_hint(void);
  48. #ifdef __cplusplus
  49. }
  50. #endif