From fa07f4b3d0ebf601fccf76ad2373629a99c3c959 Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Tue, 8 Oct 2024 16:55:54 -0400 Subject: [PATCH] Address review comments --- examples/thermostat/silabs/src/SensorManager.cpp | 4 ++-- third_party/silabs/efr32_sdk.gni | 16 +--------------- third_party/silabs/matter_support | 2 +- third_party/silabs/silabs_board.gni | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/examples/thermostat/silabs/src/SensorManager.cpp b/examples/thermostat/silabs/src/SensorManager.cpp index afa3ddcaba1cce..3522e9f5a30d1d 100644 --- a/examples/thermostat/silabs/src/SensorManager.cpp +++ b/examples/thermostat/silabs/src/SensorManager.cpp @@ -83,7 +83,7 @@ void SensorManager::SensorTimerEventHandler(void * arg) static int16_t lastTemperature = 0; #if defined(SL_MATTER_USE_SI70XX_SENSOR) && SL_MATTER_USE_SI70XX_SENSOR - int16_t tempSum = 0; + int32_t tempSum = 0; uint16_t humidity = 0; for (uint8_t i = 0; i < 100; i++) @@ -118,7 +118,7 @@ void SensorManager::SensorTimerEventHandler(void * arg) MarkAttributeDirty reportState = MarkAttributeDirty::kNo; if ((temperature >= (lastTemperature + kMinTemperatureDelta)) || temperature <= (lastTemperature - kMinTemperatureDelta)) { - reportState = MarkAttributeDirty::kYes; + reportState = MarkAttributeDirty::kIfChanged; } lastTemperature = temperature; diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 2888c4b3ae1145..146077372f4cc6 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -91,15 +91,6 @@ declare_args() { # Enable TestEventTrigger in GeneralDiagnostics cluster sl_enable_test_event_trigger = false - - # Temperature Sensor support - sl_enable_si70xx_sensor = false -} - -declare_args() { - # This argument is for retro-compatibility since use_temp_sensor was used by the thermostat app. - # It should not be used anymore. - use_temp_sensor = sl_enable_si70xx_sensor } examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" @@ -693,12 +684,7 @@ template("efr32_sdk") { } if (sl_enable_si70xx_sensor) { - defines += [ - "SL_MATTER_USE_SI70XX_SENSOR=1", - - # Define is left of retro-compatibility. It should not be used anymore. - "USE_TEMP_SENSOR", - ] + defines += [ "SL_MATTER_USE_SI70XX_SENSOR=1" ] } else { defines += [ "SL_MATTER_USE_SI70XX_SENSOR=0" ] } diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 0576137010a943..841d43db7e8687 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 0576137010a943aa88f14ff39de92c2634ea2299 +Subproject commit 841d43db7e86877636cd73b5244da4c34d38d544 diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 213417976d3318..03b2ea7cb67cb5 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -53,6 +53,9 @@ declare_args() { # Self-provision enabled use_provision_channel = false + + # Temperature Sensor support + sl_enable_si70xx_sensor = false } declare_args() { @@ -75,6 +78,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { silabs_mcu = "SiWG917M111MGTBA" wifi_soc = true + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") + # EFR32 MG24 series ---------- } else if (silabs_board == "BRD4186A" || silabs_board == "BRD4187A") { variant = string_replace(silabs_board, "A", "C") @@ -104,6 +110,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { show_qr_code = false disable_lcd = true + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") + # EFR32 MG24 Modules series ---------- } else if (silabs_board == "BRD4316A") { silabs_family = "mgm24" @@ -128,6 +137,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { use_external_flash = false show_qr_code = false disable_lcd = true + + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") } else if (silabs_board == "BRD2704A") { silabs_family = "mgm24" silabs_mcu = "MGM240PB32VNA" @@ -137,6 +149,9 @@ if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { use_external_flash = false show_qr_code = false disable_lcd = true + + assert(!sl_enable_si70xx_sensor, + "${silabs_board} does not support the si90xx sensor!") } else if (silabs_board == "BRD4318A") { silabs_family = "mgm24" silabs_mcu = "MGM240SD22VNA"