diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-26 04:46:31 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-26 04:46:31 +0000 |
commit | 5aa2b26261389cfbdfae8e793be4b8150ddc7a0a (patch) | |
tree | 98cd416fe1b9407956892a22e5b01b3018ccbb09 /LUFA/Drivers/USB/Class/Host/Printer.c | |
parent | f37d21bbe961a72e4d6527767aacf843e3af412c (diff) | |
download | lufa-5aa2b26261389cfbdfae8e793be4b8150ddc7a0a.tar.gz lufa-5aa2b26261389cfbdfae8e793be4b8150ddc7a0a.tar.bz2 lufa-5aa2b26261389cfbdfae8e793be4b8150ddc7a0a.zip |
Added new RNDIS Host class driver and the beginnings of a RNDISEthernetHost Class Driver demo.
Fixed all Class drivers to ensure they have appropriate guards on each function to ensure the device is enumerated before running, fixed error codes on all guards to return "DeviceDisconnected" where possble.
Renamed HOST_SENDCONTROL_DeviceDisconnect enum value to HOST_SENDCONTROL_DeviceDisconnected to be in line with the rest of the library enum error codes.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/Printer.c')
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/Printer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/Printer.c b/LUFA/Drivers/USB/Class/Host/Printer.c index 192e17f86..d85ac15cf 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.c +++ b/LUFA/Drivers/USB/Class/Host/Printer.c @@ -187,6 +187,9 @@ uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, v {
uint8_t ErrorCode;
+ if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))
+ return PIPE_RWSTREAM_DeviceDisconnected;
+
Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze();
|