aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP/Lib/V2Protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/AVRISP/Lib/V2Protocol.h')
-rw-r--r--Projects/AVRISP/Lib/V2Protocol.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/Projects/AVRISP/Lib/V2Protocol.h b/Projects/AVRISP/Lib/V2Protocol.h
index 5f996eadd..1777e0fe1 100644
--- a/Projects/AVRISP/Lib/V2Protocol.h
+++ b/Projects/AVRISP/Lib/V2Protocol.h
@@ -70,7 +70,16 @@
static inline void V2Protocol_DelayMS(uint8_t DelayMS)
{
TCNT0 = 0;
- while (TCNT0 < DelayMS);
+ TIFR0 = (1 << OCF1A);
+
+ while (DelayMS)
+ {
+ if (TIFR0 & (1 << OCF1A))
+ {
+ TIFR0 = (1 << OCF1A);
+ DelayMS--;
+ }
+ }
}
/* External Variables: */