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 Pipe_SetPipeToken(TEMPLATE_TOKEN
);
11 if ((ErrorCode
= Pipe_WaitUntilReady()))
14 if (BytesProcessed
!= NULL
)
16 Length
-= *BytesProcessed
;
17 TEMPLATE_BUFFER_MOVE(DataStream
, *BytesProcessed
);
22 if (!(Pipe_IsReadWriteAllowed()))
24 TEMPLATE_CLEAR_PIPE();
26 if (BytesProcessed
!= NULL
)
28 *BytesProcessed
+= BytesInTransfer
;
29 return PIPE_RWSTREAM_IncompleteTransfer
;
32 if ((ErrorCode
= Pipe_WaitUntilReady()))
37 TEMPLATE_TRANSFER_BYTE(DataStream
);
38 TEMPLATE_BUFFER_MOVE(DataStream
, 1);
44 return PIPE_RWSTREAM_NoError
;
47 #undef TEMPLATE_FUNC_NAME
48 #undef TEMPLATE_BUFFER_TYPE
50 #undef TEMPLATE_TRANSFER_BYTE
51 #undef TEMPLATE_CLEAR_PIPE
52 #undef TEMPLATE_BUFFER_OFFSET
53 #undef TEMPLATE_BUFFER_MOVE