aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-07-20 14:12:05 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-07-20 14:12:05 +0000
commit18f7cd3325418585c1d32426456379356247226d (patch)
treeb3d3c1912ff517bfeae7b4314a2fe5fafbbeb42b /Demos
parent4f747e7b7607b2dbd8521230ddf3bdbe3dcb29a8 (diff)
downloadlufa-18f7cd3325418585c1d32426456379356247226d.tar.gz
lufa-18f7cd3325418585c1d32426456379356247226d.tar.bz2
lufa-18f7cd3325418585c1d32426456379356247226d.zip
Ensure control pipe is selected in the PrinterHost demo before trying to send control requests.
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c6
-rw-r--r--Demos/Host/LowLevel/PrinterHost/PrinterHost.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
index 6ed7fa908..4c88bb4f2 100644
--- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
+++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
@@ -82,6 +82,8 @@ uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize)
wIndex: 0,
wLength: sizeof(DeviceIDStringLength),
};
+
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);
if ((ErrorCode = USB_Host_SendControlRequest(&DeviceIDStringLength)) != HOST_SENDCONTROL_Successful)
return ErrorCode;
@@ -122,6 +124,8 @@ uint8_t Printer_GetPortStatus(uint8_t* PortStatus)
wLength: sizeof(uint8_t),
};
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);
+
return USB_Host_SendControlRequest(PortStatus);
}
@@ -141,6 +145,8 @@ uint8_t Printer_SoftReset(void)
wLength: 0,
};
+ Pipe_SelectPipe(PIPE_CONTROLPIPE);
+
return USB_Host_SendControlRequest(NULL);
}
diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
index 64adf22c7..5623dc7e7 100644
--- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
+++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
@@ -226,8 +226,7 @@ void USB_Printer_Host(void)
Printer_Data_t TestPageData =
{
-// "\033%-12345X\033E LUFA PCL Test Page \033E\033%-12345X",
- "\033@\033i\001\033X\001\060\000\r\nLUFA ESCP/2 Test Page\r\n",
+ "\033%-12345X\033E LUFA PCL Test Page \033E\033%-12345X",
(sizeof(TestPageData.Data) - 1)
};