diff options
Diffstat (limited to 'os/hal/platforms/STM32/I2Cv1')
-rw-r--r-- | os/hal/platforms/STM32/I2Cv1/i2c_lld.c | 4 |
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));
|