MKS H43 fix, cleanup (#21485)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
Sola
2021-03-31 15:34:17 +08:00
committed by GitHub
parent bfdd1f4662
commit 4d17613050
8 changed files with 202 additions and 205 deletions

View File

@ -153,6 +153,11 @@
#include "../libs/buzzer.h"
#endif
#if ENABLED(DGUS_LCD_UI_MKS)
#include "../lcd/extui/lib/dgus/DGUSScreenHandler.h"
#include "../lcd/extui/lib/dgus/DGUSDisplayDef.h"
#endif
#pragma pack(push, 1) // No padding between variables
#if HAS_ETHERNET
@ -461,6 +466,16 @@ typedef struct SettingsDataStruct {
bool buzzer_enabled;
#endif
//
// MKS UI controller
//
#if ENABLED(DGUS_LCD_UI_MKS)
uint8_t mks_language_index; // Display Language
xy_int_t mks_corner_offsets[5]; // Bed Tramming
xyz_int_t mks_park_pos; // Custom Parking (without NOZZLE_PARK)
celsius_t mks_min_extrusion_temp; // Min E Temp (shadow M302 value)
#endif
#if HAS_MULTI_LANGUAGE
uint8_t ui_language; // M414 S
#endif
@ -1402,6 +1417,16 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(ui.buzzer_enabled);
#endif
//
// MKS UI controller
//
#if ENABLED(DGUS_LCD_UI_MKS)
EEPROM_WRITE(mks_language_index);
EEPROM_WRITE(mks_corner_offsets);
EEPROM_WRITE(mks_park_pos);
EEPROM_WRITE(mks_min_extrusion_temp);
#endif
//
// Selected LCD language
//
@ -2302,6 +2327,17 @@ void MarlinSettings::postprocess() {
EEPROM_READ(ui.buzzer_enabled);
#endif
//
// MKS UI controller
//
#if ENABLED(DGUS_LCD_UI_MKS)
_FIELD_TEST(mks_language_index);
EEPROM_READ(mks_language_index);
EEPROM_READ(mks_corner_offsets);
EEPROM_READ(mks_park_pos);
EEPROM_READ(mks_min_extrusion_temp);
#endif
//
// Selected LCD language
//
@ -2967,6 +3003,11 @@ void MarlinSettings::reset() {
#endif
#endif
//
// MKS UI controller
//
TERN_(DGUS_LCD_UI_MKS, MKS_reset_settings());
postprocess();
DEBUG_ECHO_START();