mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-08-06 15:15:15 +08:00
feat(esp8266): Add config to choose console UART none
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
#include "esp8266/uart_register.h"
|
||||
#include "esp8266/rom_functions.h"
|
||||
|
||||
#ifndef CONFIG_CONSOLE_UART_NONE
|
||||
static void uart_putc(int c)
|
||||
{
|
||||
while (1) {
|
||||
@ -34,8 +35,11 @@ static void uart_putc(int c)
|
||||
|
||||
WRITE_PERI_REG(UART_FIFO(CONFIG_CONSOLE_UART_NUM) , c);
|
||||
}
|
||||
#else
|
||||
#define uart_putc(_c) { }
|
||||
#endif
|
||||
|
||||
int ets_putc(int c)
|
||||
int __attribute__ ((weak)) ets_putc(int c)
|
||||
{
|
||||
#ifdef CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF
|
||||
if (c == '\n')
|
||||
|
@ -69,6 +69,11 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t *init_data, esp_phy_calibrat
|
||||
esp_err_t status = ESP_OK;
|
||||
uint8_t sta_mac[6];
|
||||
uint8_t *local_init_data = calloc(1, 256);
|
||||
#ifdef CONFIG_CONSOLE_UART_BAUDRATE
|
||||
const uint32_t uart_baudrate = CONFIG_CONSOLE_UART_BAUDRATE;
|
||||
#else
|
||||
const uint32_t uart_baudrate = 74880; // ROM default baudrate
|
||||
#endif
|
||||
|
||||
memcpy(local_init_data, init_data->params, 128);
|
||||
|
||||
@ -84,7 +89,7 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t *init_data, esp_phy_calibrat
|
||||
}
|
||||
|
||||
esp_efuse_mac_get_default(sta_mac);
|
||||
chip_init(local_init_data, sta_mac, CONFIG_CONSOLE_UART_BAUDRATE);
|
||||
chip_init(local_init_data, sta_mac, uart_baudrate);
|
||||
get_data_from_rtc((uint8_t *)calibration_data);
|
||||
|
||||
memcpy(rx_gain_dc_table, calibration_data->rx_gain_dc_table, 4 * 125);
|
||||
|
Reference in New Issue
Block a user