Fix TeensyHID bootloader - change vendor page in the descriptors to match the undocum...
[pub/USBasp.git] / Projects / AVRISP / Lib / V2Protocol.h
index 5f996ea..1777e0f 100644 (file)
                static inline void V2Protocol_DelayMS(uint8_t DelayMS)\r
                {\r
                        TCNT0 = 0;\r
-                       while (TCNT0 < DelayMS);\r
+                       TIFR0 = (1 << OCF1A);\r
+\r
+                       while (DelayMS)\r
+                       {\r
+                               if (TIFR0 & (1 << OCF1A))\r
+                               {\r
+                                       TIFR0 = (1 << OCF1A);\r
+                                       DelayMS--;\r
+                               }\r
+                       }\r
                }
 \r
        /* External Variables: */\r