Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Oct 8, 2024
1 parent b139298 commit fa07f4b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/thermostat/silabs/src/SensorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 1 addition & 15 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" ]
}
Expand Down
15 changes: 15 additions & 0 deletions third_party/silabs/silabs_board.gni
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ declare_args() {

# Self-provision enabled
use_provision_channel = false

# Temperature Sensor support
sl_enable_si70xx_sensor = false
}

declare_args() {
Expand All @@ -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")
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit fa07f4b

Please sign in to comment.