mirror of
https://github.com/espressif/esp-idf.git
synced 2026-06-02 11:16:33 +03:00
feat(openthread): optimized the autostart macro
This commit is contained in:
@@ -125,16 +125,13 @@ void app_main(void)
|
||||
#if CONFIG_OPENTHREAD_CLI_ESP_EXTENSION
|
||||
esp_cli_custom_command_init();
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_BORDER_ROUTER_AUTO_START
|
||||
#if CONFIG_OPENTHREAD_STATE_INDICATOR_ENABLE
|
||||
ESP_ERROR_CHECK(esp_openthread_state_indicator_init(esp_openthread_get_instance()));
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_BORDER_ROUTER && CONFIG_OPENTHREAD_NETWORK_AUTO_START
|
||||
ESP_ERROR_CHECK(esp_openthread_border_router_start());
|
||||
#if CONFIG_ESP_COEX_SW_COEXIST_ENABLE && CONFIG_SOC_IEEE802154_SUPPORTED
|
||||
ESP_ERROR_CHECK(esp_coex_wifi_i154_enable());
|
||||
#endif
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_STATE_INDICATOR_ENABLE
|
||||
ESP_ERROR_CHECK(esp_openthread_state_indicator_init(esp_openthread_get_instance()));
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_NETWORK_AUTO_START
|
||||
ot_network_auto_start();
|
||||
#endif
|
||||
}
|
||||
|
||||
2
examples/openthread/ot_br/sdkconfig.ci.br_autostart
Normal file
2
examples/openthread/ot_br/sdkconfig.ci.br_autostart
Normal file
@@ -0,0 +1,2 @@
|
||||
CONFIG_OPENTHREAD_NETWORK_AUTO_START=y
|
||||
CONFIG_OPENTHREAD_CLI_WIFI=n
|
||||
@@ -1,6 +1,5 @@
|
||||
# Enable BR auto start for Ethernet builds
|
||||
CONFIG_OPENTHREAD_NETWORK_AUTO_START=y
|
||||
CONFIG_OPENTHREAD_BORDER_ROUTER_AUTO_START=y
|
||||
|
||||
# Enable PPP support as a workaround to ensure LWIP thread-lib compatibility for Ethernet builds
|
||||
CONFIG_LWIP_PPP_SUPPORT=y
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
set(srcs "")
|
||||
|
||||
if(CONFIG_OPENTHREAD_BORDER_ROUTER_AUTO_START)
|
||||
if(CONFIG_OPENTHREAD_BORDER_ROUTER AND CONFIG_OPENTHREAD_NETWORK_AUTO_START)
|
||||
list(APPEND srcs "ot_examples_br.c")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
menu "OpenThread Border Router Config"
|
||||
depends on OPENTHREAD_BORDER_ROUTER
|
||||
|
||||
config OPENTHREAD_BORDER_ROUTER_AUTO_START
|
||||
depends on OPENTHREAD_BORDER_ROUTER
|
||||
bool 'Enable the border router auto start'
|
||||
default n
|
||||
help
|
||||
If enabled, the program will automatically connect to the backbone network and
|
||||
initialize the border router at startup.
|
||||
|
||||
endmenu
|
||||
Reference in New Issue
Block a user