Skip to content

Commit

Permalink
STM32: Fixed I2C Bug reported in #14696
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
affrinpinhero-2356 committed May 25, 2021
1 parent 8b1cd98 commit 67a3834
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion targets/TARGET_STM/i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,10 +1175,10 @@ void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c)
/* Get object ptr based on handler ptr */
i2c_t *obj = get_i2c_obj(hi2c);
struct i2c_s *obj_s = I2C_S(obj);
I2C_HandleTypeDef *handle = &(obj_s->handle);
uint32_t event_code = 0;

#if DEVICE_I2CSLAVE
I2C_HandleTypeDef *handle = &(obj_s->handle);
uint32_t address = 0;
/* Store address to handle it after reset */
if (obj_s->slave) {
Expand Down

0 comments on commit 67a3834

Please sign in to comment.