Browse Source

Followup to millis_t patch

Scott Lahteine 6 years ago
parent
commit
8d3a92fc4a
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c View File

@@ -157,8 +157,8 @@ uint8_t u8g_i2c_send_byte(uint8_t data) {
157 157
   LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data
158 158
   LPC_I2C1->I2CONSET = I2C_I2CONSET_AA;
159 159
   LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC;
160
-  millis_t timeout = _millis + I2C_TIMEOUT;
161
-  while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && (timeout > _millis));  // wait for xmit to finish
160
+  const millis_t timeout = _millis + I2C_TIMEOUT;
161
+  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
162 162
   // had hangs with SH1106 so added time out - have seen temporary screen corruption when this happens
163 163
   return 1;
164 164
 }

Loading…
Cancel
Save