HAL_ChibiOS: report I2C clock downgrades

This commit is contained in:
Andrew Tridgell 2018-01-19 15:51:38 +11:00
parent 76703a80c4
commit 47ce37f463
1 changed files with 1 additions and 0 deletions

View File

@ -84,6 +84,7 @@ I2CDevice::I2CDevice(uint8_t busnum, uint8_t address, uint32_t bus_clock, bool u
(unsigned)busnum, (unsigned)address);
if (bus_clock < bus.i2ccfg.clock_speed) {
bus.i2ccfg.clock_speed = bus_clock;
hal.console->printf("I2C% clock %ukHz\n", busnum, bus_clock/1000);
if (bus_clock <= 100000) {
bus.i2ccfg.duty_cycle = STD_DUTY_CYCLE;
}