New Controller Fan options and M710 gcode (#17149)

This commit is contained in:
Erkan Colak
2020-03-18 19:41:12 +01:00
committed by GitHub
parent abea6d5787
commit 83eec683c9
14 changed files with 307 additions and 52 deletions

View File

@ -122,6 +122,11 @@
#include "../feature/probe_temp_comp.h"
#endif
#include "../feature/controllerfan.h"
#if ENABLED(CONTROLLER_FAN_EDITABLE)
void M710_report(const bool forReplay);
#endif
#pragma pack(push, 1) // No padding between variables
typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t;
@ -292,6 +297,11 @@ typedef struct SettingsDataStruct {
//
int16_t lcd_contrast; // M250 C
//
// Controller fan settings
//
controllerFan_settings_t controllerFan_settings; // M710
//
// POWER_LOSS_RECOVERY
//
@ -880,6 +890,19 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(lcd_contrast);
}
//
// Controller Fan
//
{
_FIELD_TEST(controllerFan_settings);
#if ENABLED(USE_CONTROLLER_FAN)
const controllerFan_settings_t &cfs = controllerFan.settings;
#else
controllerFan_settings_t cfs = controllerFan_defaults;
#endif
EEPROM_WRITE(cfs);
}
//
// Power-Loss Recovery
//
@ -1719,6 +1742,19 @@ void MarlinSettings::postprocess() {
#endif
}
//
// Controller Fan
//
{
_FIELD_TEST(controllerFan_settings);
#if ENABLED(CONTROLLER_FAN_EDITABLE)
const controllerFan_settings_t &cfs = controllerFan.settings;
#else
controllerFan_settings_t cfs = { 0 };
#endif
EEPROM_READ(cfs);
}
//
// Power-Loss Recovery
//
@ -2590,6 +2626,13 @@ void MarlinSettings::reset() {
ui.set_contrast(DEFAULT_LCD_CONTRAST);
#endif
//
// Controller Fan
//
#if ENABLED(USE_CONTROLLER_FAN)
controllerFan.reset();
#endif
//
// Power-Loss Recovery
//
@ -3154,6 +3197,10 @@ void MarlinSettings::reset() {
SERIAL_ECHOLNPAIR(" M250 C", ui.contrast);
#endif
#if ENABLED(CONTROLLER_FAN_EDITABLE)
M710_report(forReplay);
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
CONFIG_ECHO_HEADING("Power-Loss Recovery:");
CONFIG_ECHO_START();