lpcware

Is this a bug in the new LPCUSBLib?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by mifi on Tue May 14 14:15:39 MST 2013

Hello,

I am using the latest LPCopen, v1.03. And I think I found a bug
in the examples where the descriptors will be set.

E.g. take a look in the Descriptors.c of the "KeyboardDevice".

For the ConfigurationDescriptor, TotalConfigurationSize, 1 will be
subtracted because of the termination byte.

But this is missing in the CALLBACK, here the code looks like:

    case DTYPE_Configuration:
        Address = &ConfigurationDescriptor;
        Size    = sizeof(USB_Descriptor_Configuration_t);
        break;

I think the code should be changed to:

    case DTYPE_Device:
        Address = &DeviceDescriptor;
        Size    = DeviceDescriptor.Header.Size;
        break;

    case DTYPE_Configuration:
        Address = &ConfigurationDescriptor;
        Size    = ConfigurationDescriptor.Config.TotalConfigurationSize;
        break;

Best regards,
Michael

Outcomes