aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-02 00:27:52 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-02 00:27:52 +0000
commitecf7c18cf24a10df8d843c8f7c195d803e073330 (patch)
tree017cfab76d087b7eae72f7a7165fb145edf50c29 /Demos/Host/LowLevel/PrinterHost/PrinterHost.c
parent0fdc1a2bc66f97048b94b967e80cd294189fca62 (diff)
downloadlufa-ecf7c18cf24a10df8d843c8f7c195d803e073330.tar.gz
lufa-ecf7c18cf24a10df8d843c8f7c195d803e073330.tar.bz2
lufa-ecf7c18cf24a10df8d843c8f7c195d803e073330.zip
Fixed error in PrinterHost preventing the full page data from being sent to the attached device.
Diffstat (limited to 'Demos/Host/LowLevel/PrinterHost/PrinterHost.c')
-rw-r--r--Demos/Host/LowLevel/PrinterHost/PrinterHost.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
index b2b4059e9..9d62fdaa2 100644
--- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
+++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
@@ -197,10 +197,10 @@ void USB_Printer_Host(void)
puts_P(PSTR("Retrieving Device ID...\r\n"));
- char DeviceIDString[256];
+ char DeviceIDString[300];
if ((ErrorCode = Printer_GetDeviceID(DeviceIDString, sizeof(DeviceIDString))) != HOST_SENDCONTROL_Successful)
{
- printf_P(PSTR(ESC_FG_RED "Control Error (Get DeviceID).\r\n"
+ printf_P(PSTR(ESC_FG_RED "Control Error (Get Device ID).\r\n"
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
/* Indicate error via status LEDs */
@@ -221,15 +221,12 @@ void USB_Printer_Host(void)
/* Indicate device busy via the status LEDs */
LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
- Printer_Data_t TestPageData =
- {
- "\033%-12345X\033E" "LUFA PCL Test Page" "\033E\033%-12345X",
- (sizeof(TestPageData.Data) - 1)
- };
+ char TestPageData[] = "\033%-12345X\033E" "LUFA PCL Test Page" "\033E\033%-12345X";
+ uint16_t TestPageLength = strlen(TestPageData);
- printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), TestPageData.Length);
+ printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), TestPageLength);
- if ((ErrorCode = Printer_SendData(&TestPageData)) != PIPE_RWSTREAM_NoError)
+ if ((ErrorCode = Printer_SendData(&TestPageData, TestPageLength)) != PIPE_RWSTREAM_NoError)
{
printf_P(PSTR(ESC_FG_RED "Error Sending Test Page.\r\n"
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);