Detecting if USB interrupt was called

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
xwhatsit
Posts: 1
Joined: Wed Mar 21, 2012 11:06 am

Detecting if USB interrupt was called

Post by xwhatsit » Wed Mar 21, 2012 12:13 pm

Hi there,

Is there any way to check if the USB interrupt was run? Some kind of counter? Is USB_COUNT_SOF directly correlated with the usb interrupt being called?

The reason I want to check this is that I run some highly time-dependent code that shouldn't really be interrupted. If it is, then I want to abort and try again (rather than waiting forever for something to happen and timing out).

It's possible I can do the timing-dependent stuff within 25 cycles (as mentioned in usbdrv.h -- although I am running at 20Mhz so have more than that) and switch off interrupts for that period, but I want to constantly run that code and not have to worry about switching on interrupts to let the USB stuff run its course.

Cheers,

-Tom

Post Reply