From eef0cb3dc6fb3077f410dcd8d15d06618506894d Mon Sep 17 00:00:00 2001 From: chrisdecenzo <61757564+chrisdecenzo@users.noreply.github.com> Date: Tue, 26 Apr 2022 15:39:06 -0700 Subject: [PATCH] Fix raspi startup of tv-casting-app (#17707) * Change init order * address feedback --- examples/tv-casting-app/linux/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index 40bf40ede18347..14225b04e6ca48 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -678,17 +678,16 @@ LinuxCommissionableDataProvider gCommissionableDataProvider; int main(int argc, char * argv[]) { + VerifyOrDie(CHIP_NO_ERROR == chip::Platform::MemoryInit()); + VerifyOrDie(CHIP_NO_ERROR == chip::DeviceLayer::PlatformMgr().InitChipStack()); + #if defined(ENABLE_CHIP_SHELL) Engine::Root().Init(); std::thread shellThread([]() { Engine::Root().RunMainLoop(); }); Shell::RegisterCastingCommands(); #endif - CHIP_ERROR err = CHIP_NO_ERROR; - SuccessOrExit(err = chip::Platform::MemoryInit()); - SuccessOrExit(err = chip::DeviceLayer::PlatformMgr().InitChipStack()); - // Init the commissionable data provider based on command line options // to handle custom verifiers, discriminators, etc. err = InitCommissionableDataProvider(gCommissionableDataProvider, LinuxDeviceOptions::GetInstance());