I2C. Fixed wrong checks.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4448 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
barthess 2012-07-10 06:17:25 +00:00
parent cef1ea693e
commit 0ffd6299f3
1 changed files with 2 additions and 2 deletions

View File

@ -212,7 +212,7 @@ static void i2c_lld_set_clock(I2CDriver *i2cp) {
"PCLK1 must be divided without remainder"); "PCLK1 must be divided without remainder");
clock_div = (uint16_t)(STM32_PCLK1 / (clock_speed * 2)); clock_div = (uint16_t)(STM32_PCLK1 / (clock_speed * 2));
chDbgAssert(clock_div < 0x04, chDbgAssert(clock_div >= 0x04,
"i2c_lld_set_clock(), #3", "i2c_lld_set_clock(), #3",
"Clock divider less then 0x04 not allowed"); "Clock divider less then 0x04 not allowed");
regCCR |= (clock_div & I2C_CCR_CCR); regCCR |= (clock_div & I2C_CCR_CCR);
@ -242,7 +242,7 @@ static void i2c_lld_set_clock(I2CDriver *i2cp) {
regCCR |= I2C_CCR_DUTY; regCCR |= I2C_CCR_DUTY;
} }
chDbgAssert(clock_div < 0x01, chDbgAssert(clock_div >= 0x01,
"i2c_lld_set_clock(), #7", "i2c_lld_set_clock(), #7",
"Clock divider less then 0x04 not allowed"); "Clock divider less then 0x04 not allowed");
regCCR |= (I2C_CCR_FS | (clock_div & I2C_CCR_CCR)); regCCR |= (I2C_CCR_FS | (clock_div & I2C_CCR_CCR));