summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/main.c b/main.c
index 597d34a..8006bdc 100644
--- a/main.c
+++ b/main.c
@@ -50,8 +50,8 @@
static char buffer[300]; // contains the exploded gamecube bits, i.e. each bit sent/received occupies one byte here.
-
-PROGMEM const char usbHidReportDescriptor[862] = {
+#define floUsbHidReportDescriptorLen 862
+PROGMEM const char floUsbHidReportDescriptor[862] = {
0x05, 0x01, //USAGE_PAGE (Generic Desktop)
0x15, 0x00, //LOGICAL_MINIMUM (0)
@@ -526,6 +526,23 @@ typedef struct {
report_t reportBuffer;
+
+usbMsgLen_t usbFunctionDescriptor(struct usbRequest* rq)
+{
+ if ((rq->bmRequestType & USBRQ_TYPE_MASK) != USBRQ_TYPE_STANDARD)
+ return 0;
+
+ if (rq->bRequest == USBRQ_GET_DESCRIPTOR && rq->wValue.bytes[1]==USBDESCR_HID_REPORT)
+ {
+ usbMsgPtr = (void*)floUsbHidReportDescriptor;
+ return floUsbHidReportDescriptorLen;
+ }
+
+ return 0;
+}
+
+
+
/* device is detected, however unreliably. dunno why. */
@@ -535,7 +552,7 @@ void debug(int i)
PORTB = ~i;
}
-USB_PUBLIC uchar usbFunctionSetup(uchar data[8])
+USB_PUBLIC usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t* rq = (usbRequest_t*) data;