|
|
@ -113,22 +113,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
lcd_moveto(x, y);
|
|
|
|
lcd_moveto(x, y);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_POWER_MONITOR_WATTS
|
|
|
|
|
|
|
|
const bool wflag = power_monitor.power_display_enabled();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#if ENABLED(POWER_MONITOR_CURRENT)
|
|
|
|
#if ENABLED(POWER_MONITOR_CURRENT)
|
|
|
|
const bool iflag = power_monitor.current_display_enabled();
|
|
|
|
const bool iflag = power_monitor.current_display_enabled();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if HAS_POWER_MONITOR_VREF
|
|
|
|
#if HAS_POWER_MONITOR_VREF
|
|
|
|
const bool vflag = power_monitor.voltage_display_enabled();
|
|
|
|
const bool vflag = power_monitor.voltage_display_enabled();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if HAS_POWER_MONITOR_WATTS
|
|
|
|
|
|
|
|
const bool wflag = power_monitor.power_display_enabled();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(POWER_MONITOR_CURRENT) || HAS_POWER_MONITOR_VREF
|
|
|
|
#if HAS_POWER_MONITOR_WATTS
|
|
|
|
// cycle between current, voltage, and power
|
|
|
|
// Cycle between current, voltage, and power
|
|
|
|
if (ELAPSED(millis(), power_monitor.display_item_ms)) {
|
|
|
|
if (ELAPSED(millis(), power_monitor.display_item_ms)) {
|
|
|
|
power_monitor.display_item_ms = millis() + 1000UL;
|
|
|
|
power_monitor.display_item_ms = millis() + 1000UL;
|
|
|
|
++power_monitor.display_item;
|
|
|
|
++power_monitor.display_item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#elif ENABLED(POWER_MONITOR_CURRENT)
|
|
|
|
|
|
|
|
power_monitor.display_item = 0;
|
|
|
|
|
|
|
|
#elif HAS_POWER_MONITOR_VREF
|
|
|
|
|
|
|
|
power_monitor.display_item = 1;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// ensure we have the right one selected for display
|
|
|
|
// ensure we have the right one selected for display
|
|
|
@ -139,7 +143,7 @@
|
|
|
|
#if HAS_POWER_MONITOR_VREF
|
|
|
|
#if HAS_POWER_MONITOR_VREF
|
|
|
|
if (power_monitor.display_item == 1 && !vflag) ++power_monitor.display_item;
|
|
|
|
if (power_monitor.display_item == 1 && !vflag) ++power_monitor.display_item;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if ENABLED(POWER_MONITOR_CURRENT)
|
|
|
|
#if HAS_POWER_MONITOR_WATTS
|
|
|
|
if (power_monitor.display_item == 2 && !wflag) ++power_monitor.display_item;
|
|
|
|
if (power_monitor.display_item == 2 && !wflag) ++power_monitor.display_item;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (power_monitor.display_item >= 3) power_monitor.display_item = 0;
|
|
|
|
if (power_monitor.display_item >= 3) power_monitor.display_item = 0;
|
|
|
|