Skip to content

Commit

Permalink
Added build configuration flags (#26273)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs authored and pull[bot] committed Nov 30, 2023
1 parent d938bd2 commit 1666956
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@
#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1

#if CHIP_DEVICE_CONFIG_ENABLE_SED

#define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 0

// In seconds
#define SL_MLE_TIMEOUT_seconds (SL_SLEEP_TIME_MS / 1000)
#define SL_MLE_TIMEOUT_s (SL_OT_IDLE_INTERVAL / 1000)

// Timeout after 2 missed checkin or 4 mins if sleep interval is too short.
#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_seconds < 120) ? 240 : ((SL_MLE_TIMEOUT_seconds * 2) + 1))
#endif
#define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_s < 120) ? 240 : ((SL_MLE_TIMEOUT_s * 2) + 1))

#endif // CHIP_DEVICE_CONFIG_ENABLE_SED

/****Uncomment below section for OpenThread Debug logs*/
// #define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG
Expand Down
8 changes: 6 additions & 2 deletions src/platform/silabs/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,17 @@
#endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE

#ifndef CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL
#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL chip::System::Clock::Milliseconds32(SL_SLEEP_TIME_MS)
#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL chip::System::Clock::Milliseconds32(SL_OT_IDLE_INTERVAL)
#endif // CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL

#ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL
#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL chip::System::Clock::Milliseconds32(200)
#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL chip::System::Clock::Milliseconds32(SL_OT_ACTIVE_INTERVAL)
#endif // CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL

#ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD
#define CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD chip::System::Clock::Milliseconds32(SL_ACTIVE_MODE_THRESHOLD)
#endif // CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD

#ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE
#if defined(EFR32MG21)
#define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE (2 * 1024)
Expand Down
9 changes: 7 additions & 2 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ declare_args() {
# Enable Segger System View
use_system_view = false

sleep_time_ms = 30000 # 30 seconds sleep
# ICD Configuration flags
sl_ot_idle_interval_ms = 30000 # 30s Idle Intervals
sl_ot_active_interval_ms = 200 # 500ms Active Intervals
sl_active_mode_threshold = 1000 # 1s Active mode threshold

silabs_log_enabled = true

Expand Down Expand Up @@ -337,7 +340,9 @@ template("efr32_sdk") {
"CHIP_DEVICE_CONFIG_ENABLE_SED=1",
"SL_CATALOG_POWER_MANAGER_PRESENT",
"SL_CATALOG_SLEEPTIMER_PRESENT",
"SL_SLEEP_TIME_MS=${sleep_time_ms}",
"SL_OT_IDLE_INTERVAL=${sl_ot_idle_interval_ms}",
"SL_OT_ACTIVE_INTERVAL=${sl_ot_active_interval_ms}",
"SL_ACTIVE_MODE_THRESHOLD=${sl_active_mode_threshold}",
]

if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) {
Expand Down

0 comments on commit 1666956

Please sign in to comment.