@@ -275,7 +275,7 @@ void blinkLEDTask(void *pvParameters) {
275275
276276 for (;;) { // infinite loop
277277 blinkLED (); // call blinkLED function
278- delay ( 500 ); // wait for 500ms
278+ vTaskDelay ( pdMS_TO_TICKS ( 500 ) ); // wait for 500ms
279279 }
280280 vTaskDelete (NULL ); // should never reach this
281281}
@@ -285,7 +285,7 @@ void throttleTask(void *pvParameters) {
285285
286286 for (;;) { // infinite loop
287287 handleThrottle (); //
288- delay ( 20 ); // wait for 20ms
288+ vTaskDelay ( pdMS_TO_TICKS ( 20 ) ); // wait for 20ms
289289 }
290290 vTaskDelete (NULL ); // should never reach this
291291}
@@ -445,7 +445,7 @@ void setupAnalogRead() {
445445void setupWatchdog () {
446446#ifndef OPENPPG_DEBUG
447447 // Initialize Task Watchdog
448- // ESP_ERROR_CHECK(esp_task_wdt_init(3000, true)); // 3 second timeout, panic on timeout
448+ ESP_ERROR_CHECK (esp_task_wdt_init (3000 , true )); // 3 second timeout, panic on timeout
449449#endif // OPENPPG_DEBUG
450450}
451451
@@ -623,7 +623,7 @@ void setup140() {
623623
624624// main loop all work is done in tasks
625625void loop () {
626- delay ( 25 );
626+ vTaskDelay ( pdMS_TO_TICKS ( 25 ) );
627627}
628628
629629void initButtons () {
@@ -783,7 +783,7 @@ void disarmSystem() {
783783 updateArmedTime ();
784784 writeDeviceData ();
785785
786- delay ( 500 ); // TODO: just disable button thread to not allow immediate rearming
786+ vTaskDelay ( pdMS_TO_TICKS ( 500 ) ); // TODO: just disable button thread to not allow immediate rearming
787787 // Set the last disarm time
788788 lastDisarmTime = millis ();
789789}
0 commit comments