1 #include <AT91SAM7S64.h>
2 #include <interrupt-utils.h>
3 #include <usb-interrupt.h>
13 unsigned int int_status;
15 int_status = *AT91C_UDP_ISR & *AT91C_UDP_IMR;
17 if (int_status & (AT91C_UDP_EP0 | AT91C_UDP_EP1 | AT91C_UDP_EP2
19 unsigned int ep_index;
21 for (ep_index = 0; ep_index < 4; ep_index++) {
22 if (int_status & (1<<ep_index)) {
23 usb_arch_transfer_complete(ep_index);
26 }
else if (int_status & AT91C_UDP_ENDBUSRES) {
27 *AT91C_UDP_ICR = AT91C_UDP_ENDBUSRES;
29 }
else if (int_status & AT91C_UDP_RXSUSP) {
31 *AT91C_UDP_ICR = AT91C_UDP_RXSUSP;
32 usb_arch_suspend_int();
33 }
else if (int_status & AT91C_UDP_RXRSM) {
35 *AT91C_UDP_ICR = AT91C_UDP_RXRSM;
36 usb_arch_resume_int();
37 }
else if (int_status & AT91C_UDP_SOFINT) {
39 *AT91C_UDP_ICR = AT91C_UDP_SOFINT;
40 }
else if (int_status & AT91C_UDP_WAKEUP) {
42 *AT91C_UDP_ICR = AT91C_UDP_WAKEUP;
44 puts(
"Other USB interrupt");