]>
git.gir.st - tmk_keyboard.git/blob - usb_extra.c
1 #include <avr/interrupt.h>
4 int8_t usb_extra_send(uint8_t bits
)
6 uint8_t intr_state
, timeout
;
8 if (!usb_configured()) return -1;
11 UENUM
= EXTRA_ENDPOINT
;
12 timeout
= UDFNUML
+ 50;
14 // are we ready to transmit?
15 if (UEINTX
& (1<<RWAL
)) break;
17 // has the USB gone offline?
18 if (!usb_configured()) return -1;
19 // have we waited too long?
20 if (UDFNUML
== timeout
) return -1;
21 // get ready to try checking again
24 UENUM
= EXTRA_ENDPOINT
;
27 UEDATX
= 1; // report id