I am trying to read a CAN Stick with a USB interface and I am connected to a sensor module. I have a program which transfer sensor data from the embedded controller to the CAN Stick. There is a program which use an internal queue to transfer data from the embedded controller to the CAN STICK. The program is not efficient and on each cycle it grabs one message and transfer. Which is not efficient. The queue it use is mostly un used as it only store one message at the queue and transfer. Everytime one at a time. And then wait for acknowledge signal at the end. Which makes the program inefficient. I want to use interrupt and polling technology to utilize the unused time.
Please provide me an example for this problem.