Skip to content

Commit

Permalink
[portinglayer] fix tasks hogging the cpu (#127)
Browse files Browse the repository at this point in the history
* [portinglayer] delete example_matter_xxx task
- dont need this task since it is just used to init other tasks
- let downlink and uplink task block when waiting for event to arrive on queue

* [portinglayer] delete example_matter task in thermostat
  • Loading branch information
step0035 committed Jun 1, 2023
1 parent 37b5433 commit f835c24
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void DownlinkTask(void * pvParameter)
// Loop here and keep listening on the queue for Downlink (Firmware application to matter)
while (true)
{
BaseType_t eventReceived = xQueueReceive(DownlinkEventQueue, &event, pdMS_TO_TICKS(10));
BaseType_t eventReceived = xQueueReceive(DownlinkEventQueue, &event, portMAX_DELAY);
while (eventReceived == pdTRUE)
{
DispatchDownlinkEvent(&event);
Expand Down Expand Up @@ -117,7 +117,7 @@ void UplinkTask(void * pvParameter)
// Loop here and keep listening on the queue for Uplink (matter to Firmware application)
while (true)
{
BaseType_t eventReceived = xQueueReceive(UplinkEventQueue, &event, pdMS_TO_TICKS(10));
BaseType_t eventReceived = xQueueReceive(UplinkEventQueue, &event, portMAX_DELAY);
while (eventReceived == pdTRUE)
{
DispatchUplinkEvent(&event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void example_matter_light_task(void *pvParameters)
if (err != CHIP_NO_ERROR)
ChipLogProgress(DeviceLayer, "matter_interaction_start_uplink failed!\n");

while(1);
vTaskDelete(NULL);
}

extern "C" void example_matter_light(void)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void example_matter_thermostat_task(void *pvParameters)
if (err != CHIP_NO_ERROR)
ChipLogProgress(DeviceLayer, "matter_interaction_start_uplink failed!\n");

while(1);
vTaskDelete(NULL);
}

extern "C" void example_matter_thermostat(void)
Expand Down

0 comments on commit f835c24

Please sign in to comment.