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 {
122
122
PinName scl ;
123
123
IRQn_Type event_i2cIRQ ;
124
124
IRQn_Type error_i2cIRQ ;
125
- uint8_t XferOperation ;
125
+ uint32_t XferOperation ;
126
126
volatile uint8_t event ;
127
127
#if DEVICE_I2CSLAVE
128
128
uint8_t slave ;
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ struct i2c_s {
106
106
int scl_func ;
107
107
IRQn_Type event_i2cIRQ ;
108
108
IRQn_Type error_i2cIRQ ;
109
- uint8_t XferOperation ;
109
+ uint32_t XferOperation ;
110
110
volatile uint8_t event ;
111
111
#if DEVICE_I2CSLAVE
112
112
uint8_t slave ;
Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ static I2C_HandleTypeDef *i2c_handles[I2C_NUM];
195
195
#define FLAG_TIMEOUT ((int)0x1000)
196
196
#endif
197
197
198
+ #ifdef I2C_IP_VERSION_V1
199
+ #define I2C_STATE_NONE ((uint32_t)(HAL_I2C_MODE_NONE))
200
+ #endif
201
+
198
202
/* Declare i2c_init_internal to be used in this file */
199
203
void i2c_init_internal (i2c_t * obj , const i2c_pinmap_t * pinmap );
200
204
@@ -1159,7 +1163,9 @@ void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c)
1159
1163
/* Get object ptr based on handler ptr */
1160
1164
i2c_t * obj = get_i2c_obj (hi2c );
1161
1165
struct i2c_s * obj_s = I2C_S (obj );
1162
-
1166
+ #ifdef I2C_IP_VERSION_V1
1167
+ hi2c -> PreviousState = I2C_STATE_NONE ;
1168
+ #endif
1163
1169
/* Set event flag */
1164
1170
obj_s -> event = I2C_EVENT_TRANSFER_COMPLETE ;
1165
1171
}
You can’t perform that action at this time.
0 commit comments