summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-26 17:59:26 +0000
committermifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-05-26 17:59:26 +0000
commit923fdc6ff6b3be08075782fa56a4e146e1561fd8 (patch)
tree3c665a3cbba3ec1c175a1451caf848130e9efab4
parentbfc0ac58f87b8e6c4937de703ac89709f8eac951 (diff)
downloadopenocd_libswd-923fdc6ff6b3be08075782fa56a4e146e1561fd8.tar.gz
openocd_libswd-923fdc6ff6b3be08075782fa56a4e146e1561fd8.tar.bz2
openocd_libswd-923fdc6ff6b3be08075782fa56a4e146e1561fd8.tar.xz
openocd_libswd-923fdc6ff6b3be08075782fa56a4e146e1561fd8.zip
- added check for max. value of jtag_speed in ft2232_khz.
git-svn-id: svn://svn.berlios.de/openocd/trunk@690 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/jtag/ft2232.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c
index e3d92dce..3cc552d7 100644
--- a/src/jtag/ft2232.c
+++ b/src/jtag/ft2232.c
@@ -296,6 +296,12 @@ int ft2232_khz(int khz, int *jtag_speed)
*jtag_speed = 0;
}
+ /* Check max value */
+ if (*jtag_speed > 0xFFFF)
+ {
+ *jtag_speed = 0xFFFF;
+ }
+
return ERROR_OK;
}