File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,8 @@ int i2c_byte_read(i2c_t *obj, int last)
192
192
base -> C1 |= I2C_C1_TXAK_MASK ; // NACK
193
193
}
194
194
195
- data = (base -> D & 0xFF );
196
-
197
- /* Change direction to Tx to avoid extra clocks. */
198
- base -> C1 |= I2C_C1_TX_MASK ;
195
+ /* Read dummy to release the bus. */
196
+ data = base -> D ;
199
197
200
198
/* Wait until data transfer complete. */
201
199
while (!(base -> S & kI2C_IntPendingFlag ))
@@ -205,6 +203,11 @@ int i2c_byte_read(i2c_t *obj, int last)
205
203
/* Clear the IICIF flag. */
206
204
base -> S = kI2C_IntPendingFlag ;
207
205
206
+ /* Change direction to Tx to avoid extra clocks. */
207
+ base -> C1 |= I2C_C1_TX_MASK ;
208
+
209
+ data = (base -> D & 0xFF );
210
+
208
211
return data ;
209
212
}
210
213
You can’t perform that action at this time.
0 commit comments