esp_rom: extract common ets apis into esp_rom_sys.h

This commit is contained in:
morris
2020-07-21 13:07:34 +08:00
parent 35007bd443
commit 2917651478
140 changed files with 490 additions and 410 deletions

View File

@@ -25,6 +25,7 @@
#include "esp_private/system_internal.h"
#include "driver/rtc_cntl.h"
#include "freertos/FreeRTOS.h"
#include "esp_rom_sys.h"
#if defined(CONFIG_ESP32_BROWNOUT_DET_LVL)
#define BROWNOUT_DET_LVL CONFIG_ESP32_BROWNOUT_DET_LVL
@@ -49,11 +50,11 @@ static void rtc_brownout_isr_handler(void *arg)
*/
brownout_hal_intr_clear();
/* Stall the other CPU to make sure the code running there doesn't use UART
* at the same time as the following ets_printf.
* at the same time as the following esp_rom_printf.
*/
esp_cpu_stall(!xPortGetCoreID());
esp_reset_reason_set_hint(ESP_RST_BROWNOUT);
ets_printf("\r\nBrownout detector was triggered\r\n\r\n");
esp_rom_printf("\r\nBrownout detector was triggered\r\n\r\n");
esp_restart_noos();
}