projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
092f82e
)
Fixed LowLevel PrinterHost demo not sending control requests to the attached printer...
author
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 24 Aug 2010 13:16:16 +0000
(13:16 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 24 Aug 2010 13:16:16 +0000
(13:16 +0000)
Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
patch
|
blob
|
blame
|
history
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.h
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Class/Host/Printer.c
patch
|
blob
|
blame
|
history
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
diff --git
a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
index
c9a2d92
..
11f6cda
100644
(file)
--- a/
Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
+++ b/
Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
@@
-153,7
+153,7
@@
void EVENT_USB_Device_ConfigurationChanged(void)
void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Determine which interface's Line Coding data is being set from the wIndex parameter */
void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Determine which interface's Line Coding data is being set from the wIndex parameter */
-
uint8_t* LineEncodingData = (USB_ControlRequest.wIndex == 0) ? (uint8_t*)&LineEncoding1 : (uint8_t*)
&LineEncoding2;
+
void* LineEncodingData = (USB_ControlRequest.wIndex == 0) ? &LineEncoding1 :
&LineEncoding2;
/* Process CDC specific control requests */
switch (USB_ControlRequest.bRequest)
/* Process CDC specific control requests */
switch (USB_ControlRequest.bRequest)
diff --git
a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
index
0248959
..
ac0ca9a
100644
(file)
--- a/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
+++ b/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
@@
-86,7
+86,7
@@
uint8_t Printer_GetDeviceID(char* DeviceIDString,
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_GetDeviceID,
.wValue = 0,
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_GetDeviceID,
.wValue = 0,
- .wIndex =
0
,
+ .wIndex =
PrinterInterfaceNumber
,
.wLength = sizeof(DeviceIDStringLength),
};
.wLength = sizeof(DeviceIDStringLength),
};
@@
-130,11
+130,11
@@
uint8_t Printer_GetPortStatus(uint8_t* const PortStatus)
{
USB_ControlRequest = (USB_Request_Header_t)
{
{
USB_ControlRequest = (USB_Request_Header_t)
{
-
bmRequestType:
(REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
-
bRequest:
REQ_GetPortStatus,
-
wValue:
0,
-
wIndex: 0
,
-
wLength:
sizeof(uint8_t),
+
.bmRequestType =
(REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
+
.bRequest =
REQ_GetPortStatus,
+
.wValue =
0,
+
.wIndex = PrinterInterfaceNumber
,
+
.wLength =
sizeof(uint8_t),
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
@@
-154,7
+154,7
@@
uint8_t Printer_SoftReset(void)
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SoftReset,
.wValue = 0,
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SoftReset,
.wValue = 0,
- .wIndex =
0
,
+ .wIndex =
PrinterInterfaceNumber
,
.wLength = 0,
};
.wLength = 0,
};
diff --git
a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
index
8c3bd33
..
3edfe43
100644
(file)
--- a/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
+++ b/
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
@@
-41,6
+41,8
@@
#include <string.h>
#include <LUFA/Drivers/USB/USB.h>
#include <string.h>
#include <LUFA/Drivers/USB/USB.h>
+
+ #include "../PrinterHost.h"
/* Macros: */
/** Printer class-specific request to retrieve the printer's ID string. */
/* Macros: */
/** Printer class-specific request to retrieve the printer's ID string. */
diff --git
a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h
b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h
index
78583f0
..
2ba270f
100644
(file)
--- a/
Demos/Host/LowLevel/PrinterHost/PrinterHost.h
+++ b/
Demos/Host/LowLevel/PrinterHost/PrinterHost.h
@@
-70,6
+70,9
@@
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
+ /* External Variables: */
+ extern uint8_t PrinterInterfaceNumber;
+
/* Function Prototypes: */
void EVENT_USB_Host_DeviceAttached(void);
void EVENT_USB_Host_DeviceUnattached(void);
/* Function Prototypes: */
void EVENT_USB_Host_DeviceAttached(void);
void EVENT_USB_Host_DeviceUnattached(void);
diff --git
a/LUFA/Drivers/USB/Class/Host/Printer.c
b/LUFA/Drivers/USB/Class/Host/Printer.c
index
31ba6c6
..
6c55f6a
100644
(file)
--- a/
LUFA/Drivers/USB/Class/Host/Printer.c
+++ b/
LUFA/Drivers/USB/Class/Host/Printer.c
@@
-171,10
+171,10
@@
uint8_t PRNT_Host_SoftReset(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
- .bRequest = REQ_SoftReset,
- .wValue = 0,
- .wIndex = PRNTInterfaceInfo->State.InterfaceNumber,
- .wLength = 0,
+ .bRequest
= REQ_SoftReset,
+ .wValue
= 0,
+ .wIndex
= PRNTInterfaceInfo->State.InterfaceNumber,
+ .wLength
= 0,
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
};
Pipe_SelectPipe(PIPE_CONTROLPIPE);
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
e71a6f0
..
d7e5f5c
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-36,6
+36,7
@@
* in the USB controller if the endpoints or pipes were allocated in anything other than ascending order (thanks to Martin Degelsegger)
* - Fixed USBtoSerial and Benito project SetLineEncoding calls failing if the USART is busy, due to the RX ISR delaying the control
* request handler
* in the USB controller if the endpoints or pipes were allocated in anything other than ascending order (thanks to Martin Degelsegger)
* - Fixed USBtoSerial and Benito project SetLineEncoding calls failing if the USART is busy, due to the RX ISR delaying the control
* request handler
+ * - Fixed LowLevel PrinterHost demo not sending control requests to the attached printer with the correct printer interface wIndex value
*
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>
*
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>