esp_system_internal.h 1.7 KB

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