🐛 Fix compile with PREVENT_COLD_EXTRUSION off

This commit is contained in:
Scott Lahteine 2021-05-20 21:47:05 -05:00
parent c977e82074
commit 94e67a036a
3 changed files with 25 additions and 12 deletions

View file

@ -691,7 +691,10 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
VPHELPER(VP_X_PARK_POS, &mks_park_pos.x, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_X_PARK_POS, &mks_park_pos.x, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_Y_PARK_POS, &mks_park_pos.y, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Y_PARK_POS, &mks_park_pos.y, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_Z_PARK_POS, &mks_park_pos.z, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Z_PARK_POS, &mks_park_pos.z, ScreenHandler.GetParkPos_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#if ENABLED(PREVENT_COLD_EXTRUSION)
VPHELPER(VP_MIN_EX_T, &thermalManager.extrude_min_temp, ScreenHandler.HandleGetExMinTemp_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_MIN_EX_T, &thermalManager.extrude_min_temp, ScreenHandler.HandleGetExMinTemp_MKS, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#endif
#if ENABLED(SENSORLESS_HOMING) // TMC SENSORLESS Setting #if ENABLED(SENSORLESS_HOMING) // TMC SENSORLESS Setting
#if AXIS_HAS_STEALTHCHOP(X) #if AXIS_HAS_STEALTHCHOP(X)
@ -743,7 +746,11 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
VPHELPER(VP_ZOffset_Distance,nullptr ,ScreenHandler.GetZoffsetDistance, nullptr), VPHELPER(VP_ZOffset_Distance,nullptr ,ScreenHandler.GetZoffsetDistance, nullptr),
VPHELPER(VP_MESH_LEVEL_ADJUST, nullptr, ScreenHandler.MeshLevelDistanceConfig, nullptr), VPHELPER(VP_MESH_LEVEL_ADJUST, nullptr, ScreenHandler.MeshLevelDistanceConfig, nullptr),
VPHELPER(VP_MESH_LEVEL_POINT,nullptr, ScreenHandler.MeshLevel,nullptr), VPHELPER(VP_MESH_LEVEL_POINT,nullptr, ScreenHandler.MeshLevel,nullptr),
#if ENABLED(PREVENT_COLD_EXTRUSION)
VPHELPER(VP_Min_EX_T_E, &thermalManager.extrude_min_temp, &ScreenHandler.GetMinExtrudeTemp, &ScreenHandler.DGUSLCD_SendWordValueToDisplay), VPHELPER(VP_Min_EX_T_E, &thermalManager.extrude_min_temp, &ScreenHandler.GetMinExtrudeTemp, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#endif
VPHELPER(VP_AutoTurnOffSw, nullptr, &ScreenHandler.GetTurnOffCtrl, nullptr), VPHELPER(VP_AutoTurnOffSw, nullptr, &ScreenHandler.GetTurnOffCtrl, nullptr),
#if HOTENDS >= 1 #if HOTENDS >= 1

View file

@ -342,7 +342,7 @@ void DGUSScreenHandler::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) {
void DGUSScreenHandler::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("GetMinExtrudeTemp"); DEBUG_ECHOLNPGM("GetMinExtrudeTemp");
const uint16_t value = swap16(*(uint16_t *)val_ptr); const uint16_t value = swap16(*(uint16_t *)val_ptr);
thermalManager.extrude_min_temp = value; TERN_(PREVENT_COLD_EXTRUSION, thermalManager.extrude_min_temp = value);
mks_min_extrusion_temp = value; mks_min_extrusion_temp = value;
settings.save(); settings.save();
} }
@ -1083,11 +1083,13 @@ void DGUSScreenHandler::HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
} }
void DGUSScreenHandler::HandleGetExMinTemp_MKS(DGUS_VP_Variable &var, void *val_ptr) { #if ENABLED(PREVENT_COLD_EXTRUSION)
void DGUSScreenHandler::HandleGetExMinTemp_MKS(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t value_ex_min_temp = swap16(*(uint16_t*)val_ptr); const uint16_t value_ex_min_temp = swap16(*(uint16_t*)val_ptr);
thermalManager.extrude_min_temp = value_ex_min_temp; thermalManager.extrude_min_temp = value_ex_min_temp;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
} }
#endif
#if HAS_PID_HEATING #if HAS_PID_HEATING
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
@ -1231,7 +1233,7 @@ void DGUSScreenHandler::MKS_FilamentLoadUnload(DGUS_VP_Variable &var, void *val_
break; break;
} }
#if HAS_HOTEND #if BOTH(HAS_HOTEND, PREVENT_COLD_EXTRUSION)
if (hotend_too_cold) { if (hotend_too_cold) {
if (thermalManager.targetTooColdToExtrude(hotend_too_cold - 1)) thermalManager.setTargetHotend(thermalManager.extrude_min_temp, hotend_too_cold - 1); if (thermalManager.targetTooColdToExtrude(hotend_too_cold - 1)) thermalManager.setTargetHotend(thermalManager.extrude_min_temp, hotend_too_cold - 1);
sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true); sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please wait."), PSTR("Nozzle heating!"), true, true, true, true);
@ -1428,8 +1430,10 @@ bool DGUSScreenHandler::loop() {
#endif #endif
#endif #endif
#if ENABLED(PREVENT_COLD_EXTRUSION)
if (mks_min_extrusion_temp != 0) if (mks_min_extrusion_temp != 0)
thermalManager.extrude_min_temp = mks_min_extrusion_temp; thermalManager.extrude_min_temp = mks_min_extrusion_temp;
#endif
DGUS_ExtrudeLoadInit(); DGUS_ExtrudeLoadInit();

View file

@ -82,7 +82,9 @@ public:
static void GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr); static void GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr);
static void GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr); static void GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr);
static void GetParkPos_MKS(DGUS_VP_Variable &var, void *val_ptr); static void GetParkPos_MKS(DGUS_VP_Variable &var, void *val_ptr);
#if ENABLED(PREVENT_COLD_EXTRUSION)
static void HandleGetExMinTemp_MKS(DGUS_VP_Variable &var, void *val_ptr); static void HandleGetExMinTemp_MKS(DGUS_VP_Variable &var, void *val_ptr);
#endif
static void DGUS_LanguageDisplay(uint8_t var); static void DGUS_LanguageDisplay(uint8_t var);
static void TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr); static void TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr);
static void GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr); static void GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr);