From 9030f1b2bf2508321ff8affff726b8de27a8c531 Mon Sep 17 00:00:00 2001 From: Konstantin Sharlaimov Date: Fri, 16 Sep 2016 21:46:25 +0300 Subject: [PATCH] Fix for I2C overclock not used. Closes #609 (#610) --- src/main/drivers/bus_i2c_stm32f10x.c | 6 +++--- src/main/drivers/bus_i2c_stm32f30x.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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; + } } ///////////////////////////////////////////////////////////////////////////////