diff --git a/src/main/drivers/bus_i2c_stm32f10x.c b/src/main/drivers/bus_i2c_stm32f10x.c index f9882169f..b72b30720 100644 --- a/src/main/drivers/bus_i2c_stm32f10x.c +++ b/src/main/drivers/bus_i2c_stm32f10x.c @@ -99,11 +99,11 @@ static i2cState_t i2cState[] = { { false, false, false, 0, 0, 0, 0, 0, 0, 0 } }; -static bool i2cOverClock; - void i2cSetOverclock(uint8_t overClock) { - i2cOverClock = overClock ? true : false; + for (unsigned int i = 0; i < sizeof(i2cHardwareMap) / sizeof(i2cHardwareMap[0]); i++) { + i2cHardwareMap[i].overClock = overClock; + } } void I2C1_ER_IRQHandler(void) { diff --git a/src/main/drivers/bus_i2c_stm32f30x.c b/src/main/drivers/bus_i2c_stm32f30x.c index 531b43187..9434b09e8 100644 --- a/src/main/drivers/bus_i2c_stm32f30x.c +++ b/src/main/drivers/bus_i2c_stm32f30x.c @@ -70,11 +70,11 @@ static bool deviceInitialised[] = { false }; -static bool i2cOverClock; - void i2cSetOverclock(uint8_t overClock) { - i2cOverClock = overClock ? true : false; + for (unsigned i = 0; i < sizeof(i2cHardwareMap) / sizeof(i2cHardwareMap[0]); i++) { + i2cHardwareMap[i].overClock = overClock; + } } ///////////////////////////////////////////////////////////////////////////////