Is USB_DeviceCdcVcomCallback() inside an interrupt routine?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Is USB_DeviceCdcVcomCallback() inside an interrupt routine?

886 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

766 次查看
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 项奖励
回复