Skip to content

Commit

Permalink
ESP32: Remove unnecessary while(1) from examples (#12029)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhrishi authored and pull[bot] committed Jan 7, 2022
1 parent e69e54c commit 1788402
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 26 deletions.
5 changes: 2 additions & 3 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()
Expand Down
6 changes: 0 additions & 6 deletions examples/ota-provider-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 0 additions & 6 deletions examples/ota-requestor-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,4 @@ extern "C" void app_main()
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());

ESPInitConsole();

// Run the UI Loop
while (true)
{
vTaskDelay(50 / portTICK_PERIOD_MS);
}
}
5 changes: 0 additions & 5 deletions examples/pigweed-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 0 additions & 6 deletions examples/temperature-measurement-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 1788402

Please sign in to comment.