1 uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE
const 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 !defined(INTERRUPT_CONTROL_ENDPOINT)
34 if ((ErrorCode
= Endpoint_WaitUntilReady()))
39 TEMPLATE_TRANSFER_BYTE(DataStream
);
40 TEMPLATE_BUFFER_MOVE(DataStream
, 1);
46 return ENDPOINT_RWSTREAM_NoError
;
49 #undef TEMPLATE_FUNC_NAME
50 #undef TEMPLATE_BUFFER_TYPE
51 #undef TEMPLATE_TRANSFER_BYTE
52 #undef TEMPLATE_CLEAR_ENDPOINT
53 #undef TEMPLATE_BUFFER_OFFSET
54 #undef TEMPLATE_BUFFER_MOVE