Skip to content
Permalink
Browse files

esp32: handle esp-idf change from CONFIG_CONSOLE_UART_NUM to CONFIG_E…

…SP_CONSOLE_UART_NUM
  • Loading branch information
mringwal committed Oct 31, 2019
1 parent 9b094d7 commit 56027aba99734f70c0a093b983124db26248a18d
Showing with 7 additions and 2 deletions.
  1. +7 −2 port/esp32/components/btstack/btstack_stdin_esp32.c
@@ -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

0 comments on commit 56027ab

Please sign in to comment.
You can’t perform that action at this time.