From 11201163f33fce4b943ead01ee4121e5afd0e80a Mon Sep 17 00:00:00 2001 From: Hrishikesh Dhayagude Date: Sat, 20 Nov 2021 01:16:14 +0530 Subject: [PATCH] ESP32: Remove unnecessary while(1) from examples (#12029) --- examples/all-clusters-app/esp32/main/main.cpp | 5 ++--- examples/ota-provider-app/esp32/main/main.cpp | 6 ------ examples/ota-requestor-app/esp32/main/main.cpp | 6 ------ examples/pigweed-app/esp32/main/main.cpp | 5 ----- examples/temperature-measurement-app/esp32/main/main.cpp | 6 ------ 5 files changed, 2 insertions(+), 26 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 933c3b954dbb90..d6d8cf49d51aeb 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -682,10 +682,10 @@ extern "C" void app_main() #endif // CONFIG_HAVE_DISPLAY +#if CONFIG_DEVICE_TYPE_M5STACK // Run the UI Loop while (true) { -#if CONFIG_DEVICE_TYPE_M5STACK // TODO consider refactoring this example to use FreeRTOS tasks bool woken = false; @@ -710,10 +710,9 @@ extern "C" void app_main() } } -#endif // CONFIG_DEVICE_TYPE_M5STACK - vTaskDelay(50 / portTICK_PERIOD_MS); } +#endif // CONFIG_DEVICE_TYPE_M5STACK } bool lowPowerClusterSleep() diff --git a/examples/ota-provider-app/esp32/main/main.cpp b/examples/ota-provider-app/esp32/main/main.cpp index 3d2191c6afef96..d50b11c3d3a730 100644 --- a/examples/ota-provider-app/esp32/main/main.cpp +++ b/examples/ota-provider-app/esp32/main/main.cpp @@ -225,10 +225,4 @@ extern "C" void app_main() ChipLogError(BDX, "Failed to init BDX server: %s", chip::ErrorStr(error)); return; } - - // Run the UI Loop - while (true) - { - vTaskDelay(50 / portTICK_PERIOD_MS); - } } diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp index b12cc9c056f030..3acbe4f8d0d94e 100644 --- a/examples/ota-requestor-app/esp32/main/main.cpp +++ b/examples/ota-requestor-app/esp32/main/main.cpp @@ -179,10 +179,4 @@ extern "C" void app_main() SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); ESPInitConsole(); - - // Run the UI Loop - while (true) - { - vTaskDelay(50 / portTICK_PERIOD_MS); - } } diff --git a/examples/pigweed-app/esp32/main/main.cpp b/examples/pigweed-app/esp32/main/main.cpp index 0ed8417d37c0dc..e99502afdb894c 100644 --- a/examples/pigweed-app/esp32/main/main.cpp +++ b/examples/pigweed-app/esp32/main/main.cpp @@ -64,9 +64,4 @@ extern "C" void app_main() ESP_LOGI(TAG, "----------- chip-esp32-pigweed-example starting -----------"); xTaskCreate(RunRpcService, "RPC", kRpcStackSizeBytes / sizeof(StackType_t), nullptr, kRpcTaskPriority, &rpcTaskHandle); - - while (1) - { - vTaskDelay(50 / portTICK_PERIOD_MS); - } } diff --git a/examples/temperature-measurement-app/esp32/main/main.cpp b/examples/temperature-measurement-app/esp32/main/main.cpp index df3072eac0cab0..146dcab7e527bd 100644 --- a/examples/temperature-measurement-app/esp32/main/main.cpp +++ b/examples/temperature-measurement-app/esp32/main/main.cpp @@ -84,10 +84,4 @@ extern "C" void app_main() // Initialize device attestation config SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - - // Run the UI Loop - while (true) - { - vTaskDelay(50 / portTICK_PERIOD_MS); - } }