Fix unfinished printer host demo - some printer languages use embedded NULLs and...
[pub/USBasp.git] / Demos / Host / Incomplete / PrinterHost / ConfigDescriptor.c
index 67a0fa7..d4eaff9 100644 (file)
@@ -61,7 +61,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the printer interface from the configuration descriptor */\r
        if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                                  NextBidirectionalPrinterInterface)))\r
+                                                  DComp_NextBidirectionalPrinterInterface)))\r
        {\r
                /* Descriptor not found, error out */\r
                return NoInterfaceFound;\r
@@ -70,12 +70,12 @@ uint8_t ProcessConfigurationDescriptor(void)
        PrinterInterfaceNumber = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).InterfaceNumber;\r
        PrinterAltSetting      = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).AlternateSetting;\r
 \r
-       /* Get the IN and OUT data endpoints for the mass storage interface */\r
+       /* Get the IN and OUT data endpoints for the printer interface */\r
        while (FoundEndpoints != ((1 << PRINTER_DATA_OUT_PIPE) | (1 << PRINTER_DATA_IN_PIPE)))\r
        {\r
                /* Fetch the next bulk endpoint from the current printer interface */\r
                if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                                          NextInterfaceBulkDataEndpoint)))\r
+                                                          DComp_NextInterfaceBulkDataEndpoint)))\r
                {\r
                        /* Descriptor not found, error out */\r
                        return NoEndpointFound;\r
@@ -112,16 +112,16 @@ uint8_t ProcessConfigurationDescriptor(void)
        return SuccessfulConfigRead;\r
 }\r
 \r
-uint8_t NextBidirectionalPrinterInterface(void* CurrentDescriptor)\r
+uint8_t DComp_NextBidirectionalPrinterInterface(void* CurrentDescriptor)\r
 {\r
-       /* PURPOSE: Find next Bidirectional protocol printer class interface descriptor */\r
+       /* PURPOSE: Find next bidirectional protocol printer class interface descriptor */\r
 \r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
                /* Check the descriptor class and protocol, break out if correct class/protocol interface found */\r
                if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class    == PRINTER_CLASS)    &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == PRINTER_SUBCLASS) &&\r
-                       (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == PROTOCOL_BIDIRECTIONAL))\r
+                       (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == PRINTER_PROTOCOL))\r
                {\r
                        return DESCRIPTOR_SEARCH_Found;\r
                }\r
@@ -130,7 +130,7 @@ uint8_t NextBidirectionalPrinterInterface(void* CurrentDescriptor)
        return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
-uint8_t NextInterfaceBulkDataEndpoint(void* CurrentDescriptor)\r
+uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor)\r
 {\r
        /* PURPOSE: Find next interface bulk endpoint descriptor before next interface descriptor */\r
 \r