Commit 46ec8357 authored by Simone Primarosa's avatar Simone Primarosa

Added support for see the Power Consumption

parent 639e7031
......@@ -586,13 +586,27 @@ static void lcd_implementation_status_screen()
#endif //SDSUPPORT
#endif //LCD_WIDTH > 19
lcd.setCursor(LCD_WIDTH - 6, 2);
lcd.print(LCD_STR_CLOCK[0]);
if(starttime != 0)
{
#if HAS_LCD_POWER_SENSOR
if (millis() < print_millis + 1000) {
lcd.print(LCD_STR_CLOCK[0]);
uint16_t time = millis()/60000 - starttime/60000;
lcd.print(itostr2(time/60));
lcd.print(':');
lcd.print(itostr2(time%60));
}
else {
lcd.print(itostr4(power_consumption_hour-startpower));
lcd.print('Wh');
}
#else
lcd.print(LCD_STR_CLOCK[0]);
uint16_t time = millis()/60000 - starttime/60000;
lcd.print(itostr2(time/60));
lcd.print(':');
lcd.print(itostr2(time%60));
#endif
}
else {
lcd_printPGM(PSTR("--:--"));
......@@ -627,12 +641,12 @@ static void lcd_implementation_status_screen()
#endif //LCD_PROGRESS_BAR
//Display both Status message line and Filament display on the last line
#if (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)) || (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY))
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR
if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message);
}
#if HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY)
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)
#if HAS_LCD_POWER_SENSOR
#if HAS_LCD_FILAMENT_SENSOR
else if (millis() < message_millis + 10000)
#else
else
......@@ -645,7 +659,7 @@ static void lcd_implementation_status_screen()
lcd_printPGM(PSTR("Wh"));
}
#endif
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)
#if HAS_LCD_FILAMENT_SENSOR
else {
lcd_printPGM(PSTR("D:"));
lcd.print(ftostr12ns(filament_width_meas));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment