Skip to content

Commit

Permalink
Fix GetBootReason prototype so it overrides the generic one, Replace …
Browse files Browse the repository at this point in the history
…sl_ot_sys_init by manual call. OT efr32MiscInit was 'stealing' the reboot cause from the matter stack (#22077)
  • Loading branch information
jmartinez-silabs authored Aug 22, 2022
1 parent a71a002 commit f68b948
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/platform/efr32/init_efrPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ void init_efrPlatform(void)
#endif

#if CHIP_ENABLE_OPENTHREAD
sl_ot_sys_init();
efr32RadioInit();
efr32AlarmInit();
#endif // CHIP_ENABLE_OPENTHREAD
}

Expand Down
5 changes: 3 additions & 2 deletions src/platform/EFR32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ CHIP_ERROR ConfigurationManagerImpl::IncreaseBootCount(void)
return EFR32Config::WriteConfigValue(EFR32Config::kConfigKey_BootCount, bootCount + 1);
}

uint32_t ConfigurationManagerImpl::GetBootReason(void)
CHIP_ERROR ConfigurationManagerImpl::GetBootReason(uint32_t & bootReason)
{
// rebootCause is obtained at bootup.
BootReasonType matterBootCause;
Expand Down Expand Up @@ -150,7 +150,8 @@ uint32_t ConfigurationManagerImpl::GetBootReason(void)
matterBootCause = BootReasonType::kUnspecified;
#endif

return to_underlying(matterBootCause);
bootReason = to_underlying(matterBootCause);
return CHIP_NO_ERROR;
}

CHIP_ERROR ConfigurationManagerImpl::GetTotalOperationalHours(uint32_t & totalOperationalHours)
Expand Down
2 changes: 1 addition & 1 deletion src/platform/EFR32/ConfigurationManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp
// This returns an instance of this class.
static ConfigurationManagerImpl & GetDefaultInstance();

uint32_t GetBootReason(void);
CHIP_ERROR GetBootReason(uint32_t & bootReason);
CHIP_ERROR GetRebootCount(uint32_t & rebootCount);
CHIP_ERROR IncreaseBootCount(void);
CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours);
Expand Down

0 comments on commit f68b948

Please sign in to comment.