xQueueGenericSend on AVR

gezab wrote on Tuesday, December 08, 2009:

Hi,
xQueueGenericSend seems to take several hundreds of ticks to execute with interrupts disabled on AVR. This may be excessive in some cases in my application because my input capture IRQ can be delayed by even 1200-1300 cycles.
Is there some way to decrease this latency?
Thanks,
Geza

davedoors wrote on Tuesday, December 08, 2009:

Two ways to make sure its fast…

i/ Make sure the system is in a state where the task calling xQueueGenericSend() does not go round any loops inside the function.

ii/ Make sure the task calling xQueueGenericSend() does not get put into the blocked state within the function (because sending to the queue unblocks another task).

gezab wrote on Tuesday, December 08, 2009:

Ok, thanks!
However, I don’t fully understand (i). I’ve checked the code, it has a for(;:wink: statement at the beginning, but it’s not wrapped by a critical section, so some time still in the loop interrupts will be re-enabled, right? So how does it impact my case?