Power monitor and display (#17437)
This commit is contained in:
@@ -94,6 +94,10 @@
|
||||
#include "../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_MONITOR)
|
||||
#include "../feature/power_monitor.h"
|
||||
#endif
|
||||
|
||||
#include "../feature/pause.h"
|
||||
|
||||
#if ENABLED(BACKLASH_COMPENSATION)
|
||||
@@ -301,6 +305,11 @@ typedef struct SettingsDataStruct {
|
||||
user_thermistor_t user_thermistor[USER_THERMISTORS]; // M305 P0 R4700 T100000 B3950
|
||||
#endif
|
||||
|
||||
//
|
||||
// Power monitor
|
||||
//
|
||||
uint8_t power_monitor_flags; // M430 I V W
|
||||
|
||||
//
|
||||
// HAS_LCD_CONTRAST
|
||||
//
|
||||
@@ -881,6 +890,19 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Power monitor
|
||||
//
|
||||
{
|
||||
#if HAS_POWER_MONITOR
|
||||
const uint8_t &power_monitor_flags = power_monitor.flags;
|
||||
#else
|
||||
constexpr uint8_t power_monitor_flags = 0x00;
|
||||
#endif
|
||||
_FIELD_TEST(power_monitor_flags);
|
||||
EEPROM_WRITE(power_monitor_flags);
|
||||
}
|
||||
|
||||
//
|
||||
// LCD Contrast
|
||||
//
|
||||
@@ -1745,6 +1767,19 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Power monitor
|
||||
//
|
||||
{
|
||||
#if HAS_POWER_MONITOR
|
||||
uint8_t &power_monitor_flags = power_monitor.flags;
|
||||
#else
|
||||
uint8_t power_monitor_flags;
|
||||
#endif
|
||||
_FIELD_TEST(power_monitor_flags);
|
||||
EEPROM_READ(power_monitor_flags);
|
||||
}
|
||||
|
||||
//
|
||||
// LCD Contrast
|
||||
//
|
||||
@@ -2604,6 +2639,11 @@ void MarlinSettings::reset() {
|
||||
//
|
||||
TERN_(HAS_USER_THERMISTORS, thermalManager.reset_user_thermistors());
|
||||
|
||||
//
|
||||
// Power Monitor
|
||||
//
|
||||
TERN_(POWER_MONITOR, power_monitor.reset());
|
||||
|
||||
//
|
||||
// LCD Contrast
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user