diff options
author | mifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-05-10 12:35:11 +0000 |
---|---|---|
committer | mifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-05-10 12:35:11 +0000 |
commit | 2c75fdf06c60d4ff4f08f5b352b5c4511b8005f2 (patch) | |
tree | 1516d45bef1c8cdc014455d1b70992754d9054fc /src | |
parent | e2e874aa1fb4a2d9c21974f7c3e0be53b928def8 (diff) | |
download | openocd_libswd-2c75fdf06c60d4ff4f08f5b352b5c4511b8005f2.tar.gz openocd_libswd-2c75fdf06c60d4ff4f08f5b352b5c4511b8005f2.tar.bz2 openocd_libswd-2c75fdf06c60d4ff4f08f5b352b5c4511b8005f2.tar.xz openocd_libswd-2c75fdf06c60d4ff4f08f5b352b5c4511b8005f2.zip |
- corrected rounding in ft2232_khz
git-svn-id: svn://svn.berlios.de/openocd/trunk@654 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/ft2232.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index f5453a30..0b2e79c9 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -287,11 +287,12 @@ int ft2232_khz(int khz, int *jtag_speed) * of 10 for better rounding later. */ - /* Calc speed, (6000 / khz) - 1 */ + /* Calc speed, (6000 / khz) - 1 */ + /* Use 65000 for better rounding */ *jtag_speed = (60000 / khz) - 10; - /* Add 0.5 for rounding */ - *jtag_speed += 5; + /* Add 0.9 for rounding */ + *jtag_speed += 9; /* Calc real speed */ *jtag_speed = *jtag_speed / 10; |