Skip to content

Commit e4ab2f8

Browse files
authored
[CSA-CP] Fix thermostat hang issue for SOC. (#73)
1 parent 59328fc commit e4ab2f8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

examples/thermostat/silabs/include/SensorManager.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ class SensorManager
3737

3838
osTimerId_t mSensorTimer;
3939

40-
// Reads new generated sensor value, stores it, and updates local temperature attribute
4140
static void SensorTimerEventHandler(void * arg);
41+
// Reads new generated sensor value, stores it, and updates local temperature attribute
42+
static void TemperatureUpdateEventHandler(AppEvent * aEvent);
4243

4344
static SensorManager sSensorManager;
4445
};

examples/thermostat/silabs/src/SensorManager.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ CHIP_ERROR SensorManager::Init()
7878
}
7979

8080
void SensorManager::SensorTimerEventHandler(void * arg)
81+
{
82+
AppEvent event;
83+
event.Type = AppEvent::kEventType_Timer;
84+
event.Handler = TemperatureUpdateEventHandler;
85+
86+
AppTask::GetAppTask().PostEvent(&event);
87+
}
88+
89+
void SensorManager::TemperatureUpdateEventHandler(AppEvent * aEvent)
8190
{
8291
int16_t temperature = 0;
8392
static int16_t lastTemperature = 0;

0 commit comments

Comments
 (0)