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() ...@@ -586,13 +586,27 @@ static void lcd_implementation_status_screen()
#endif //SDSUPPORT #endif //SDSUPPORT
#endif //LCD_WIDTH > 19 #endif //LCD_WIDTH > 19
lcd.setCursor(LCD_WIDTH - 6, 2); lcd.setCursor(LCD_WIDTH - 6, 2);
lcd.print(LCD_STR_CLOCK[0]);
if(starttime != 0) if(starttime != 0)
{ {
uint16_t time = millis()/60000 - starttime/60000; #if HAS_LCD_POWER_SENSOR
lcd.print(itostr2(time/60)); if (millis() < print_millis + 1000) {
lcd.print(':'); lcd.print(LCD_STR_CLOCK[0]);
lcd.print(itostr2(time%60)); 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 { else {
lcd_printPGM(PSTR("--:--")); lcd_printPGM(PSTR("--:--"));
...@@ -627,12 +641,12 @@ static void lcd_implementation_status_screen() ...@@ -627,12 +641,12 @@ static void lcd_implementation_status_screen()
#endif //LCD_PROGRESS_BAR #endif //LCD_PROGRESS_BAR
//Display both Status message line and Filament display on the last line //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 if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message); lcd_print(lcd_status_message);
} }
#if HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY) #if HAS_LCD_POWER_SENSOR
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY) #if HAS_LCD_FILAMENT_SENSOR
else if (millis() < message_millis + 10000) else if (millis() < message_millis + 10000)
#else #else
else else
...@@ -645,7 +659,7 @@ static void lcd_implementation_status_screen() ...@@ -645,7 +659,7 @@ static void lcd_implementation_status_screen()
lcd_printPGM(PSTR("Wh")); lcd_printPGM(PSTR("Wh"));
} }
#endif #endif
#if HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY) #if HAS_LCD_FILAMENT_SENSOR
else { else {
lcd_printPGM(PSTR("D:")); lcd_printPGM(PSTR("D:"));
lcd.print(ftostr12ns(filament_width_meas)); 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