Does calling xEventGroupSetBits cause the scheduler to immediately check tasks or does it still run at 10msec intervals. Asking for a friend.
My coworker wants to sample the ADC at 1khz. The ADC read is in a task and he uses a 1khz timer callback to call xEventGroupSetBits. I'm thinking that it does not invoke the scheduler immediately, and think we should read the ADC in an interrupt routine. Are there any caveats to reading the ADC in an interrupt? It doesn't say anything in the docs WRT that.
John A
xEventGroupSetBits and task scheduler
Re: xEventGroupSetBits and task scheduler
At the very minimum, can I use the adc read routine in an interrupt. I realize the other question is a FreeRTOS thing and may be best asked on a FreeRTOS forum.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: xEventGroupSetBits and task scheduler
I just checked: xEventGroupSetBits uses xTaskRemoveFromUnorderedEventList to unblock a task, and that is pre-emptive (as in: will actively switch over to the unblocked task or tell the other core to do so).
In general, all FreeRTOS functions that unblock a higher priority task should immediately switch to that task. (If they don't, things like tickless operation would be impossible.)
In general, all FreeRTOS functions that unblock a higher priority task should immediately switch to that task. (If they don't, things like tickless operation would be impossible.)
Re: xEventGroupSetBits and task scheduler
Awesome! That makes sense according to what I saw in the semaphore thread.
Who is online
Users browsing this forum: No registered users and 89 guests