Skip to content

Commit 4a8b230

Browse files
STM32: Fixed I2C Bug reported.
Modified HAL_I2C_ErrorCallback function to solve bug reported in I2C Driver. This commit solves compilation error occured when DEVICE_I2CSLAVE is not defined. fix #14696 Signed-off-by: Affrin Pinhero <[email protected]>
1 parent 8b1cd98 commit 4a8b230

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)