Skip to content

Commit 1379268

Browse files
jmartinez-silabspull[bot]
authored andcommitted
Fix GetBootReason prototype so it overrides the generic one, Replace sl_ot_sys_init by manual call. OT efr32MiscInit was 'stealing' the reboot cause from the matter stack (#22077)
1 parent afd1df1 commit 1379268

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

examples/platform/efr32/init_efrPlatform.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ void init_efrPlatform(void)
6868
#endif
6969

7070
#if CHIP_ENABLE_OPENTHREAD
71-
sl_ot_sys_init();
71+
efr32RadioInit();
72+
efr32AlarmInit();
7273
#endif // CHIP_ENABLE_OPENTHREAD
7374
}
7475

src/platform/EFR32/ConfigurationManagerImpl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ CHIP_ERROR ConfigurationManagerImpl::IncreaseBootCount(void)
9797
return EFR32Config::WriteConfigValue(EFR32Config::kConfigKey_BootCount, bootCount + 1);
9898
}
9999

100-
uint32_t ConfigurationManagerImpl::GetBootReason(void)
100+
CHIP_ERROR ConfigurationManagerImpl::GetBootReason(uint32_t & bootReason)
101101
{
102102
// rebootCause is obtained at bootup.
103103
BootReasonType matterBootCause;
@@ -150,7 +150,8 @@ uint32_t ConfigurationManagerImpl::GetBootReason(void)
150150
matterBootCause = BootReasonType::kUnspecified;
151151
#endif
152152

153-
return to_underlying(matterBootCause);
153+
bootReason = to_underlying(matterBootCause);
154+
return CHIP_NO_ERROR;
154155
}
155156

156157
CHIP_ERROR ConfigurationManagerImpl::GetTotalOperationalHours(uint32_t & totalOperationalHours)

src/platform/EFR32/ConfigurationManagerImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp
4040
// This returns an instance of this class.
4141
static ConfigurationManagerImpl & GetDefaultInstance();
4242

43-
uint32_t GetBootReason(void);
43+
CHIP_ERROR GetBootReason(uint32_t & bootReason);
4444
CHIP_ERROR GetRebootCount(uint32_t & rebootCount);
4545
CHIP_ERROR IncreaseBootCount(void);
4646
CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours);

0 commit comments

Comments
 (0)