Skip to content

Commit

Permalink
Cherry-picked changes to fix thermostat hang issue for SOC.
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-silabs committed Oct 25, 2024
1 parent 779fb67 commit c1b7bda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/thermostat/silabs/include/SensorManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ class SensorManager

osTimerId_t mSensorTimer;

// Reads new generated sensor value, stores it, and updates local temperature attribute
static void SensorTimerEventHandler(void * arg);
// Reads new generated sensor value, stores it, and updates local temperature attribute
static void TemperatureUpdateEventHandler(AppEvent * aEvent);

static SensorManager sSensorManager;
};
Expand Down
9 changes: 9 additions & 0 deletions examples/thermostat/silabs/src/SensorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ CHIP_ERROR SensorManager::Init()
}

void SensorManager::SensorTimerEventHandler(void * arg)
{
AppEvent event;
event.Type = AppEvent::kEventType_Timer;
event.Handler = TemperatureUpdateEventHandler;

AppTask::GetAppTask().PostEvent(&event);
}

void SensorManager::TemperatureUpdateEventHandler(AppEvent * aEvent)
{
int16_t temperature = 0;
static int16_t lastTemperature = 0;
Expand Down

0 comments on commit c1b7bda

Please sign in to comment.