Page 1 of 1

timer polling

Posted: Fri Feb 22, 2013 2:16 am
by amx
Hello,

as I am having some trouble by (probably) not calling usbPoll often enough (50ms max) I arrived at the following question:
Why is it not possible to call "usbPoll" from within a timer interrupt?

As christian said elsewhere:
"You can't call usbPoll() from a timer interrupt. You must call it from the main code."

Is this because they share some data they both use or are there other reasons?

Thanks!

Re: timer polling

Posted: Tue Jun 25, 2013 3:38 pm
by ulao
I think v-usb just uses the interrupts for timing and the poll depends strictly on the function usbInterruptIsReady.

Code: Select all

while (   !usbInterruptIsReady() ) //when not ready you must poll
{
   usbPoll();
}
//pulling has stopped tiuem to send
usbSetInterrupt( reportBuffer, 8);