1 uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE Buffer
,
3 uint16_t* const BytesProcessed
)
5 uint8_t* DataStream
= ((uint8_t*)Buffer
+ TEMPLATE_BUFFER_OFFSET(Length
));
6 uint16_t BytesInTransfer
= 0;
9 if ((ErrorCode
= Endpoint_WaitUntilReady()))
12 if (BytesProcessed
!= NULL
)
14 Length
-= *BytesProcessed
;
15 TEMPLATE_BUFFER_MOVE(DataStream
, *BytesProcessed
);
20 if (!(Endpoint_IsReadWriteAllowed()))
22 TEMPLATE_CLEAR_ENDPOINT();
24 if (BytesProcessed
!= NULL
)
26 *BytesProcessed
+= BytesInTransfer
;
27 return ENDPOINT_RWSTREAM_IncompleteTransfer
;
30 if ((ErrorCode
= Endpoint_WaitUntilReady()))
35 TEMPLATE_TRANSFER_BYTE(DataStream
);
36 TEMPLATE_BUFFER_MOVE(DataStream
, 1);
42 return ENDPOINT_RWSTREAM_NoError
;
45 #undef TEMPLATE_FUNC_NAME
46 #undef TEMPLATE_BUFFER_TYPE
47 #undef TEMPLATE_TRANSFER_BYTE
48 #undef TEMPLATE_CLEAR_ENDPOINT
49 #undef TEMPLATE_BUFFER_OFFSET
50 #undef TEMPLATE_BUFFER_MOVE