Skip to content

Commit 38e6275

Browse files
authored
Merge pull request #6246 from u-blox/i2c_fix
C030 platform I2C initialisation fix
2 parents a6e27b1 + c53fb9d commit 38e6275

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/min_battery_voltage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ void HAL_MspInit(void)
2727

2828
void set_minimum_battery_voltage()
2929
{
30-
i2c_t i2c_obj;
30+
i2c_t i2c_obj = {0};
3131
int data_read;
32-
i2c_frequency(&i2c_obj, I2C_FREQUENCY);
3332
i2c_init(&i2c_obj, I2C_SDA_B, I2C_SCL_B);
33+
i2c_frequency(&i2c_obj, I2C_FREQUENCY);
3434

3535
if (read_from_i2c(BQ24295_I2C_ADDRESS, 0, &data_read, i2c_obj)) {
3636
data_read = data_read & MIN_BATTERY_VOLTAGE_MASK;

0 commit comments

Comments
 (0)