From 8d3a92fc4a6fe3fd8f7f244b9e16b8cad3def8cf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 20 Oct 2018 23:23:53 -0500 Subject: [PATCH] Followup to millis_t patch --- Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c index d57ed2599..12e8b4599 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c @@ -157,8 +157,8 @@ uint8_t u8g_i2c_send_byte(uint8_t data) { LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; - 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 + const millis_t timeout = _millis + I2C_TIMEOUT; + 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 return 1; }