X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/8b7565956380c558bb309732c1d7d2cb58b193ea..37c9ba7fa980472406625973f0ee32719b5a8997:/Projects/AVRISP/Lib/V2Protocol.h 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: */