Fixed AVRISP project timeouts not checking for the correct timeout period (thanks to Carl Ott).

This commit is contained in:
Dean Camera 2009-12-20 22:33:48 +00:00
parent 8b75659563
commit 37c9ba7fa9
6 changed files with 59 additions and 13 deletions

View file

@ -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: */