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)
192192 base -> C1 |= I2C_C1_TXAK_MASK ; // NACK
193193 }
194194
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 ;
199197
200198 /* Wait until data transfer complete. */
201199 while (!(base -> S & kI2C_IntPendingFlag ))
@@ -205,6 +203,11 @@ int i2c_byte_read(i2c_t *obj, int last)
205203 /* Clear the IICIF flag. */
206204 base -> S = kI2C_IntPendingFlag ;
207205
206+ /* Change direction to Tx to avoid extra clocks. */
207+ base -> C1 |= I2C_C1_TX_MASK ;
208+
209+ data = (base -> D & 0xFF );
210+
208211 return data ;
209212}
210213
You can’t perform that action at this time.
0 commit comments