Fix and improve Power Monitor (#21551)

This commit is contained in:
gmarsh
2021-04-13 17:17:52 -03:00
committed by GitHub
parent 84c79d7531
commit a5f0075a60
8 changed files with 37 additions and 36 deletions

View File

@@ -26,8 +26,11 @@
#include "power_monitor.h"
#include "../lcd/marlinui.h"
#include "../lcd/lcdprint.h"
#if HAS_LCD_MENU
#include "../lcd/marlinui.h"
#include "../lcd/lcdprint.h"
#endif
#include "../libs/numtostr.h"
uint8_t PowerMonitor::flags; // = 0
@@ -54,7 +57,7 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
}
#endif
#if HAS_POWER_MONITOR_VREF
#if ENABLED(POWER_MONITOR_VOLTAGE)
void PowerMonitor::draw_voltage() {
const float volts = getVolts();
lcd_put_u8str(volts < 100 ? ftostr31ns(volts) : ui16tostr4rj((uint16_t)volts));