Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
18f7cd33
Commit
18f7cd33
authored
Jul 20, 2009
by
Dean Camera
Browse files
Ensure control pipe is selected in the PrinterHost demo before trying to send control requests.
parent
4f747e7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
View file @
18f7cd33
...
...
@@ -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
);
}
Demos/Host/LowLevel/PrinterHost/PrinterHost.c
View file @
18f7cd33
...
...
@@ -226,8 +226,7 @@ void USB_Printer_Host(void)
Printer_Data_t
TestPageData
=
{
// "\033%-12345X\033E LUFA PCL Test Page \033E\033%-12345X",
"
\033
@
\033
i
\001\033
X
\001\060\000\r\n
LUFA ESCP/2 Test Page
\r\n
"
,
"
\033
%-12345X
\033
E LUFA PCL Test Page
\033
E
\033
%-12345X"
,
(
sizeof
(
TestPageData
.
Data
)
-
1
)
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment