Skip to content

Commit

Permalink
Merge branch 'feature/br_board_usb_init_refactor' into 'main'
Browse files Browse the repository at this point in the history
feat(BR): USB console init refactor

See merge request espressif/esp-thread-br!87
  • Loading branch information
chshu committed Nov 20, 2023
2 parents 43d3326 + 2cda31a commit b96fbd8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 74 deletions.
2 changes: 1 addition & 1 deletion docs/en/dev-guide/build_and_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Clone the `esp-idf <https://github.com/espressif/esp-idf>`_ and the `esp-thread-

.. code-block:: bash
git clone -b v5.1.1 --recursive https://github.com/espressif/esp-idf.git
git clone -b v5.1.2 --recursive https://github.com/espressif/esp-idf.git
.. code-block:: bash
Expand Down
8 changes: 8 additions & 0 deletions examples/basic_thread_border_router/main/esp_ot_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
.target_chip = ESP32H2_CHIP, \
}

#if CONFIG_OPENTHREAD_CONSOLE_TYPE_UART
#define ESP_OPENTHREAD_DEFAULT_HOST_CONFIG() \
{ \
.host_connection_mode = HOST_CONNECTION_MODE_CLI_UART, \
Expand All @@ -96,6 +97,13 @@
.tx_pin = UART_PIN_NO_CHANGE, \
}, \
}
#elif CONFIG_OPENTHREAD_CONSOLE_TYPE_USB_SERIAL_JTAG
#define ESP_OPENTHREAD_DEFAULT_HOST_CONFIG() \
{ \
.host_connection_mode = HOST_CONNECTION_MODE_CLI_USB, \
.host_usb_config = USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT(), \
}
#endif

#define ESP_OPENTHREAD_DEFAULT_PORT_CONFIG() \
{ \
Expand Down
3 changes: 2 additions & 1 deletion examples/basic_thread_border_router/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ CONFIG_OPENTHREAD_ENABLED=y
CONFIG_OPENTHREAD_BORDER_ROUTER=y
CONFIG_OPENTHREAD_TREL=y
CONFIG_OPENTHREAD_CLI_OTA=y
CONFIG_OPENTHREAD_CONSOLE_TYPE_USB_SERIAL_JTAG=y
# end of OpenThread

#
Expand Down Expand Up @@ -107,4 +108,4 @@ CONFIG_EXAMPLE_ETH_SPI_CLOCK_MHZ=36
CONFIG_EXAMPLE_ETH_SPI_INT_GPIO=39
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=40
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
# end of Etherenet
# end of Etherenet
4 changes: 0 additions & 4 deletions examples/common/border_router_board/CMakeLists.txt

This file was deleted.

18 changes: 0 additions & 18 deletions examples/common/border_router_board/include/border_router_board.h

This file was deleted.

47 changes: 0 additions & 47 deletions examples/common/border_router_board/src/border_router_board.c

This file was deleted.

2 changes: 1 addition & 1 deletion examples/common/thread_border_router/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(requires esp_ot_cli_extension openthread vfs border_router_board)
set(requires esp_ot_cli_extension openthread vfs)

if(CONFIG_OPENTHREAD_CLI_OTA)
list(APPEND requires esp_http_client esp_br_http_ota)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include "border_router_launch.h"
#include "border_router_board.h"

#include <assert.h>
#include <stdio.h>
Expand Down Expand Up @@ -94,7 +93,6 @@ static void ot_task_worker(void *ctx)
assert(openthread_netif != NULL);

// Initialize the OpenThread stack
ESP_ERROR_CHECK(border_router_board_init());
esp_openthread_register_rcp_failure_handler(rcp_failure_handler);
ESP_ERROR_CHECK(esp_openthread_init(&s_openthread_platform_config));

Expand Down

0 comments on commit b96fbd8

Please sign in to comment.