- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you provide any Queue example code in Fx3 Workspace i tried using existing functions
CyU3PQueueCreate (): queue creation
CyU3PQueueReceive for receiving inn task 2
CyU3PQueueSend for sending onto queue in task1
But it is working as stack, Last given input is executing first followed by Last in first out manner. Really helpful if providing any example coded for implementing the queue in EZ USB suite work space for Fx3.
Thanks and Regards
Bhargav.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bhargav,
Please find attached firmware project with queue implemented. It works as per expected, please check the UART debug prints.
Best Regards,
AliAsgar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ALiAsgar,
Thanks for the reply, i have some queries regarding the implementation
What is the requirement to use "dataReady" global variable in QueueTestEntry ?
can we use something like this
apiRetStatus = CyU3PQueueReceive(&queue_p, &recvData, CYU3P_WAIT_FOREVER);
if (apiRetStatus == CY_U3P_SUCCESS)
{
CyU3PDebugPrint(4, "First Received data = %x \r\n",recvData);
}
In our implementations we are using multiple threads and while execution we have some scenarios where we get multiple interrupts which triggers multiple events at same time in order to handle this scenario we want to include queuing which will potentially solve our problem and execute each event in order . keeping a global variable something like that is not suitable option for us.
can you suggest any other way of implementing queue which suitable for the scenario explained ?
It will be really helpful if you suggest us some suitable methods for handling this scenario !!
Best regards,
Bhargav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bhargav,
There is no necessity to use dataReady for QueueTestEntry. The implementation you have shown will still work perfectly. I have tested it. This implementation can be used for your application as well.
Best Regards,
AliAsgar