Skip to content

Commit

Permalink
Init openthread stack after server init (#37073)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-ESP authored Jan 16, 2025
1 parent e01471d commit eab776e
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 14 deletions.
2 changes: 0 additions & 2 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ extern "C" void app_main()
}

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

ESPOpenThreadInit();
}

bool lowPowerClusterSleep()
Expand Down
2 changes: 0 additions & 2 deletions examples/all-clusters-minimal-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ extern "C" void app_main()
}

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

ESPOpenThreadInit();
}

bool lowPowerClusterSleep()
Expand Down
2 changes: 0 additions & 2 deletions examples/energy-management-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,4 @@ extern "C" void app_main()
SetDeviceAttestationCredentialsProvider(get_dac_provider());

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

ESPOpenThreadInit();
}
2 changes: 0 additions & 2 deletions examples/light-switch-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ extern "C" void app_main()

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

ESPOpenThreadInit();

error = GetAppTask().StartAppTask();
if (error != CHIP_NO_ERROR)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ extern "C" void app_main()

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

ESPOpenThreadInit();

error = GetAppTask().StartAppTask();
if (error != CHIP_NO_ERROR)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/lit-icd-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,4 @@ extern "C" void app_main()
sButton.SetUatButtonPressCallback(UatButtonHandler);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

ESPOpenThreadInit();
}
3 changes: 3 additions & 0 deletions examples/platform/esp32/common/Esp32AppServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "Esp32AppServer.h"
#include "CHIPDeviceManager.h"
#include "Esp32ThreadInit.h"
#include <app/InteractionModelEngine.h>
#include <app/TestEventTriggerDelegate.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
Expand Down Expand Up @@ -159,6 +160,8 @@ void Esp32AppServer::Init(AppDelegate * sAppDelegate)
}
chip::Server::GetInstance().Init(initParams);

ESPOpenThreadInit();

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
#ifdef CONFIG_ENABLE_CHIP_SHELL
chip::Shell::SetWiFiDriver(&(chip::DeviceLayer::NetworkCommissioning::ESPWiFiDriver::GetInstance()));
Expand Down
2 changes: 0 additions & 2 deletions examples/thread-br-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ extern "C" void app_main()
esp_openthread_set_backbone_netif(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"));

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, reinterpret_cast<intptr_t>(nullptr));

ESPOpenThreadInit();
}

extern "C" void otSysProcessDrivers(otInstance * aInstance)
Expand Down

0 comments on commit eab776e

Please sign in to comment.