Update and fix DGUS (#16317)
This commit is contained in:
committed by
Scott Lahteine
parent
7f87a044cd
commit
e593da1c23
@ -28,7 +28,7 @@
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(DGUS_LCD)
|
||||
#if HAS_DGUS_LCD
|
||||
|
||||
#include "extensible_ui/ui_api.h"
|
||||
#include "extensible_ui/lib/dgus/DGUSDisplay.h"
|
||||
@ -88,8 +88,69 @@ namespace ExtUI {
|
||||
void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
|
||||
|
||||
void onFactoryReset() {}
|
||||
void onLoadSettings() {}
|
||||
void onStoreSettings() {}
|
||||
}
|
||||
void onStoreSettings(char *buff) {
|
||||
// Called when saving to EEPROM (i.e. M500). If the ExtUI needs
|
||||
// permanent data to be stored, it can write up to eeprom_data_size bytes
|
||||
// into buff.
|
||||
|
||||
#endif // DGUS_LCD
|
||||
// Example:
|
||||
// static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
|
||||
// memcpy(buff, &myDataStruct, sizeof(myDataStruct));
|
||||
}
|
||||
|
||||
void onLoadSettings(const char *buff) {
|
||||
// Called while loading settings from EEPROM. If the ExtUI
|
||||
// needs to retrieve data, it should copy up to eeprom_data_size bytes
|
||||
// from buff
|
||||
|
||||
// Example:
|
||||
// static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
|
||||
// memcpy(&myDataStruct, buff, sizeof(myDataStruct));
|
||||
}
|
||||
|
||||
void onConfigurationStoreWritten(bool success) {
|
||||
// Called after the entire EEPROM has been written,
|
||||
// whether successful or not.
|
||||
}
|
||||
|
||||
void onConfigurationStoreRead(bool success) {
|
||||
// Called after the entire EEPROM has been read,
|
||||
// whether successful or not.
|
||||
}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
|
||||
// Called when any mesh points are updated
|
||||
}
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
void OnPowerLossResume() {
|
||||
// Called on resume from power-loss
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POWER_LOSS);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
void OnPidTuning(const result_t rst) {
|
||||
// Called for temperature PID tuning result
|
||||
SERIAL_ECHOLNPAIR("OnPidTuning:",rst);
|
||||
switch(rst) {
|
||||
case PID_BAD_EXTRUDER_NUM:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_BAD_EXTRUDER_NUM));
|
||||
break;
|
||||
case PID_TEMP_TOO_HIGH:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_TEMP_TOO_HIGH));
|
||||
break;
|
||||
case PID_TUNING_TIMEOUT:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_TIMEOUT));
|
||||
break;
|
||||
case PID_DONE:
|
||||
ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_AUTOTUNE_FINISHED));
|
||||
break;
|
||||
}
|
||||
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif // HAS_DGUS_LCD
|
||||
|
Reference in New Issue
Block a user