Skip to content

Commit 8a0c3c7

Browse files
authored
Merge pull request ARMmbed#14698 from affrinpinhero-2356/HAL_I2C_ErrorCallback-#14696
STM32: Fixed I2C Bug
2 parents bfedc39 + b7e6c04 commit 8a0c3c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_STM/i2c_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,10 +1175,10 @@ void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c)
11751175
/* Get object ptr based on handler ptr */
11761176
i2c_t *obj = get_i2c_obj(hi2c);
11771177
struct i2c_s *obj_s = I2C_S(obj);
1178+
I2C_HandleTypeDef *handle = &(obj_s->handle);
11781179
uint32_t event_code = 0;
11791180

11801181
#if DEVICE_I2CSLAVE
1181-
I2C_HandleTypeDef *handle = &(obj_s->handle);
11821182
uint32_t address = 0;
11831183
/* Store address to handle it after reset */
11841184
if (obj_s->slave) {

0 commit comments

Comments
 (0)