The situation is that I'm am adapting the example in C:\KSDK2\boards\frdmk22f\usb_examples\usb_device_cdc_vcom to run with/under FreeRTOS. As it is written, the background routine polls for input. What I'd like to do is link the background routine to the callback() routine with a semaphore to indicate that data is ready to be read.
So, inside the callback() routine, should I use the xSemaphhoreGiveFromISR() or the xSemaphhoreGive() routine?
Thanks
Hi David,
is highly recommended to use xSemaphhoreGiveFromISR() instead of xSemaphhoreGive().
If you use xSemaphhoreGive() you could get in trouble because of race conditions.
I hope this helps.
Best Regards,
Iva