Is USB_DeviceCdcVcomCallback() inside an interrupt routine?

cancel
Showing results for 
Search instead for 
Did you mean: 

Is USB_DeviceCdcVcomCallback() inside an interrupt routine?

188 Views
davepfaltzgraff
Senior Contributor I

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

Labels (1)
Tags (2)
0 Kudos
1 Reply

68 Views
ivadorazinova
NXP Employee
NXP Employee

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

0 Kudos