Question

I am trying to code firmware for a custom made joystick. For this I use vusb on a atmega8 microcontroller. When I compile (with avrgcc), it spits out the following error:

usbdrv/usbdrv.c:93:54: error: operator '*' has no right operand

However, the corresponding line (and it's sorroundings) don't even have any '*'-operators in them:

#if USB_CFG_DESCR_PROPS_STRING_PRODUCT == 0 && USB_CFG_DEVICE_NAME_LEN
#undef USB_CFG_DESCR_PROPS_STRING_PRODUCT
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT   sizeof(usbDescriptorStringDevice)
PROGMEM const int  usbDescriptorStringDevice[] = {
    USB_STRING_DESCRIPTOR_HEADER(USB_CFG_DEVICE_NAME_LEN),
    USB_CFG_DEVICE_NAME
};
#endif

//The following line is the one it complains about:
#if USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER == 0 && USB_CFG_SERIAL_NUMBER_LEN
#undef USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER sizeof(usbDescriptorStringSerialNumber)
PROGMEM const int usbDescriptorStringSerialNumber[] = {
    USB_STRING_DESCRIPTOR_HEADER(USB_CFG_SERIAL_NUMBER_LEN),
    USB_CFG_SERIAL_NUMBER
};
#endif

I don't really know what to do about this one, hoping someone can help.

Was it helpful?

Solution

It indeed was the macro which was faulty. "USB_CFG_SERIAL_NUMBER_LEN" expanded to "2*", as I had my serial number defined like '1','2','3', '4','5','6' and wanted to be clear how the number is grouped ("2*3"), had forgotten to type the 3 though.

Thanks for the help!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top