From 1f664bb4f78306d889514b88cc4d00a414ba0e5b Mon Sep 17 00:00:00 2001 From: xieqinan Date: Tue, 21 Feb 2023 14:43:50 +0800 Subject: [PATCH] openthread: add the configurable option of uart buffer size --- components/openthread/Kconfig | 8 ++++++++ .../private_include/esp_openthread_common_macro.h | 2 +- examples/openthread/ot_br/main/esp_ot_config.h | 2 +- examples/openthread/ot_rcp/main/esp_ot_config.h | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/openthread/Kconfig b/components/openthread/Kconfig index b5ca972973..133a157f4a 100644 --- a/components/openthread/Kconfig +++ b/components/openthread/Kconfig @@ -150,4 +150,12 @@ menu "OpenThread" help Select this option to acquire NAT64 address from dns servers. + config OPENTHREAD_UART_BUFFER_SIZE + int "The uart received buffer size of openthread" + depends on OPENTHREAD_ENABLED + default 256 + range 128 1024 + help + Set the OpenThread UART buffer size. + endmenu diff --git a/components/openthread/private_include/esp_openthread_common_macro.h b/components/openthread/private_include/esp_openthread_common_macro.h index 9bb23e5891..354ea5128c 100644 --- a/components/openthread/private_include/esp_openthread_common_macro.h +++ b/components/openthread/private_include/esp_openthread_common_macro.h @@ -20,4 +20,4 @@ #define US_PER_S (MS_PER_S * US_PER_MS) #endif -#define ESP_OPENTHREAD_UART_BUFFER_SIZE (UART_FIFO_LEN * 2) +#define ESP_OPENTHREAD_UART_BUFFER_SIZE CONFIG_OPENTHREAD_UART_BUFFER_SIZE diff --git a/examples/openthread/ot_br/main/esp_ot_config.h b/examples/openthread/ot_br/main/esp_ot_config.h index cdf033f985..3641f0a307 100644 --- a/examples/openthread/ot_br/main/esp_ot_config.h +++ b/examples/openthread/ot_br/main/esp_ot_config.h @@ -29,7 +29,7 @@ .port = 1, \ .uart_config = \ { \ - .baud_rate = 115200, \ + .baud_rate = 460800, \ .data_bits = UART_DATA_8_BITS, \ .parity = UART_PARITY_DISABLE, \ .stop_bits = UART_STOP_BITS_1, \ diff --git a/examples/openthread/ot_rcp/main/esp_ot_config.h b/examples/openthread/ot_rcp/main/esp_ot_config.h index a54e23c0cf..89e25f62f4 100644 --- a/examples/openthread/ot_rcp/main/esp_ot_config.h +++ b/examples/openthread/ot_rcp/main/esp_ot_config.h @@ -35,7 +35,7 @@ .port = 0, \ .uart_config = \ { \ - .baud_rate = 115200, \ + .baud_rate = 460800, \ .data_bits = UART_DATA_8_BITS, \ .parity = UART_PARITY_DISABLE, \ .stop_bits = UART_STOP_BITS_1, \