Skip to content

Commit

Permalink
[Silabs] Silabs fix app error (project-chip#32238)
Browse files Browse the repository at this point in the history
* fix main

* Fix app errorr
  • Loading branch information
jepenven-silabs authored and bhmanda-silabs committed Feb 22, 2024
1 parent e53484d commit c9ae112
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions examples/platform/silabs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ int main(void)

void application_start(void * unused)
{
if (SilabsMatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);
CHIP_ERROR err = SilabsMatterConfig::InitMatter(BLE_DEV_NAME);
if (err != CHIP_NO_ERROR)
appError(err);

gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
Expand All @@ -83,8 +84,9 @@ void application_start(void * unused)
chip::DeviceLayer::PlatformMgr().UnlockChipStack();

SILABS_LOG("Starting App Task");
if (AppTask::GetAppTask().StartAppTask() != CHIP_NO_ERROR)
appError(CHIP_ERROR_INTERNAL);
err = AppTask::GetAppTask().StartAppTask();
if (err != CHIP_NO_ERROR)
appError(err);

vTaskDelete(main_Task);
}
2 changes: 1 addition & 1 deletion examples/platform/silabs/silabs_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void appError(int err)
snprintf(faultMessage, sizeof faultMessage, "App Critical Error:%d", err);
SILABS_LOG("!!!!!!!!!!!! %s !!!!!!!!!!!", faultMessage);
chip::DeviceLayer::Silabs::OnSoftwareFaultEventHandler(faultMessage);
vTaskDelay(pdMS_TO_TICKS(1000));
vTaskSuspendAll();
/* Force an assert. */
chipAbort();
}
Expand Down

0 comments on commit c9ae112

Please sign in to comment.