Skip to content

Commit 035b787

Browse files
committed
STM32Wx: I2C issue
a "else" was missing for uint32_t i2c_get_pclk(I2CName i2c) if (i2c == I2C_1) { else if (i2c == I2C_2) { else if (i2c == I2C_3) { else { error("I2C: unknown instance");
1 parent b7c2dd0 commit 035b787

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

targets/TARGET_STM/TARGET_STM32WB/i2c_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ uint32_t i2c_get_pclk(I2CName i2c)
4646
}
4747
}
4848
#if defined I2C2_BASE
49-
if (i2c == I2C_2) {
49+
else if (i2c == I2C_2) {
5050
clocksource = __HAL_RCC_GET_I2C2_SOURCE();
5151
switch (clocksource) {
5252
case RCC_I2C2CLKSOURCE_PCLK1:

targets/TARGET_STM/TARGET_STM32WL/i2c_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ uint32_t i2c_get_pclk(I2CName i2c)
4747
}
4848
}
4949
#if defined I2C2_BASE
50-
if (i2c == I2C_2) {
50+
else if (i2c == I2C_2) {
5151
clocksource = __HAL_RCC_GET_I2C2_SOURCE();
5252
switch (clocksource) {
5353
case RCC_I2C2CLKSOURCE_PCLK1:

0 commit comments

Comments
 (0)