|
@ -68,11 +68,7 @@ |
|
|
|
|
|
|
|
|
#elif EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) |
|
|
#elif EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) |
|
|
|
|
|
|
|
|
LCD_CLASS lcd(LCD_I2C_ADDRESS |
|
|
LCD_CLASS lcd(LCD_I2C_ADDRESS OPTARG(DETECT_I2C_LCD_DEVICE, 1)); |
|
|
#ifdef DETECT_DEVICE |
|
|
|
|
|
, 1 |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
#elif ENABLED(LCD_I2C_TYPE_PCA8574) |
|
|
#elif ENABLED(LCD_I2C_TYPE_PCA8574) |
|
|
|
|
|
|
|
@ -380,11 +376,7 @@ void MarlinUI::init_lcd() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool MarlinUI::detected() { |
|
|
bool MarlinUI::detected() { |
|
|
return (true |
|
|
return TERN1(DETECT_I2C_LCD_DEVICE, lcd.LcdDetected() == 1); |
|
|
#if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE) |
|
|
|
|
|
&& lcd.LcdDetected() == 1 |
|
|
|
|
|
#endif |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#if HAS_SLOW_BUTTONS |
|
|
#if HAS_SLOW_BUTTONS |
|
@ -602,10 +594,11 @@ FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) { |
|
|
FORCE_INLINE void _draw_ammeter_status() { |
|
|
FORCE_INLINE void _draw_ammeter_status() { |
|
|
lcd_put_u8str(" "); |
|
|
lcd_put_u8str(" "); |
|
|
ammeter.read(); |
|
|
ammeter.read(); |
|
|
if (ammeter.current <= .999) { |
|
|
if (ammeter.current <= 0.999f) { |
|
|
lcd_put_u8str(ftostr3ns(ammeter.current)); |
|
|
lcd_put_u8str(ui16tostr3rj(uint16_t(ammeter.current * 1000 + 0.5f))); |
|
|
lcd_put_u8str("mA"); |
|
|
lcd_put_u8str("mA"); |
|
|
} else { |
|
|
} |
|
|
|
|
|
else { |
|
|
lcd_put_u8str(ftostr12ns(ammeter.current)); |
|
|
lcd_put_u8str(ftostr12ns(ammeter.current)); |
|
|
lcd_put_wchar('A'); |
|
|
lcd_put_wchar('A'); |
|
|
} |
|
|
} |
|
@ -847,15 +840,9 @@ void MarlinUI::draw_status_screen() { |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if HAS_COOLER |
|
|
TERN_(HAS_COOLER, _draw_cooler_status('*', blink)); |
|
|
_draw_cooler_status('*', blink); |
|
|
TERN_(LASER_COOLANT_FLOW_METER, _draw_flowmeter_status()); |
|
|
#endif |
|
|
TERN_(I2C_AMMETER, _draw_ammeter_status()); |
|
|
#if ENABLED(LASER_COOLANT_FLOW_METER) |
|
|
|
|
|
_draw_flowmeter_status(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(I2C_AMMETER) |
|
|
|
|
|
_draw_ammeter_status(); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#endif // LCD_WIDTH >= 20
|
|
|
#endif // LCD_WIDTH >= 20
|
|
|
|
|
|
|
|
|