aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/I2Cv1
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-07-10 06:17:25 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-07-10 06:17:25 +0000
commit0ffd6299f338fcc0b5fb5183f7c3ba41a3bb4eb2 (patch)
tree5e5b3893e7d2b15ad4f34837cbad8f534abc7e62 /os/hal/platforms/STM32/I2Cv1
parentcef1ea693ef78330b4f081421a3c84fbdd6d0392 (diff)
downloadChibiOS-0ffd6299f338fcc0b5fb5183f7c3ba41a3bb4eb2.tar.gz
ChibiOS-0ffd6299f338fcc0b5fb5183f7c3ba41a3bb4eb2.tar.bz2
ChibiOS-0ffd6299f338fcc0b5fb5183f7c3ba41a3bb4eb2.zip
I2C. Fixed wrong checks.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4448 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/I2Cv1')
-rw-r--r--os/hal/platforms/STM32/I2Cv1/i2c_lld.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/I2Cv1/i2c_lld.c b/os/hal/platforms/STM32/I2Cv1/i2c_lld.c
index 0d6d4a651..5957266d4 100644
--- a/os/hal/platforms/STM32/I2Cv1/i2c_lld.c
+++ b/os/hal/platforms/STM32/I2Cv1/i2c_lld.c
@@ -212,7 +212,7 @@ static void i2c_lld_set_clock(I2CDriver *i2cp) {
"PCLK1 must be divided without remainder");
clock_div = (uint16_t)(STM32_PCLK1 / (clock_speed * 2));
- chDbgAssert(clock_div < 0x04,
+ chDbgAssert(clock_div >= 0x04,
"i2c_lld_set_clock(), #3",
"Clock divider less then 0x04 not allowed");
regCCR |= (clock_div & I2C_CCR_CCR);
@@ -242,7 +242,7 @@ static void i2c_lld_set_clock(I2CDriver *i2cp) {
regCCR |= I2C_CCR_DUTY;
}
- chDbgAssert(clock_div < 0x01,
+ chDbgAssert(clock_div >= 0x01,
"i2c_lld_set_clock(), #7",
"Clock divider less then 0x04 not allowed");
regCCR |= (I2C_CCR_FS | (clock_div & I2C_CCR_CCR));