Skip to content

Commit fbc7da1

Browse files
STM32: Fixed I2C Bug reported in #14696
Modified HAL_I2C_ErrorCallback function to solve bug reported in I2C Driver. This commit solves compilation error occured when DEVICE_I2CSLAVE is not defined.
1 parent a3be10c commit fbc7da1

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
@@ -1067,8 +1067,8 @@ void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c)
10671067
/* Get object ptr based on handler ptr */
10681068
i2c_t *obj = get_i2c_obj(hi2c);
10691069
struct i2c_s *obj_s = I2C_S(obj);
1070-
#if DEVICE_I2CSLAVE
10711070
I2C_HandleTypeDef *handle = &(obj_s->handle);
1071+
#if DEVICE_I2CSLAVE
10721072
uint32_t address = 0;
10731073
/* Store address to handle it after reset */
10741074
if (obj_s->slave) {

0 commit comments

Comments
 (0)