From acc974c64b1e17e6807133fdc50de5bb34aedda5 Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 9 Feb 2011 00:03:58 +0900 Subject: added protocol stack: pjrc, vusb --- pjrc/usb_extra.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 pjrc/usb_extra.c (limited to 'pjrc/usb_extra.c') diff --git a/pjrc/usb_extra.c b/pjrc/usb_extra.c new file mode 100644 index 000000000..9bc0c3f5f --- /dev/null +++ b/pjrc/usb_extra.c @@ -0,0 +1,44 @@ +#include +#include "usb_extra.h" + + +int8_t usb_extra_send(uint8_t report_id, uint8_t bits) +{ + uint8_t intr_state, timeout; + + if (!usb_configured()) return -1; + intr_state = SREG; + cli(); + UENUM = EXTRA_ENDPOINT; + timeout = UDFNUML + 50; + while (1) { + // are we ready to transmit? + if (UEINTX & (1<