Page 1 of 1

changing serial has no effect?

Posted: Fri Jul 10, 2015 4:17 am
by ulao
I tried to change

#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e'
#define USB_CFG_SERIAL_NUMBER_LEN 4

to

#define USB_CFG_SERIAL_NUMBER '1', '0', '0', '1'
#define USB_CFG_SERIAL_NUMBER_LEN 4

The macros are being used in the code, but the serial is always 0. How can I change the serial?

I also tried setting it directly both in the definition and redefining it later.

const PROGMEM int usbDescriptorStringSerialNumber[] = {
USB_STRING_DESCRIPTOR_HEADER(4),
'1','0','0','1'
};

but it's still 0.

Re: changing serial has no effect?

Posted: Fri Jul 10, 2015 9:52 pm
by ulao
huh I was able to make it work by changing
USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER != 0 ? 3 : 0, /* serial number string index */
to
USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER != 0 ? 3 : 1, /* serial number string index */

So I guess the define for USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER is the issue.
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER USB_PROP_LENGTH((6*2))

Not sure what is going on here?