X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/9d18e10afb2439a6a9ba6978a799259746a837b7..3c932d305715878e01a77659a30a3e4d967fc244:/core/usbcdc/usbcore.c?ds=sidebyside diff --git a/core/usbcdc/usbcore.c b/core/usbcdc/usbcore.c index fe09bbd..0544f6d 100644 --- a/core/usbcdc/usbcore.c +++ b/core/usbcdc/usbcore.c @@ -177,6 +177,7 @@ static inline uint32_t USB_ReqGetStatus (void) { break; case REQUEST_TO_INTERFACE: if ((USB_Configuration != 0) && (SetupPacket.wIndex.WB.L < USB_NumInterfaces)) { + //*((uint16_t __attribute__((packed)) *)EP0Buf) = 0; *ep0 = 0; EP0Data.pData = EP0Buf; } else { @@ -187,6 +188,7 @@ static inline uint32_t USB_ReqGetStatus (void) { n = SetupPacket.wIndex.WB.L & 0x8F; m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n); if (((USB_Configuration != 0) || ((n & 0x0F) == 0)) && (USB_EndPointMask & m)) { + // *((uint16_t __attribute__((packed)) *)EP0Buf) = (USB_EndPointHalt & m) ? 1 : 0; *ep0 = (USB_EndPointHalt & m) ? 1 : 0; EP0Data.pData = EP0Buf; } else { @@ -364,6 +366,7 @@ static inline uint32_t USB_ReqGetDescriptor (void) { return (TRUE); } + /* * Get Configuration USB Request * Parameters: None (global SetupPacket) @@ -376,6 +379,7 @@ static inline uint32_t USB_ReqGetConfiguration (void) { case REQUEST_TO_DEVICE: // Added cast to avoid warnings due to USB_Configuration being volatile (KTownsend) EP0Data.pData = (uint8_t *)&USB_Configuration; + //EP0Data.pData = &USB_Configuration; break; default: return (FALSE); @@ -562,6 +566,7 @@ static inline uint32_t USB_ReqSetInterface (void) { return (set); } + /* * USB Endpoint 0 Event Callback * Parameters: event