summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-12-23 19:22:52 +1100
committerDamien George <damien.p.george@gmail.com>2017-12-23 19:22:52 +1100
commit008e1788e8a08261bb7c15976d18c946dd3b2259 (patch)
treec120e2e93ab1d498f8c48f09b52c91562f7984fa
parentd32417c0969a9cea5edec0858e147102a5720ed2 (diff)
stm32/i2c: Fix bug with I2C4 initialisation.
-rw-r--r--ports/stm32/i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/stm32/i2c.c b/ports/stm32/i2c.c
index e255cbc6b..5bbc889c1 100644
--- a/ports/stm32/i2c.c
+++ b/ports/stm32/i2c.c
@@ -222,7 +222,7 @@ void i2c_init0(void) {
#endif
#if defined(MICROPY_HW_I2C4_SCL)
memset(&I2CHandle4, 0, sizeof(I2C_HandleTypeDef));
- I2CHandle3.Instance = I2C4;
+ I2CHandle4.Instance = I2C4;
#endif
}
@@ -258,7 +258,7 @@ void i2c_init(I2C_HandleTypeDef *i2c) {
i2c_unit = 4;
scl_pin = &MICROPY_HW_I2C4_SCL;
sda_pin = &MICROPY_HW_I2C4_SDA;
- __I2C3_CLK_ENABLE();
+ __I2C4_CLK_ENABLE();
#endif
} else {
// I2C does not exist for this board (shouldn't get here, should be checked by caller)