1 uint8_t TEMPLATE_FUNC_NAME (void* Buffer
, uint16_t Length
)
3 uint8_t* DataStream
= (uint8_t*)(Buffer
+ TEMPLATE_BUFFER_OFFSET(Length
));
7 if (Endpoint_IsSETUPReceived())
8 return ENDPOINT_RWCSTREAM_HostAborted
;
10 if (USB_DeviceState
== DEVICE_STATE_Unattached
)
11 return ENDPOINT_RWCSTREAM_DeviceDisconnected
;
13 if (Endpoint_IsOUTReceived())
15 while (Length
&& Endpoint_BytesInEndpoint())
17 TEMPLATE_TRANSFER_BYTE(DataStream
);
25 while (!(Endpoint_IsINReady()))
27 if (USB_DeviceState
== DEVICE_STATE_Unattached
)
28 return ENDPOINT_RWCSTREAM_DeviceDisconnected
;
31 return ENDPOINT_RWCSTREAM_NoError
;
35 #undef TEMPLATE_BUFFER_OFFSET
36 #undef TEMPLATE_FUNC_NAME
37 #undef TEMPLATE_TRANSFER_BYTE