X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/711542ee8986482a12796ffdbc4a32912b267e44..e61345f872fc7f1a8b95e53ee68b4dbdea0650db:/Projects/XPLAINBridge/USARTDescriptors.c diff --git a/Projects/XPLAINBridge/USARTDescriptors.c b/Projects/XPLAINBridge/USARTDescriptors.c index 329a20627..2baedd4ab 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.c +++ b/Projects/XPLAINBridge/USARTDescriptors.c @@ -93,7 +93,7 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor = .ConfigurationNumber = 1, .ConfigurationStrIndex = NO_DESCRIPTOR, - .ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED), + .ConfigAttributes = USB_CONFIG_ATTR_BUSPOWERED, .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) }, @@ -130,7 +130,7 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor = .Data = {0x06} }, - .CDC_Functional_Union= + .CDC_Functional_Union = { .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24}, .SubType = 0x06, @@ -221,37 +221,39 @@ USB_Descriptor_String_t PROGMEM USART_ProductString = /** Descriptor retrieval function for the USART Bridge descriptors. This function is in turn called by the GetDescriptor * callback function in the main source file, to retrieve the device's descriptors when in USART bridge mode. */ -uint16_t USART_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress) +uint16_t USART_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + const void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorNumber = (wValue & 0xFF); - void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; switch (DescriptorType) { case DTYPE_Device: - Address = (void*)&USART_DeviceDescriptor; + Address = &USART_DeviceDescriptor; Size = sizeof(USB_Descriptor_Device_t); break; case DTYPE_Configuration: - Address = (void*)&USART_ConfigurationDescriptor; + Address = &USART_ConfigurationDescriptor; Size = sizeof(USART_USB_Descriptor_Configuration_t); break; case DTYPE_String: switch (DescriptorNumber) { case 0x00: - Address = (void*)&USART_LanguageString; + Address = &USART_LanguageString; Size = pgm_read_byte(&USART_LanguageString.Header.Size); break; case 0x01: - Address = (void*)&USART_ManufacturerString; + Address = &USART_ManufacturerString; Size = pgm_read_byte(&USART_ManufacturerString.Header.Size); break; case 0x02: - Address = (void*)&USART_ProductString; + Address = &USART_ProductString; Size = pgm_read_byte(&USART_ProductString.Header.Size); break; }