#include "Printer.h"\r
\r
uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize,\r
- uint8_t* DeviceConfigDescriptor)\r
+ void* DeviceConfigDescriptor)\r
{\r
uint8_t FoundEndpoints = 0;\r
\r
{\r
Pipe_ConfigurePipe(PRNTInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_IN,\r
EndpointData->EndpointAddress, EndpointData->EndpointSize,\r
- PIPE_BANK_DOUBLE);\r
+ PRNTInterfaceInfo->Config.DataINPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);\r
PRNTInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize;\r
\r
FoundEndpoints |= PRNT_FOUND_DATAPIPE_IN;\r
{\r
Pipe_ConfigurePipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_OUT,\r
EndpointData->EndpointAddress, EndpointData->EndpointSize,\r
- PIPE_BANK_DOUBLE);\r
+ PRNTInterfaceInfo->Config.DataOUTPipeDoubleBank ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE);\r
PRNTInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize;\r
\r
FoundEndpoints |= PRNT_FOUND_DATAPIPE_OUT;\r
\r
void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)\r
{\r
- \r
+ (void)PRNTInterfaceInfo;\r
}\r
\r
uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)\r
\r
USB_ControlRequest = (USB_Request_Header_t)\r
{\r
- bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE),\r
- bRequest: REQ_SetInterface,\r
- wValue: PRNTInterfaceInfo->State.AlternateSetting,\r
- wIndex: PRNTInterfaceInfo->State.InterfaceNumber,\r
- wLength: 0,\r
+ .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE),\r
+ .bRequest = REQ_SetInterface,\r
+ .wValue = PRNTInterfaceInfo->State.AlternateSetting,\r
+ .wIndex = PRNTInterfaceInfo->State.InterfaceNumber,\r
+ .wLength = 0,\r
};\r
\r
Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
{\r
USB_ControlRequest = (USB_Request_Header_t)\r
{\r
- bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),\r
- bRequest: REQ_GetPortStatus,\r
- wValue: 0,\r
- wIndex: PRNTInterfaceInfo->State.InterfaceNumber,\r
- wLength: sizeof(uint8_t),\r
+ .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),\r
+ .bRequest = REQ_GetPortStatus,\r
+ .wValue = 0,\r
+ .wIndex = PRNTInterfaceInfo->State.InterfaceNumber,\r
+ .wLength = sizeof(uint8_t),\r
};\r
\r
Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
{\r
USB_ControlRequest = (USB_Request_Header_t)\r
{\r
- bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),\r
- bRequest: REQ_SoftReset,\r
- wValue: 0,\r
- wIndex: PRNTInterfaceInfo->State.InterfaceNumber,\r
- wLength: 0,\r
+ .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),\r
+ .bRequest = REQ_SoftReset,\r
+ .wValue = 0,\r
+ .wIndex = PRNTInterfaceInfo->State.InterfaceNumber,\r
+ .wLength = 0,\r
};\r
\r
Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
{\r
uint8_t ErrorCode;\r
\r
+ if ((USB_HostState != HOST_STATE_Configured) || !(PRNTInterfaceInfo->State.IsActive))\r
+ return PIPE_RWSTREAM_DeviceDisconnected;\r
+\r
Pipe_SelectPipe(PRNTInterfaceInfo->Config.DataOUTPipeNumber);\r
Pipe_Unfreeze();\r
\r
\r
USB_ControlRequest = (USB_Request_Header_t)\r
{\r
- bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),\r
- bRequest: REQ_GetDeviceID,\r
- wValue: 0,\r
- wIndex: PRNTInterfaceInfo->State.InterfaceNumber,\r
- wLength: sizeof(DeviceIDStringLength),\r
+ .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),\r
+ .bRequest = REQ_GetDeviceID,\r
+ .wValue = 0,\r
+ .wIndex = PRNTInterfaceInfo->State.InterfaceNumber,\r
+ .wLength = sizeof(DeviceIDStringLength),\r
};\r
\r
Pipe_SelectPipe(PIPE_CONTROLPIPE);\r