mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 02:30:52 +03:00
Merge branch 'feat/ot_make_esp_netif_glue_optional_v5.2' into 'release/v5.2'
feat(openthread): make esp_netif glue optional (v5.2) See merge request espressif/esp-idf!47864
This commit is contained in:
@@ -182,6 +182,7 @@ esp_err_t esp_openthread_mainloop_exit(void)
|
||||
|
||||
esp_err_t esp_openthread_launch_mainloop(void)
|
||||
{
|
||||
ESP_LOGI(OT_PLAT_LOG_TAG, "OpenThread enter mainloop");
|
||||
esp_openthread_mainloop_context_t mainloop;
|
||||
otInstance *instance = esp_openthread_get_instance();
|
||||
esp_err_t error = ESP_OK;
|
||||
@@ -240,7 +241,7 @@ static void ot_task_worker(void *aContext)
|
||||
// Initialize the OpenThread stack
|
||||
ESP_ERROR_CHECK(esp_openthread_init(&(config->platform_config)));
|
||||
|
||||
#if CONFIG_OPENTHREAD_FTD || CONFIG_OPENTHREAD_MTD
|
||||
#if CONFIG_OPENTHREAD_PLATFORM_NETIF
|
||||
esp_netif_t *openthread_netif = esp_netif_new(&(config->netif_config));
|
||||
assert(openthread_netif != NULL);
|
||||
ESP_ERROR_CHECK(esp_netif_attach(openthread_netif, esp_openthread_netif_glue_init(&(config->platform_config))));
|
||||
@@ -271,7 +272,7 @@ static void ot_task_worker(void *aContext)
|
||||
|
||||
// esp_openthread_cli_console_command_unregister is not provided on idf 5.2
|
||||
|
||||
#if CONFIG_OPENTHREAD_FTD || CONFIG_OPENTHREAD_MTD
|
||||
#if CONFIG_OPENTHREAD_PLATFORM_NETIF
|
||||
// Clean up
|
||||
esp_openthread_netif_glue_deinit();
|
||||
esp_netif_destroy(openthread_netif);
|
||||
|
||||
Reference in New Issue
Block a user