OK, here goes,
This is the line that fails:
- Code: Select all
uint16_t desc_len;
ROM const uint8_t *desc_ptr;
struct usb_configuration_descriptor_st {
uint8_t bLength; /* size of this descriptor in bytes */
uint8_t bDescriptorType; /* CONFIGURATION descriptor type */
uint16_t wTotalLength; /* total length of configuration */
uint8_t bNumInterfaces; /* number of interfaces in this configuration */
uint8_t bConfigurationValue; /* Configuration Index */
uint8_t iConfiguration; /* Index of string descriptor */
uint8_t bmAttibutes; /* */
uint8_t MaxPower; /* maximum power consumption (x2) */
};
desc_len = ((struct usb_configuration_descriptor_st *) desc_ptr)->wTotalLength;
with the error message:
- Code: Select all
xc16-gcc -mcpu=24FJ256GB106 -mconst-in-code -finline-functions -O2 -Wall -I ../core/ -I . -g --debug -D__DEBUG -o usb_stack.o -c ../core/usb_stack.c
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
../core/usb_stack.c: In function 'usb_handle_StandardDeviceRequest':
../core/usb_stack.c:421:17: error: Unable to convert from
const __psv__ uint8_t *
to type
struct usb_configuration_descriptor_st *
../core/usb_stack.c:421: confused by earlier errors, bailing out
make: *** [usb_stack.o] Error 255
And now by actually writing it down, I realise that I'm discarding the const qualifier, but that is a different error message in all previous compilers I have used or made my self. Say so istead of exclaiming you're confused, you are a computer program you allways know exactly what you are expecting and what you actually got - you don't get confused, stupid!
Either way I'm not going to use the XC compilers until they (microchip) realise they are in the hardware buissness and a hobbyist growing up with a good free compiler are more likely to use their products when in a position to decide over a big commersial project.