Page 1 of 1

Suspend Main Loop

Posted: Wed Feb 27, 2019 2:32 pm
by czuvich
Is there a way to suspend the loop() completely? I will be using tasks and timers to run my Arduino code.

Re: Suspend Main Loop

Posted: Wed Feb 27, 2019 2:46 pm
by ESP_igrr
Since loop is a FreeRTOS task, possibly by killing it with vTaskDelete(NULL). Or if you want to resume it later, you can block on any FreeRTOS synchronization primitive with portMAX_DELAY as timeout. You can use queue, semaphore, task notification, etc for this.

Re: Suspend Main Loop

Posted: Wed Feb 27, 2019 7:30 pm
by chegewara
Yes, it is possible. You can even do it from setup(), just call vTaskDelete(NULL)