Added const where possible to the source functions in the Projects directory.
[pub/USBasp.git] / Projects / AVRISP / Lib / ISP / ISPProtocol.h
index 43c25c4..abbbf56 100644 (file)
                 */\r
                static inline void ISPProtocol_DelayMS(uint8_t DelayMS)\r
                {\r
-                       TCNT0 = 0;\r
-                       TIFR0 = (1 << OCF1A);\r
+                       OCR2A  = ((F_CPU / 64) / 1000);\r
+                       TCCR2A = (1 << WGM01);\r
+                       TCCR2B = ((1 << CS01) | (1 << CS00));                   \r
 \r
                        while (DelayMS)\r
                        {\r
-                               if (TIFR0 & (1 << OCF1A))\r
+                               if (TIFR2 & (1 << OCF2A))\r
                                {\r
-                                       TIFR0 = (1 << OCF1A);\r
+                                       TIFR2 = (1 << OCF2A);\r
                                        DelayMS--;\r
                                }\r
                        }\r
+                       \r
+                       TCCR2B = 0;                     \r
                }\r
 \r
        /* Function Prototypes: */\r