diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-02 00:27:52 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-02 00:27:52 +0000 |
commit | ecf7c18cf24a10df8d843c8f7c195d803e073330 (patch) | |
tree | 017cfab76d087b7eae72f7a7165fb145edf50c29 /Demos/Host/LowLevel/PrinterHost/Lib | |
parent | 0fdc1a2bc66f97048b94b967e80cd294189fca62 (diff) | |
download | lufa-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/Lib')
-rw-r--r-- | Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c | 7 | ||||
-rw-r--r-- | Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h | 12 |
2 files changed, 5 insertions, 14 deletions
diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c index cb051cdf1..fefcbbfc7 100644 --- 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
* languages accepted by the attached printer (e.g. PCL).
*
- * \param[in] PrinterCommands Pointer to a structure containing the commands and length of the data to send
+ * \param[in] PrinterCommands Pointer to the data to send to the attached printer
+ * \param[in] CommandSize Size of the data to send to the attached printer
*
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
*/
-uint8_t Printer_SendData(Printer_Data_t* PrinterCommands)
+uint8_t Printer_SendData(void* PrinterCommands, uint16_t CommandSize)
{
uint8_t ErrorCode;
Pipe_SelectPipe(PRINTER_DATA_OUT_PIPE);
Pipe_Unfreeze();
- if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands->Data, PrinterCommands->Length)) != PIPE_RWSTREAM_NoError)
+ if ((ErrorCode = Pipe_Write_Stream_LE(PrinterCommands, CommandSize)) != PIPE_RWSTREAM_NoError)
return ErrorCode;
Pipe_ClearOUT();
diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h index f55d03b0f..cb8f04618 100644 --- 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 */
#define PRINTER_DATA_OUT_PIPE 2
- /* Type Defines: */
- /** Type define for a Printer Command Data structure, for the encapsulation of raw printer commands to
- * send to an attached printer device.
- */
- typedef struct
- {
- char* Data; /**< Printer commands to send to the attached printer */
- uint16_t Length; /**< Length in bytes of the commands to send to the attached printer */
- } Printer_Data_t;
-
/* Function Prototypes: */
- uint8_t Printer_SendData(Printer_Data_t* PrinterCommands);
+ uint8_t Printer_SendData(void* PrinterCommands, uint16_t CommandSize);
uint8_t Printer_GetDeviceID(char* DeviceIDString, uint16_t BufferSize);
uint8_t Printer_GetPortStatus(uint8_t* PortStatus);
uint8_t Printer_SoftReset(void);
|