From 2b3261d680a61f95bde6cf9a38c35dc9d4bb8d75 Mon Sep 17 00:00:00 2001 From: step0035 Date: Mon, 29 May 2023 12:19:50 +0800 Subject: [PATCH 1/2] [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 --- .../common/application/matter/core/matter_interaction.cpp | 4 ++-- .../application/matter/example/light/example_matter_light.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/component/common/application/matter/core/matter_interaction.cpp b/component/common/application/matter/core/matter_interaction.cpp index 036a2bea..595a45a3 100644 --- a/component/common/application/matter/core/matter_interaction.cpp +++ b/component/common/application/matter/core/matter_interaction.cpp @@ -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); @@ -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); diff --git a/component/common/application/matter/example/light/example_matter_light.cpp b/component/common/application/matter/example/light/example_matter_light.cpp index c5ae6e62..302a6b2b 100644 --- a/component/common/application/matter/example/light/example_matter_light.cpp +++ b/component/common/application/matter/example/light/example_matter_light.cpp @@ -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) From b184d067c31d41c7d6546681239c73e61f51b48a Mon Sep 17 00:00:00 2001 From: step0035 Date: Mon, 29 May 2023 19:06:00 +0800 Subject: [PATCH 2/2] [portinglayer] delete example_matter task in thermostat --- .../matter/example/thermostat/example_matter_thermostat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/common/application/matter/example/thermostat/example_matter_thermostat.cpp b/component/common/application/matter/example/thermostat/example_matter_thermostat.cpp index 83d941a0..cf794e59 100644 --- a/component/common/application/matter/example/thermostat/example_matter_thermostat.cpp +++ b/component/common/application/matter/example/thermostat/example_matter_thermostat.cpp @@ -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)