Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions port/esp32/components/btstack/btstack_stdio_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ static btstack_context_callback_registration_t stdio_callback_context = {
.context = NULL,
};

#ifdef CONFIG_ESP_CONSOLE_UART
/* UART Implementation */

void btstack_stdin_setup(void (*handler)(char c)){
if (btstack_stdio_initialized == false){
ESP_LOGE(TAG, "to enable support for console input, call btstack_stdio_init first");
Expand All @@ -107,9 +110,6 @@ void btstack_stdin_setup(void (*handler)(char c)){
stdin_handler = handler;
}

#ifdef CONFIG_ESP_CONSOLE_UART
/* UART Implementation */

#include "driver/uart.h"
static QueueHandle_t uart_queue = NULL;

Expand Down Expand Up @@ -233,6 +233,14 @@ void btstack_stdio_init(void) {

#elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG

void btstack_stdin_setup(void (*handler)(char c)){
if (btstack_stdio_initialized == false){
ESP_LOGE(TAG, "to enable support for console input, call btstack_stdio_init first");
}
// set handler
stdin_handler = handler;
}

/* USB JTAG/Serial Implementation */
#include "driver/usb_serial_jtag.h"

Expand Down Expand Up @@ -284,6 +292,9 @@ void btstack_stdio_init(void) {
#else

// Empty functions for backwards-compatibility
static void btstack_stdio_process(void *context){
UNUSED(context);
}
void btstack_stdio_init(void) {}
void btstack_stdin_setup(void (*handler)(char c)){
(void) handler;
Expand Down