diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-08-24 13:16:16 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-08-24 13:16:16 +0000 |
| commit | 534f2c8f608330f3cc94a0840a7a0e56aeea3fff (patch) | |
| tree | 4b5afe16c3d22fdf3e2b5a7fe175ba5062404c12 /Demos/Host/LowLevel/PrinterHost/Lib | |
| parent | 815b999a1b78e24b2b75aafa49eacdf600c3a659 (diff) | |
Fixed LowLevel PrinterHost demo not sending control requests to the attached printer with the correct printer interface wIndex value.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1453 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Host/LowLevel/PrinterHost/Lib')
| -rw-r--r-- | Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c | 14 | ||||
| -rw-r--r-- | Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c index 02489599..ac0ca9a2 100644 --- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c +++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c @@ -86,7 +86,7 @@ uint8_t Printer_GetDeviceID(char* DeviceIDString, .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE), .bRequest = REQ_GetDeviceID, .wValue = 0, - .wIndex = 0, + .wIndex = PrinterInterfaceNumber, .wLength = sizeof(DeviceIDStringLength), }; @@ -130,11 +130,11 @@ uint8_t Printer_GetPortStatus(uint8_t* const PortStatus) { USB_ControlRequest = (USB_Request_Header_t) { - bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE), - bRequest: REQ_GetPortStatus, - wValue: 0, - wIndex: 0, - wLength: sizeof(uint8_t), + .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE), + .bRequest = REQ_GetPortStatus, + .wValue = 0, + .wIndex = PrinterInterfaceNumber, + .wLength = sizeof(uint8_t), }; Pipe_SelectPipe(PIPE_CONTROLPIPE); @@ -154,7 +154,7 @@ uint8_t Printer_SoftReset(void) .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE), .bRequest = REQ_SoftReset, .wValue = 0, - .wIndex = 0, + .wIndex = PrinterInterfaceNumber, .wLength = 0, }; diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h index 8c3bd331..3edfe434 100644 --- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h +++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h @@ -41,6 +41,8 @@ #include <string.h> #include <LUFA/Drivers/USB/USB.h> + + #include "../PrinterHost.h" /* Macros: */ /** Printer class-specific request to retrieve the printer's ID string. */ |
