mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 14:47:46 +00:00
Retry otInstanceInit multiple times in otNodeInit (#1271)
This commit is contained in:
@@ -766,8 +766,17 @@ OTNODEAPI otNode* OTCALL otNodeInit(uint32_t id)
|
||||
otvmpRemoveVirtualBus(gVmpHandle, newBusIndex);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto instance = otInstanceInit(ApiInstance, &ifGuid);
|
||||
|
||||
// Try multiple times to instantiate the otInstance, as the MP comes up first
|
||||
// and the LWF driver might not be ready immedaitely.
|
||||
tries = 0;
|
||||
otInstance *instance = nullptr;
|
||||
do
|
||||
{
|
||||
if (tries != 0) Sleep(100);
|
||||
instance = otInstanceInit(ApiInstance, &ifGuid);
|
||||
} while (instance == nullptr && ++tries <= 30);
|
||||
|
||||
if (instance == nullptr)
|
||||
{
|
||||
printf("otInstanceInit failed!\r\n");
|
||||
|
||||
Reference in New Issue
Block a user