1 uint8_t TEMPLATE_FUNC_NAME (void* Buffer
, uint16_t Length
) 
   3         uint8_t* DataStream 
= ((uint8_t*)Buffer 
+ TEMPLATE_BUFFER_OFFSET(Length
)); 
  10                 if (Endpoint_IsSETUPReceived()) 
  11                   return ENDPOINT_RWCSTREAM_HostAborted
; 
  13                 if (USB_DeviceState 
== DEVICE_STATE_Unattached
) 
  14                   return ENDPOINT_RWCSTREAM_DeviceDisconnected
; 
  16                 if (Endpoint_IsOUTReceived()) 
  18                         while (Length 
&& Endpoint_BytesInEndpoint()) 
  20                                 TEMPLATE_TRANSFER_BYTE(DataStream
); 
  28         while (!(Endpoint_IsINReady())) 
  30                 if (USB_DeviceState 
== DEVICE_STATE_Unattached
) 
  31                   return ENDPOINT_RWCSTREAM_DeviceDisconnected
; 
  34         return ENDPOINT_RWCSTREAM_NoError
; 
  38 #undef TEMPLATE_BUFFER_OFFSET 
  39 #undef TEMPLATE_FUNC_NAME 
  40 #undef TEMPLATE_TRANSFER_BYTE