+ \r
+ /* Ensure last packet is a short packet to terminate the transfer */\r
+ if (IsEndpointFull)\r
+ {\r
+ Endpoint_WaitUntilReady(); \r
+ Endpoint_ClearIN();\r
+ Endpoint_WaitUntilReady(); \r
+ }\r
+}\r
+\r
+/** Blocking delay for a given number of milliseconds.\r
+ *\r
+ * \param[in] DelayMS Number of milliseconds to delay for\r
+ */\r
+void ISPProtocol_DelayMS(uint8_t DelayMS)\r
+{\r
+ while (DelayMS-- && TimeoutMSRemaining)\r
+ {\r
+ if (TimeoutMSRemaining)\r
+ TimeoutMSRemaining--;\r
+ \r
+ _delay_ms(1);\r
+ }\r