File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ struct i2c_s {
122122 PinName scl ;
123123 IRQn_Type event_i2cIRQ ;
124124 IRQn_Type error_i2cIRQ ;
125- uint8_t XferOperation ;
125+ uint32_t XferOperation ;
126126 volatile uint8_t event ;
127127#if DEVICE_I2CSLAVE
128128 uint8_t slave ;
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ struct i2c_s {
106106 int scl_func ;
107107 IRQn_Type event_i2cIRQ ;
108108 IRQn_Type error_i2cIRQ ;
109- uint8_t XferOperation ;
109+ uint32_t XferOperation ;
110110 volatile uint8_t event ;
111111#if DEVICE_I2CSLAVE
112112 uint8_t slave ;
Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ static I2C_HandleTypeDef *i2c_handles[I2C_NUM];
195195#define FLAG_TIMEOUT ((int)0x1000)
196196#endif
197197
198+ #ifdef I2C_IP_VERSION_V1
199+ #define I2C_STATE_NONE ((uint32_t)(HAL_I2C_MODE_NONE))
200+ #endif
201+
198202/* Declare i2c_init_internal to be used in this file */
199203void i2c_init_internal (i2c_t * obj , const i2c_pinmap_t * pinmap );
200204
@@ -1159,7 +1163,9 @@ void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c)
11591163 /* Get object ptr based on handler ptr */
11601164 i2c_t * obj = get_i2c_obj (hi2c );
11611165 struct i2c_s * obj_s = I2C_S (obj );
1162-
1166+ #ifdef I2C_IP_VERSION_V1
1167+ hi2c -> PreviousState = I2C_STATE_NONE ;
1168+ #endif
11631169 /* Set event flag */
11641170 obj_s -> event = I2C_EVENT_TRANSFER_COMPLETE ;
11651171}
You can’t perform that action at this time.
0 commit comments