X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/1fa27139f5c195c0d7147dac0c5332a6ea10229a..c99f6657a6335b0a70fac9c6278672057e57f525:/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: */