Commit 9e517011 authored by Simone Primarosa's avatar Simone Primarosa

Added support for see the Power Consumption

parent 46ec8357
...@@ -280,10 +280,23 @@ static void lcd_implementation_status_screen() { ...@@ -280,10 +280,23 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(80,48); u8g.setPrintPos(80,48);
if (starttime != 0) { if (starttime != 0) {
uint16_t time = (millis() - starttime) / 60000; #if HAS_LCD_POWER_SENSOR
lcd_print(itostr2(time/60)); if (millis() < print_millis + 1000) {
lcd_print(':'); uint16_t time = (millis() - starttime) / 60000;
lcd_print(itostr2(time%60)); lcd_print(itostr2(time/60));
lcd_print(':');
lcd_print(itostr2(time%60));
}
else {
lcd_print(itostr4(power_consumption_hour-startpower));
lcd_print('Wh');
}
#else
uint16_t time = (millis() - starttime) / 60000;
lcd_print(itostr2(time/60));
lcd_print(':');
lcd_print(itostr2(time%60));
#endif
} }
else { else {
lcd_printPGM(PSTR("--:--")); lcd_printPGM(PSTR("--:--"));
...@@ -358,12 +371,13 @@ static void lcd_implementation_status_screen() { ...@@ -358,12 +371,13 @@ static void lcd_implementation_status_screen() {
#else #else
u8g.setPrintPos(0,63); u8g.setPrintPos(0,63);
#endif #endif
#if HAS_FILAMENT_SENSOR || HAS_POWER_CONSUMPTION_SENSOR
#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
...@@ -376,7 +390,7 @@ static void lcd_implementation_status_screen() { ...@@ -376,7 +390,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