[Silabs] [917SoC] Fixing sleepy with non LCD build fix (#34272)
* fixing sleepy and non lcd build fix
* merging the icd and non lcd case
* Restyled by gn
* addressing the review comments
---------
Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/src/platform/silabs/KeyValueStoreManagerImpl.cpp b/src/platform/silabs/KeyValueStoreManagerImpl.cpp
index 8f886db..012c951 100644
--- a/src/platform/silabs/KeyValueStoreManagerImpl.cpp
+++ b/src/platform/silabs/KeyValueStoreManagerImpl.cpp
@@ -164,15 +164,9 @@
During commissioning, the key map will be modified multiples times subsequently.
Commit the key map in nvm once it as stabilized.
*/
-#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
- // TODO: Remove this when RTC timer is added MATTER-2705
- SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_KvsStringKeyMap, reinterpret_cast<const uint8_t *>(mKvsKeyMap),
- sizeof(mKvsKeyMap));
-#else
SystemLayer().StartTimer(
std::chrono::duration_cast<System::Clock::Timeout>(System::Clock::Seconds32(SILABS_KVS_SAVE_DELAY_SECONDS)),
KeyValueStoreManagerImpl::OnScheduledKeyMapSave, NULL);
-#endif // defined(SLI_SI91X_MCU_INTERFACE) && CHIP_CONFIG_ENABLE_ICD_SERVER
}
CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size,
diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni
index a7bfe14..5faba08 100644
--- a/third_party/silabs/SiWx917_sdk.gni
+++ b/third_party/silabs/SiWx917_sdk.gni
@@ -291,14 +291,20 @@
if (invoker.enable_dic) {
_include_dirs += [ "${chip_root}/third_party/silabs/mqtt/stack" ]
}
+
+ if (chip_enable_icd_server || !disable_lcd) {
+ defines += [
+ "SL_SLEEP_TIMER=1",
+ "SI91X_SYSRTC_COUNT=1",
+ ]
+ }
+
if (!disable_lcd) {
defines += [
"CONFIG_ENABLE_UART",
- "SI91X_SYSRTC_COUNT=1",
"SYSCALLS_WRITE",
"SPI_MULTI_SLAVE",
"SL_ULP_TIMER",
- "SL_SLEEP_TIMER",
]
}
@@ -755,6 +761,14 @@
]
}
+ if (chip_enable_icd_server || !disable_lcd) {
+ sources += [
+ "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer.c",
+ "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_sysrtc.c",
+ "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/sleeptimer/src/sl_sleeptimer_hal_si91x_sysrtc.c",
+ ]
+ }
+
if (!disable_lcd) {
sources += [
"${efr32_sdk_root}/platform/middleware/glib/dmd/display/dmd_memlcd.c",
@@ -769,13 +783,10 @@
"${efr32_sdk_root}/platform/middleware/glib/glib/glib_polygon.c",
"${efr32_sdk_root}/platform/middleware/glib/glib/glib_rectangle.c",
"${efr32_sdk_root}/platform/middleware/glib/glib/glib_string.c",
- "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/cmsis_driver/SPI.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/src/memlcd_917/sl_memlcd_spi.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/src/sl_memlcd.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/src/sl_memlcd_display.c",
- "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_sysrtc.c",
- "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/sleeptimer/src/sl_sleeptimer_hal_si91x_sysrtc.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_ulp_timer.c",
]
}