Task management - Keeping a led on constantly
Posted: Tue Apr 23, 2019 1:39 pm
Hey everyone,
This is a relatively simple one, but i couldn't find a thread about it. So I'm still getting to know the FreeRTOS abstractions, and I was wondering what I was doing wrong.
Imagine a situation where you wanted to connect to WiFi. Until the connection is established, the onboard led should blink. When the handshake is successfully completed, the led should be always on. However, If i do not manually relinquish control from the task, it will starve the watchdog process and it will not behave in the way i expect it to do. The best I could come up with is to call vTaskDelay() for about 20 milis so i can get the control back to the scheduler, but during this time, the led powers down, so i have a perceptible blink. Is it possible to somehow do "background" tasks, and always keep them active, such as powering a motor, or an LED or a pump whatever, while simultaneously checking for temperature or humidity in regular intervals?
This is a relatively simple one, but i couldn't find a thread about it. So I'm still getting to know the FreeRTOS abstractions, and I was wondering what I was doing wrong.
Imagine a situation where you wanted to connect to WiFi. Until the connection is established, the onboard led should blink. When the handshake is successfully completed, the led should be always on. However, If i do not manually relinquish control from the task, it will starve the watchdog process and it will not behave in the way i expect it to do. The best I could come up with is to call vTaskDelay() for about 20 milis so i can get the control back to the scheduler, but during this time, the led powers down, so i have a perceptible blink. Is it possible to somehow do "background" tasks, and always keep them active, such as powering a motor, or an LED or a pump whatever, while simultaneously checking for temperature or humidity in regular intervals?