Closed aweebs closed 7 years ago
Same issue here. Will try and look into it later this week in more detail.
May be related to https://github.com/StephenBlackWasAlreadyTaken/wixel-xDrip/pull/49
Is there a solution to this?
Having the same issue.
A quick fix on top of current master (at a15cd96a):
--- a/libraries/src/usb/usb.c
+++ b/libraries/src/usb/usb.c
@@ -8,7 +8,7 @@
extern uint8 CODE usbConfigurationDescriptor[];
-void usbStandardDeviceRequestHandler();
+static void usbStandardDeviceRequestHandler();
#define CONTROL_TRANSFER_STATE_NONE 0
#define CONTROL_TRANSFER_STATE_WRITE 1
@@ -223,6 +223,12 @@ void usbPoll()
USBINDEX = 0; // Select EP0 again because the functions above might have changed USBINDEX.
+ // Modify the count so that we don't send more data than the host requested.
+ if(controlTransferBytesLeft > usbSetupPacket.wLength)
+ {
+ controlTransferBytesLeft = usbSetupPacket.wLength;
+ }
+
// Prepare for the first transaction after the SETUP packet.
if (controlTransferState == CONTROL_TRANSFER_STATE_NONE)
{
@@ -336,7 +342,11 @@ static void usbStandardDeviceRequestHandler()
{
if ((usbSetupPacket.wValue & 0xFF) >= usbStringDescriptorCount)
{
- // Invalid string index.
+ // This is either an invalid string index or it is 0xEE,
+ // which is defined by Microsoft OS Descriptors 1.0.
+ // This library provides no features for handling such requests,
+ // but we call the user's callback in case they want to.
+ usbCallbackClassDescriptorHandler();
return;
}
@@ -358,14 +368,6 @@ static void usbStandardDeviceRequestHandler()
}
}
- // Modify the count so that we don't send more data than the host requested.
- // We MUST use the local variable wLength instead of usbSetupPacket.wLength because
- // USB_SETUP_PACKET may have been over-written by the serial number handler.
- if(controlTransferBytesLeft > usbSetupPacket.wLength)
- {
- controlTransferBytesLeft = usbSetupPacket.wLength;
- }
-
controlTransferState = CONTROL_TRANSFER_STATE_READ;
return;
}
This is the result of updating the usb.c
dep from the latest wixel-SDK.
I'll create a PR with the complete fix. In the meantime, the above patch can be applied with git apply
.
I'm getting compiler errors when using the makefile on Ubuntu 16.04 LTS. The code is the latest from the master branch as of February 12, 2017.
make error:
SDCC -v output (in case it's useful):