feat(esp_common): update esp_common

1. add Kconfig file and rename old global macro
2. move some independent files to esp_common
This commit is contained in:
Dong Heng
2020-01-15 11:59:36 +08:00
parent ba83b0d1a3
commit 622482eb76
22 changed files with 241 additions and 152 deletions

View File

@ -24,17 +24,17 @@
#include "esp8266/uart_register.h"
#include "esp8266/rom_functions.h"
#ifndef CONFIG_CONSOLE_UART_NONE
#ifndef CONFIG_ESP_CONSOLE_UART_NONE
static void uart_putc(int c)
{
while (1) {
uint32_t fifo_cnt = READ_PERI_REG(UART_STATUS(CONFIG_CONSOLE_UART_NUM)) & (UART_TXFIFO_CNT << UART_TXFIFO_CNT_S);
uint32_t fifo_cnt = READ_PERI_REG(UART_STATUS(CONFIG_ESP_CONSOLE_UART_NUM)) & (UART_TXFIFO_CNT << UART_TXFIFO_CNT_S);
if ((fifo_cnt >> UART_TXFIFO_CNT_S & UART_TXFIFO_CNT) < 126)
break;
}
WRITE_PERI_REG(UART_FIFO(CONFIG_CONSOLE_UART_NUM) , c);
WRITE_PERI_REG(UART_FIFO(CONFIG_ESP_CONSOLE_UART_NUM) , c);
}
#else
#define uart_putc(_c) { }