-uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length)\r
+uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length)\r
{\r
- uint8_t* DataStream = (uint8_t*)(Buffer + TEMPLATE_BUFFER_OFFSET(Length));\r
+ uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));\r
bool LastPacketFull = false;\r
\r
if (Length > USB_ControlRequest.wLength)\r
Length = USB_ControlRequest.wLength;\r
- \r
+ else if (!(Length))\r
+ Endpoint_ClearIN();\r
+\r
while (Length || LastPacketFull)\r
{\r
if (Endpoint_IsSETUPReceived())\r