mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
esp_rom: extract common uart apis into esp_rom_uart.h
This commit is contained in:
@@ -13,12 +13,7 @@
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/queue.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#include "esp32/rom/uart.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
#include "esp32s2/rom/uart.h"
|
||||
#endif
|
||||
#include "esp_rom_uart.h"
|
||||
|
||||
#define WAKE_UP_IGNORE 1 // gpio_wakeup function development is not completed yet, set it deprecated.
|
||||
|
||||
@@ -130,10 +125,10 @@ static void prompt_to_continue(const char* str)
|
||||
char sign[5] = {0};
|
||||
while(strlen(sign) == 0) {
|
||||
/* Flush anything already in the RX buffer */
|
||||
while(uart_rx_one_char((uint8_t *) sign) == OK) {
|
||||
while(esp_rom_uart_rx_one_char((uint8_t *) sign) == ETS_OK) {
|
||||
}
|
||||
/* Read line */
|
||||
UartRxString((uint8_t*) sign, sizeof(sign) - 1);
|
||||
esp_rom_uart_rx_string((uint8_t*) sign, sizeof(sign) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#include <string.h>
|
||||
#include "esp_err.h"
|
||||
#include "driver/uart.h"
|
||||
#include "esp32s2/rom/uart.h"
|
||||
#include "esp_rom_uart.h"
|
||||
|
||||
#define ROM_UART_DRIVER_ENABLE 0
|
||||
|
||||
@@ -128,9 +128,9 @@ int test_tp_print_to_scope(float *data, unsigned char channel_num)
|
||||
return 0;
|
||||
} else {
|
||||
#if ROM_UART_DRIVER_ENABLE
|
||||
uart_tx_wait_idle(uart_num); // Default print uart mumber is 0.
|
||||
esp_rom_uart_tx_wait_idle(uart_num); // Default print uart mumber is 0.
|
||||
for(int i=0; i<out_len; i++) {
|
||||
uart_tx_one_char(out_data[i]);
|
||||
esp_rom_uart_tx_one_char(out_data[i]);
|
||||
}
|
||||
return out_len;
|
||||
#else
|
||||
@@ -162,10 +162,9 @@ int test_tp_print_to_scope(float *data, unsigned char channel_num)
|
||||
esp_err_t test_tp_scope_debug_init(uint8_t uart_num, int tx_io_num, int rx_io_num, int baud_rate)
|
||||
{
|
||||
#if ROM_UART_DRIVER_ENABLE
|
||||
uart_tx_wait_idle(0); // Default print uart mumber is 0.
|
||||
esp_rom_uart_tx_wait_idle(0); // Default print uart mumber is 0.
|
||||
if(uart_num != 0) {
|
||||
uart_tx_switch(uart_num);
|
||||
// uart_div_modify(uart_num, baud_rate); //DivLatchValue : (clock << 4)/baudrate.
|
||||
esp_rom_uart_set_as_console(uart_num);
|
||||
}
|
||||
#else
|
||||
if(uart_used == uart_num) {
|
||||
|
Reference in New Issue
Block a user