Skip to content

Commit d8e052d

Browse files
mergify[bot]Sarthak-Shahapre-commit-ci[bot]
authored
[Silabs] : Fix EM4 conditions (Auto-merged by platform-bot) (#73896) (#73916)
* move IRQ just before em4 entry , similar to bootlaoder * use SL_IDLE_MODE_DURATION_S as OT child supervision timeout * fix define and apply comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- (cherry picked from commit 8a7dd55) Co-authored-by: sarthak shaha <sarthak.shaha@silabs.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2dcad29 commit d8e052d

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

examples/platform/silabs/MatterConfig.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,14 @@ void OnEM4Trigger(uint32_t duration)
407407
BURTC_CounterReset();
408408
BURTC_CompareSet(0, duration);
409409

410-
BURTC_IntEnable(BURTC_IEN_COMP); // compare match
411-
NVIC_EnableIRQ(BURTC_IRQn);
412410
BURTC_Enable(true);
413411
EMU_EM4Init_TypeDef em4Init = EMU_EM4INIT_DEFAULT;
414412
EMU_EM4Init(&em4Init);
415413
BURTC_CounterReset();
414+
415+
BURTC_IntClear(BURTC_IF_COMP);
416+
BURTC_IntEnable(BURTC_IEN_COMP); // compare match
417+
NVIC_EnableIRQ(BURTC_IRQn);
416418
EMU_EnterEM4();
417419
}
418420

examples/platform/silabs/efr32/project_include/OpenThreadConfig.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@
3939
#ifdef SL_ICD_ENABLED
4040
#define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 0
4141

42-
// In seconds
43-
#define SL_MLE_TIMEOUT_s (SL_TRANSPORT_IDLE_INTERVAL / 1000)
44-
45-
// Timeout after 2 missed checkin or 4 mins if sleep interval is too short.
46-
#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_s < 120) ? 240 : ((SL_MLE_TIMEOUT_s * 2) + 1))
42+
// Timeout after 2 missed check-ins, or 4 mins if sleep interval is too short.
43+
#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT \
44+
(((SL_TRANSPORT_IDLE_INTERVAL / 1000) < 120) ? 240 : (((SL_TRANSPORT_IDLE_INTERVAL / 1000) * 2) + 1))
4745

4846
#if defined(SL_CSL_ENABLE) && SL_CSL_ENABLE || SL_CONFIG_OPENTHREAD_LIB
4947

@@ -57,6 +55,12 @@
5755

5856
#endif // SL_CSL_ENABLE || SL_CONFIG_OPENTHREAD_LIB
5957

58+
// Keep child-supervision check aligned with LIT idle so it cannot wake the device
59+
// mid-idle before the EM4 / slow-poll window.
60+
#ifndef OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT
61+
#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT SL_IDLE_MODE_DURATION_S
62+
#endif
63+
6064
#endif // SL_ICD_ENABLED
6165

6266
/****Uncomment below section for OpenThread Debug logs*/

0 commit comments

Comments
 (0)