patch #9123: ftdi_syncbb: use FT245R_CYCLES in ft245r_set_bitclock()
Submitted by Ivan Frederiks: Replace magic numbers by #defined constant git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1475 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
e8c5ed0fcd
commit
f821bfc03d
1
NEWS
1
NEWS
|
@ -109,6 +109,7 @@ Current:
|
||||||
patch #9320: fix TPI RESET in bitbang.c
|
patch #9320: fix TPI RESET in bitbang.c
|
||||||
patch #9079: Fix ftdi_syncbb teardown (supersedes #9893)
|
patch #9079: Fix ftdi_syncbb teardown (supersedes #9893)
|
||||||
patch #9122: Fixed MISO sampling in ftdi_syncbb
|
patch #9122: Fixed MISO sampling in ftdi_syncbb
|
||||||
|
patch #9123: ftdi_syncbb: use FT245R_CYCLES in ft245r_set_bitclock()
|
||||||
|
|
||||||
* Internals:
|
* Internals:
|
||||||
- New avrdude.conf keyword "family_id", used to verify SIB attributes
|
- New avrdude.conf keyword "family_id", used to verify SIB attributes
|
||||||
|
|
6
ft245r.c
6
ft245r.c
|
@ -260,16 +260,16 @@ static int ft245r_set_bitclock(PROGRAMMER * pgm) {
|
||||||
|
|
||||||
/* bitclock is second. 1us = 0.000001. Max rate for ft232r 750000 */
|
/* bitclock is second. 1us = 0.000001. Max rate for ft232r 750000 */
|
||||||
if(pgm->bitclock) {
|
if(pgm->bitclock) {
|
||||||
rate = (uint32_t)(1.0/pgm->bitclock) * 2;
|
rate = (uint32_t)(1.0/pgm->bitclock) * FT245R_CYCLES;
|
||||||
} else if (pgm->baudrate) {
|
} else if (pgm->baudrate) {
|
||||||
rate = pgm->baudrate * 2;
|
rate = pgm->baudrate * FT245R_CYCLES;
|
||||||
} else {
|
} else {
|
||||||
rate = 150000; /* should work for all ftdi chips and the avr default internal clock of 1MHz */
|
rate = 150000; /* should work for all ftdi chips and the avr default internal clock of 1MHz */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FT245R_DEBUG) {
|
if (FT245R_DEBUG) {
|
||||||
avrdude_message(MSG_NOTICE2, " ft245r: spi bitclk %d -> ft baudrate %d\n",
|
avrdude_message(MSG_NOTICE2, " ft245r: spi bitclk %d -> ft baudrate %d\n",
|
||||||
rate / 2, rate);
|
rate / FT245R_CYCLES, rate);
|
||||||
}
|
}
|
||||||
r = ftdi_set_baudrate(handle, rate);
|
r = ftdi_set_baudrate(handle, rate);
|
||||||
if (r) {
|
if (r) {
|
||||||
|
|
Loading…
Reference in New Issue