mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
esp32: handle esp-idf change from CONFIG_CONSOLE_UART_NUM to CONFIG_ESP_CONSOLE_UART_NUM
This commit is contained in:
parent
b7c449ec05
commit
a4ddb25eb3
@ -53,6 +53,11 @@
|
||||
#include "freertos/task.h"
|
||||
#include "driver/uart.h"
|
||||
|
||||
// handle esp-idf change from CONFIG_CONSOLE_UART_NUM to CONFIG_ESP_CONSOLE_UART_NUM
|
||||
#ifndef CONFIG_ESP_CONSOLE_UART_NUM
|
||||
#define CONFIG_ESP_CONSOLE_UART_NUM CONFIG_CONSOLE_UART_NUM
|
||||
#endif
|
||||
|
||||
#define BUF_SIZE (UART_FIFO_LEN)
|
||||
|
||||
volatile int stdin_character_received;
|
||||
@ -72,11 +77,11 @@ static void btstack_stdin_task(void *arg){
|
||||
UNUSED(arg);
|
||||
|
||||
//Install UART driver, and get the queue.
|
||||
uart_driver_install(CONFIG_CONSOLE_UART_NUM, UART_FIFO_LEN * 2, UART_FIFO_LEN * 2, 0, NULL, 0);
|
||||
uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, UART_FIFO_LEN * 2, UART_FIFO_LEN * 2, 0, NULL, 0);
|
||||
|
||||
do {
|
||||
// read single byte
|
||||
uart_read_bytes(CONFIG_CONSOLE_UART_NUM, (uint8_t*) &stdin_character, 1, portMAX_DELAY);
|
||||
uart_read_bytes(CONFIG_ESP_CONSOLE_UART_NUM, (uint8_t*) &stdin_character, 1, portMAX_DELAY);
|
||||
stdin_character_received = 1;
|
||||
|
||||
// request poll
|
||||
|
Loading…
x
Reference in New Issue
Block a user