Followup to millis_t patch
This commit is contained in:
parent
44369d536a
commit
8d3a92fc4a
|
@ -157,8 +157,8 @@ uint8_t u8g_i2c_send_byte(uint8_t data) {
|
||||||
LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data
|
LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data
|
||||||
LPC_I2C1->I2CONSET = I2C_I2CONSET_AA;
|
LPC_I2C1->I2CONSET = I2C_I2CONSET_AA;
|
||||||
LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC;
|
LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC;
|
||||||
millis_t timeout = _millis + I2C_TIMEOUT;
|
const millis_t timeout = _millis + I2C_TIMEOUT;
|
||||||
while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && (timeout > _millis)); // wait for xmit to finish
|
while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && PENDING(_millis, timeout)); // wait for xmit to finish
|
||||||
// had hangs with SH1106 so added time out - have seen temporary screen corruption when this happens
|
// had hangs with SH1106 so added time out - have seen temporary screen corruption when this happens
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue