diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index c14dac7bc7e..76135691411 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -11,18 +11,6 @@ #include "driver/uart.h" #include "freertos/queue.h" -#ifndef ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE -#define ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE 2048 -#endif - -#ifndef ARDUINO_SERIAL_EVENT_TASK_PRIORITY -#define ARDUINO_SERIAL_EVENT_TASK_PRIORITY (configMAX_PRIORITIES - 1) -#endif - -#ifndef ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE -#define ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE -1 -#endif - #if (SOC_UART_LP_NUM >= 1) #define UART_HW_FIFO_LEN(uart_num) ((uart_num < SOC_UART_HP_NUM) ? SOC_UART_FIFO_LEN : SOC_LP_UART_FIFO_LEN) #else diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h index e52428f0dd5..b1f6df17724 100644 --- a/cores/esp32/HardwareSerial.h +++ b/cores/esp32/HardwareSerial.h @@ -97,15 +97,27 @@ typedef enum { } hardwareSerial_error_t; #ifndef ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE +#ifndef CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE #define ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE 2048 +#else +#define ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE +#endif #endif #ifndef ARDUINO_SERIAL_EVENT_TASK_PRIORITY +#ifndef CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY #define ARDUINO_SERIAL_EVENT_TASK_PRIORITY (configMAX_PRIORITIES - 1) +#else +#define ARDUINO_SERIAL_EVENT_TASK_PRIORITY CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY +#endif #endif #ifndef ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE +#ifndef CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE #define ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE -1 +#else +#define ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE +#endif #endif // UART0 pins are defined by default by the bootloader.