+ /* Indicate if the command has been aborted or not */\r
+ return (!(IsTMCBulkOUTReset) && (ErrorCode == ENDPOINT_RWSTREAM_NoError));\r
+}\r
+\r
+bool WriteTMCHeader(TMC_MessageHeader_t* const MessageHeader)\r
+{\r
+ uint16_t BytesTransferred;\r
+ uint8_t ErrorCode;\r
+\r
+ /* Set the message tag of the command header */\r
+ MessageHeader->Tag = CurrentTransferTag;\r
+ MessageHeader->InverseTag = ~CurrentTransferTag;\r
+\r
+ /* Select the Data In endpoint */\r
+ Endpoint_SelectEndpoint(TMC_IN_EPNUM);\r
+\r
+ /* Send the command header to the host */\r
+ BytesTransferred = 0;\r
+ while ((ErrorCode = Endpoint_Write_Stream_LE(MessageHeader, sizeof(TMC_MessageHeader_t), &BytesTransferred)) ==\r
+ ENDPOINT_RWSTREAM_IncompleteTransfer)\r
+ {\r
+ if (IsTMCBulkINReset)\r
+ break;\r
+ }\r
+\r
+ /* Indicate if the command has been aborted or not */\r
+ return (!(IsTMCBulkINReset) && (ErrorCode == ENDPOINT_RWSTREAM_NoError));\r