Merge branch 'refactor/common_rom_uart_apis' into 'master'

esp_rom: extract common uart apis into esp_rom_uart.h

See merge request espressif/esp-idf!9313
This commit is contained in:
Angus Gratton
2020-07-21 15:24:21 +08:00
44 changed files with 274 additions and 150 deletions

View File

@@ -30,7 +30,7 @@ else()
set(include_dirs "include")
set(requires driver efuse soc) #unfortunately rom/uart uses SOC registers directly
set(requires driver efuse)
# driver is a public requirement because esp_sleep.h uses gpio_num_t & touch_pad_t
# app_update is added here because cpu_start.c uses esp_ota_get_app_description() function.

View File

@@ -20,7 +20,6 @@
#include "esp_debug_helpers.h"
#include "esp32s2/rom/ets_sys.h"
#include "esp32s2/rom/uart.h"
#include "soc/cpu.h"
#include "soc/dport_reg.h"

View File

@@ -24,8 +24,8 @@
#include "esp_spi_flash.h"
#include "esp32s2/rom/cache.h"
#include "esp32s2/rom/rtc.h"
#include "esp32s2/rom/uart.h"
#include "esp32s2/rom/ets_sys.h"
#include "esp_rom_uart.h"
#include "soc/cpu.h"
#include "soc/rtc.h"
#include "soc/spi_periph.h"
@@ -145,7 +145,7 @@ static void IRAM_ATTR flush_uarts(void)
{
for (int i = 0; i < SOC_UART_NUM; ++i) {
if (periph_ll_periph_enabled(PERIPH_UART0_MODULE + i)) {
uart_tx_wait_idle(i);
esp_rom_uart_tx_wait_idle(i);
}
}
}

View File

@@ -20,7 +20,7 @@
#include "esp_wifi.h"
#include "esp_log.h"
#include "esp32s2/rom/cache.h"
#include "esp32s2/rom/uart.h"
#include "esp_rom_uart.h"
#include "soc/dport_reg.h"
#include "soc/gpio_reg.h"
#include "soc/rtc_cntl_reg.h"
@@ -70,8 +70,8 @@ void IRAM_ATTR esp_restart_noos(void)
wdt_hal_write_protect_enable(&wdt1_context);
// Flush any data left in UART FIFOs
uart_tx_wait_idle(0);
uart_tx_wait_idle(1);
esp_rom_uart_tx_wait_idle(0);
esp_rom_uart_tx_wait_idle(1);
// Disable cache
Cache_Disable_ICache();
Cache_Disable_DCache();