X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/63e80bea0827d28a5a64bd359b0e702babfc1be3..5cae54154506176d64a581c5b3d9550c901b570c:/Bootloaders/Printer/Descriptors.c diff --git a/Bootloaders/Printer/Descriptors.c b/Bootloaders/Printer/Descriptors.c index 3bc483753..5329afc86 100644 --- a/Bootloaders/Printer/Descriptors.c +++ b/Bootloaders/Printer/Descriptors.c @@ -38,7 +38,7 @@ #include "Descriptors.h" -/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall +/** Device descriptor structure. This descriptor, located in SRAM memory, describes the overall * device characteristics, including the supported USB version, control endpoint size and the * number of device configurations. The descriptor is read out by the USB host when the enumeration * process begins. @@ -58,14 +58,14 @@ const USB_Descriptor_Device_t DeviceDescriptor = .ProductID = 0x206B, .ReleaseNumber = VERSION_BCD(00.01), - .ManufacturerStrIndex = 0x01, - .ProductStrIndex = 0x02, + .ManufacturerStrIndex = STRING_ID_Manufacturer, + .ProductStrIndex = STRING_ID_Product, .SerialNumStrIndex = NO_DESCRIPTOR, .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS }; -/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage +/** Configuration descriptor structure. This descriptor, located in SRAM memory, describes the usage * of the device in one of its supported configurations, including information about any device interfaces * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting * a configuration so that the host may correctly communicate with the USB device. @@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = 0, + .InterfaceNumber = INTERFACE_ID_Printer, .AlternateSetting = 0, .TotalEndpoints = 2, @@ -124,7 +124,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = } }; -/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests +/** Language descriptor structure. This descriptor, located in SRAM memory, is returned when the host requests * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate * via the language ID table available at USB.org what languages the device supports for its string descriptors. */ @@ -186,17 +186,17 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, case DTYPE_String: switch (DescriptorNumber) { - case 0x00: + case STRING_ID_Language: Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); + Size = LanguageString.Header.Size; break; - case 0x01: + case STRING_ID_Manufacturer: Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); + Size = ManufacturerString.Header.Size; break; - case 0x02: + case STRING_ID_Product: Address = &ProductString; - Size = pgm_read_byte(&ProductString.Header.Size); + Size = ProductString.Header.Size; break; }