projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0fdc1a2
)
Fixed error in PrinterHost preventing the full page data from being sent to the attac...
author
Dean Camera
<dean@fourwalledcubicle.com>
Wed, 2 Sep 2009 00:27:52 +0000
(
00:27
+0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Wed, 2 Sep 2009 00:27:52 +0000
(
00:27
+0000)
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
patch
|
blob
|
blame
|
history
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
patch
|
blob
|
blame
|
history
Demos/Host/LowLevel/PrinterHost/PrinterHost.c
patch
|
blob
|
blame
|
history
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
diff --git
a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
index
cb051cd
..
fefcbbf
100644
(file)
--- a/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
+++ b/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
@@
-39,18
+39,19
@@
/** Sends the given data directly to the printer via the data endpoints, for the sending of print commands in printer
\r
* languages accepted by the attached printer (e.g. PCL).
\r
*
\r
/** Sends the given data directly to the printer via the data endpoints, for the sending of print commands in printer
\r
* languages accepted by the attached printer (e.g. PCL).
\r
*
\r
- * \param[in] PrinterCommands Pointer to a structure containing the commands and length of the data to send
\r
+ * \param[in] PrinterCommands Pointer to the data to send to the attached printer
\r
+ * \param[in] CommandSize Size of the data to send to the attached printer
\r
*
\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
\r
*/
\r
*
\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
\r
*/
\r
-uint8_t Printer_SendData(
Printer_Data_t* PrinterCommands
)
\r
+uint8_t Printer_SendData(
void* PrinterCommands, uint16_t CommandSize
)
\r
{
\r
uint8_t ErrorCode;
\r
\r
Pipe_SelectPipe(PRINTER_DATA_OUT_PIPE);
\r
Pipe_Unfreeze();
\r
\r
{
\r
uint8_t ErrorCode;
\r
\r
Pipe_SelectPipe(PRINTER_DATA_OUT_PIPE);
\r
Pipe_Unfreeze();
\r
\r
- if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands
->Data, PrinterCommands->Length
)) != PIPE_RWSTREAM_NoError)
\r
+ if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands
, CommandSize
)) != PIPE_RWSTREAM_NoError)
\r
return ErrorCode;
\r
\r
Pipe_ClearOUT();
\r
return ErrorCode;
\r
\r
Pipe_ClearOUT();
\r
diff --git
a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
index
f55d03b
..
cb8f046
100644
(file)
--- a/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
+++ b/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
@@
-58,18
+58,8
@@
/** Pipe number of the Printer data OUT pipe */
\r
#define PRINTER_DATA_OUT_PIPE 2
\r
\r
/** Pipe number of the Printer data OUT pipe */
\r
#define PRINTER_DATA_OUT_PIPE 2
\r
\r
- /* Type Defines: */
\r
- /** Type define for a Printer Command Data structure, for the encapsulation of raw printer commands to
\r
- * send to an attached printer device.
\r
- */
\r
- typedef struct
\r
- {
\r
- char* Data; /**< Printer commands to send to the attached printer */
\r
- uint16_t Length; /**< Length in bytes of the commands to send to the attached printer */
\r
- } Printer_Data_t;
\r
-
\r
/* Function Prototypes: */
\r
/* Function Prototypes: */
\r
- uint8_t Printer_SendData(
Printer_Data_t* PrinterCommands
);
\r
+ uint8_t Printer_SendData(
void* PrinterCommands, uint16_t CommandSize
);
\r
uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize);
\r
uint8_t Printer_GetPortStatus(uint8_t* PortStatus);
\r
uint8_t Printer_SoftReset(void);
\r
uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize);
\r
uint8_t Printer_GetPortStatus(uint8_t* PortStatus);
\r
uint8_t Printer_SoftReset(void);
\r
diff --git
a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c
index
b2b4059
..
9d62fda
100644
(file)
--- a/
Demos/Host/LowLevel/PrinterHost/PrinterHost.c
+++ b/
Demos/Host/LowLevel/PrinterHost/PrinterHost.c
@@
-197,10
+197,10
@@
void USB_Printer_Host(void)
\r
puts_P(PSTR("Retrieving Device ID...\r\n"));
\r
\r
\r
puts_P(PSTR("Retrieving Device ID...\r\n"));
\r
\r
- char DeviceIDString[
256
];
\r
+ char DeviceIDString[
300
];
\r
if ((ErrorCode = Printer_GetDeviceID(DeviceIDString, sizeof(DeviceIDString))) != HOST_SENDCONTROL_Successful)
\r
{
\r
if ((ErrorCode = Printer_GetDeviceID(DeviceIDString, sizeof(DeviceIDString))) != HOST_SENDCONTROL_Successful)
\r
{
\r
- printf_P(PSTR(ESC_FG_RED "Control Error (Get DeviceID).\r\n"
\r
+ printf_P(PSTR(ESC_FG_RED "Control Error (Get Device
ID).\r\n"
\r
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
\r
\r
/* Indicate error via status LEDs */
\r
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
\r
\r
/* Indicate error via status LEDs */
\r
@@
-221,15
+221,12
@@
void USB_Printer_Host(void)
/* Indicate device busy via the status LEDs */
\r
LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
\r
\r
/* Indicate device busy via the status LEDs */
\r
LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
\r
\r
- Printer_Data_t TestPageData =
\r
- {
\r
- "\033%-12345X\033E" "LUFA PCL Test Page" "\033E\033%-12345X",
\r
- (sizeof(TestPageData.Data) - 1)
\r
- };
\r
+ char TestPageData[] = "\033%-12345X\033E" "LUFA PCL Test Page" "\033E\033%-12345X";
\r
+ uint16_t TestPageLength = strlen(TestPageData);
\r
\r
\r
- printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), TestPage
Data.
Length);
\r
+ printf_P(PSTR("Sending Test Page (%d bytes)...\r\n"), TestPageLength);
\r
\r
\r
- if ((ErrorCode = Printer_SendData(&TestPageData)) != PIPE_RWSTREAM_NoError)
\r
+ if ((ErrorCode = Printer_SendData(&TestPageData
, TestPageLength
)) != PIPE_RWSTREAM_NoError)
\r
{
\r
printf_P(PSTR(ESC_FG_RED "Error Sending Test Page.\r\n"
\r
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
\r
{
\r
printf_P(PSTR(ESC_FG_RED "Error Sending Test Page.\r\n"
\r
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
\r
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
d42ad45
..
cbabdae
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-49,6
+49,7
@@
* - Fixed Device mode HID Class driver not explicitly initializing the ReportSize parameter to zero before calling callback
\r
* routine, so that ignored callbacks don't cause incorrect data to be sent
\r
* - Fixed StillImageHost not correctly freezing and unfreezing data pipes while waiting for a response block header
\r
* - Fixed Device mode HID Class driver not explicitly initializing the ReportSize parameter to zero before calling callback
\r
* routine, so that ignored callbacks don't cause incorrect data to be sent
\r
* - Fixed StillImageHost not correctly freezing and unfreezing data pipes while waiting for a response block header
\r
+ * - Fixed error in PrinterHost preventing the full page data from being sent to the attached device
\r
*
\r
*
\r
* \section Sec_ChangeLog090810 Version 090810
\r
*
\r
*
\r
* \section Sec_ChangeLog090810 Version 090810
\r