stk500.c: Fixed fosc behaviour for values exceeding maximum frequency (contributed by Galen Seitz)

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@422 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Jan-Hinnerk Reichert 2004-07-04 12:13:02 +00:00
parent 66ce0f3cf4
commit fc0d98fc3e
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2004-07-04 Jan-Hinnerk Reichert <hinni@despammed.com>
* stk500.c: Fixed fosc behaviour for values exceeding
maximum frequency (contributed by Galen Seitz)
2004-07-04 Jan-Hinnerk Reichert <hinni@despammed.com> 2004-07-04 Jan-Hinnerk Reichert <hinni@despammed.com>
* avrdude.conf.in: Added support for * avrdude.conf.in: Added support for
ATtiny2313 (contributed by Bob Paddock) ATtiny2313 (contributed by Bob Paddock)

View File

@ -919,7 +919,7 @@ static int stk500_set_fosc(PROGRAMMER * pgm, double v)
if (fosc >= fbase / (256 * ps[idx] * 2)) { if (fosc >= fbase / (256 * ps[idx] * 2)) {
/* this prescaler value can handle our frequency */ /* this prescaler value can handle our frequency */
prescale = idx + 1; prescale = idx + 1;
cmatch = (unsigned)(fbase / (2 * v * ps[idx])); cmatch = (unsigned)(fbase / (2 * fosc * ps[idx])) - 1;
break; break;
} }
} }