Fixed incorrect PIPE_EPNUM_MASK mask causing pipe failures on devices with endpoint...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 19 Jul 2009 09:04:25 +0000 (09:04 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 19 Jul 2009 09:04:25 +0000 (09:04 +0000)
Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.c
Demos/Host/Incomplete/PrinterHost/PrinterHost.c
LUFA/Drivers/USB/LowLevel/Pipe.h
LUFA/ManPages/ChangeLog.txt

index 46e534d..9324a14 100644 (file)
@@ -90,3 +90,4 @@ uint8_t Printer_SoftReset(void)
 \r
        return USB_Host_SendControlRequest(NULL);\r
 }\r
+\r
index 5cdd063..80fca25 100644 (file)
@@ -184,6 +184,8 @@ void USB_Printer_Host(void)
                \r
             //--------------------------------------------------------------\r
                        #define TEST_TEXT_PAGE "\033%-12345X\033E LUFA PCL Test Page \033E\033%-12345X"\r
+//                     #define TEST_TEXT_PAGE "\033@\033i\001\033X\001\060\000\r\nLUFA ESCP/2 Test Page\r\n"\r
+                       #define PAGE_SIZE      (sizeof(TEST_TEXT_PAGE) - 1)\r
 \r
                        Pipe_SelectPipe(PRINTER_DATA_OUT_PIPE);\r
             Pipe_Unfreeze();\r
@@ -192,14 +194,12 @@ void USB_Printer_Host(void)
                        \r
                        while (!(Pipe_IsReadWriteAllowed()));\r
 \r
-                       uint8_t strSize = sizeof(TEST_TEXT_PAGE)-1;\r
-\r
-                       printf_P(PSTR("Printer Write Allowed, sending complete page (%d bytes)...\r\n"), strSize);\r
+                       printf_P(PSTR("Printer Write Allowed, Sending Page (%d bytes)...\r\n"), PAGE_SIZE);\r
                                \r
-                       Pipe_Write_Stream_LE(TEST_TEXT_PAGE, strSize);\r
+                       Pipe_Write_Stream_LE(TEST_TEXT_PAGE, PAGE_SIZE);\r
             Pipe_ClearOUT();\r
 \r
-                       puts_P(PSTR("Page sent to printer.\r\n"));\r
+                       puts_P(PSTR("Page Sent, Waiting for Pipe...\r\n"));\r
 \r
                        while (!(Pipe_IsReadWriteAllowed()));\r
             Pipe_Freeze();                             \r
index 58cfb1f..f03ea09 100644 (file)
                        /** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's\r
                         *  numerical address in the attached device.\r
                         */\r
-                       #define PIPE_EPNUM_MASK                 0x07\r
+                       #define PIPE_EPNUM_MASK                 0x0F\r
 \r
                        /** Endpoint bank size mask, for masking against endpoint addresses to retrieve the endpoint's\r
                         *  bank size in the attached device.\r
index c2b7d5e..62997d7 100644 (file)
@@ -61,6 +61,7 @@
   *  - Fixed Host mode to Device mode UID change not causing a USB Disconnect event when a device was connected\r
   *  - Fixed Mouse/Keyboard demos not performing the correct arithmetic on the Idle period at the right times (thanks to Brian Dickman)\r
   *  - Fixed GenericHID failing HID class tests due to incorrect Logical Minimum and Logical Maximum values (thanks to Søren Greiner)\r
+  *  - Fixed incorrect PIPE_EPNUM_MASK mask causing pipe failures on devices with endpoint addresses of 8 and above (thanks to John Andrews)\r
   *\r
   *\r
   *  \section Sec_ChangeLog090605 Version 090605\r