Skip to content

Commit 6389d64

Browse files
committed
Adjustable Serial Event Task Stack Size And Priority
1 parent 142fceb commit 6389d64

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: cores/esp32/HardwareSerial.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
#include "driver/uart.h"
1010
#include "freertos/queue.h"
1111

12+
#ifndef ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE
13+
#define ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE 2048
14+
#endif
15+
16+
#ifndef ARDUINO_SERIAL_EVENT_TASK_PRIORITY
17+
#define ARDUINO_SERIAL_EVENT_TASK_PRIORITY (configMAX_PRIORITIES-1)
18+
#endif
19+
1220
#ifndef SOC_RX0
1321
#if CONFIG_IDF_TARGET_ESP32
1422
#define SOC_RX0 3
@@ -159,7 +167,7 @@ HardwareSerial::~HardwareSerial()
159167
void HardwareSerial::_createEventTask(void *args)
160168
{
161169
// Creating UART event Task
162-
xTaskCreate(_uartEventTask, "uart_event_task", 2048, this, configMAX_PRIORITIES - 1, &_eventTask);
170+
xTaskCreate(_uartEventTask, "uart_event_task", ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE, this, ARDUINO_SERIAL_EVENT_TASK_PRIORITY, &_eventTask);
163171
if (_eventTask == NULL) {
164172
log_e(" -- UART%d Event Task not Created!", _uart_nr);
165173
}

0 commit comments

Comments
 (0)