system_internal.h 1.9 KB

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