|
@ -47,6 +47,7 @@ |
|
|
|
|
|
|
|
|
#include "../marlinui.h" |
|
|
#include "../marlinui.h" |
|
|
#include "../../gcode/queue.h" |
|
|
#include "../../gcode/queue.h" |
|
|
|
|
|
#include "../../gcode/gcode.h" |
|
|
#include "../../module/motion.h" |
|
|
#include "../../module/motion.h" |
|
|
#include "../../module/planner.h" |
|
|
#include "../../module/planner.h" |
|
|
#include "../../module/probe.h" |
|
|
#include "../../module/probe.h" |
|
@ -353,14 +354,9 @@ namespace ExtUI { |
|
|
|
|
|
|
|
|
extruder_t getTool(const uint8_t extruder) { |
|
|
extruder_t getTool(const uint8_t extruder) { |
|
|
switch (extruder) { |
|
|
switch (extruder) { |
|
|
case 7: return E7; |
|
|
default: |
|
|
case 6: return E6; |
|
|
case 0: return E0; case 1: return E1; case 2: return E2; case 3: return E3; |
|
|
case 5: return E5; |
|
|
case 4: return E4; case 5: return E5; case 6: return E6; case 7: return E7; |
|
|
case 4: return E4; |
|
|
|
|
|
case 3: return E3; |
|
|
|
|
|
case 2: return E2; |
|
|
|
|
|
case 1: return E1; |
|
|
|
|
|
default: return E0; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -372,8 +368,8 @@ namespace ExtUI { |
|
|
switch (axis) { |
|
|
switch (axis) { |
|
|
#if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) |
|
|
#if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) |
|
|
case X: return axis_should_home(X_AXIS); |
|
|
case X: return axis_should_home(X_AXIS); |
|
|
case Y: return axis_should_home(Y_AXIS); |
|
|
OPTCODE(HAS_Y_AXIS, case Y: return axis_should_home(Y_AXIS)) |
|
|
case Z: return axis_should_home(Z_AXIS); |
|
|
OPTCODE(HAS_Z_AXIS, case Z: return axis_should_home(Z_AXIS)) |
|
|
#else |
|
|
#else |
|
|
case X: case Y: case Z: return true; |
|
|
case X: case Y: case Z: return true; |
|
|
#endif |
|
|
#endif |
|
@ -385,6 +381,8 @@ namespace ExtUI { |
|
|
return !thermalManager.tooColdToExtrude(extruder - E0); |
|
|
return !thermalManager.tooColdToExtrude(extruder - E0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GcodeSuite::MarlinBusyState getMachineBusyState() { return TERN0(HOST_KEEPALIVE_FEATURE, GcodeSuite::busy_state); } |
|
|
|
|
|
|
|
|
#if HAS_SOFTWARE_ENDSTOPS |
|
|
#if HAS_SOFTWARE_ENDSTOPS |
|
|
bool getSoftEndstopState() { return soft_endstop._enabled; } |
|
|
bool getSoftEndstopState() { return soft_endstop._enabled; } |
|
|
void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; } |
|
|
void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; } |
|
@ -396,18 +394,27 @@ namespace ExtUI { |
|
|
#if AXIS_IS_TMC(X) |
|
|
#if AXIS_IS_TMC(X) |
|
|
case X: return stepperX.getMilliamps(); |
|
|
case X: return stepperX.getMilliamps(); |
|
|
#endif |
|
|
#endif |
|
|
#if AXIS_IS_TMC(X2) |
|
|
|
|
|
case X2: return stepperX2.getMilliamps(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(Y) |
|
|
#if AXIS_IS_TMC(Y) |
|
|
case Y: return stepperY.getMilliamps(); |
|
|
case Y: return stepperY.getMilliamps(); |
|
|
#endif |
|
|
#endif |
|
|
#if AXIS_IS_TMC(Y2) |
|
|
|
|
|
case Y2: return stepperY2.getMilliamps(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(Z) |
|
|
#if AXIS_IS_TMC(Z) |
|
|
case Z: return stepperZ.getMilliamps(); |
|
|
case Z: return stepperZ.getMilliamps(); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(I) |
|
|
|
|
|
case I: return stepperI.getMilliamps(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(J) |
|
|
|
|
|
case J: return stepperJ.getMilliamps(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(K) |
|
|
|
|
|
case K: return stepperK.getMilliamps(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(X2) |
|
|
|
|
|
case X2: return stepperX2.getMilliamps(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(Y2) |
|
|
|
|
|
case Y2: return stepperY2.getMilliamps(); |
|
|
|
|
|
#endif |
|
|
#if AXIS_IS_TMC(Z2) |
|
|
#if AXIS_IS_TMC(Z2) |
|
|
case Z2: return stepperZ2.getMilliamps(); |
|
|
case Z2: return stepperZ2.getMilliamps(); |
|
|
#endif |
|
|
#endif |
|
@ -450,18 +457,27 @@ namespace ExtUI { |
|
|
#if AXIS_IS_TMC(X) |
|
|
#if AXIS_IS_TMC(X) |
|
|
case X: stepperX.rms_current(constrain(mA, 400, 1500)); break; |
|
|
case X: stepperX.rms_current(constrain(mA, 400, 1500)); break; |
|
|
#endif |
|
|
#endif |
|
|
#if AXIS_IS_TMC(X2) |
|
|
|
|
|
case X2: stepperX2.rms_current(constrain(mA, 400, 1500)); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(Y) |
|
|
#if AXIS_IS_TMC(Y) |
|
|
case Y: stepperY.rms_current(constrain(mA, 400, 1500)); break; |
|
|
case Y: stepperY.rms_current(constrain(mA, 400, 1500)); break; |
|
|
#endif |
|
|
#endif |
|
|
#if AXIS_IS_TMC(Y2) |
|
|
|
|
|
case Y2: stepperY2.rms_current(constrain(mA, 400, 1500)); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(Z) |
|
|
#if AXIS_IS_TMC(Z) |
|
|
case Z: stepperZ.rms_current(constrain(mA, 400, 1500)); break; |
|
|
case Z: stepperZ.rms_current(constrain(mA, 400, 1500)); break; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(I) |
|
|
|
|
|
case I: stepperI.rms_current(constrain(mA, 400, 1500)); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(J) |
|
|
|
|
|
case J: stepperJ.rms_current(constrain(mA, 400, 1500)); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(K) |
|
|
|
|
|
case K: stepperK.rms_current(constrain(mA, 400, 1500)); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(X2) |
|
|
|
|
|
case X2: stepperX2.rms_current(constrain(mA, 400, 1500)); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if AXIS_IS_TMC(Y2) |
|
|
|
|
|
case Y2: stepperY2.rms_current(constrain(mA, 400, 1500)); break; |
|
|
|
|
|
#endif |
|
|
#if AXIS_IS_TMC(Z2) |
|
|
#if AXIS_IS_TMC(Z2) |
|
|
case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break; |
|
|
case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break; |
|
|
#endif |
|
|
#endif |
|
@ -501,66 +517,59 @@ namespace ExtUI { |
|
|
|
|
|
|
|
|
int getTMCBumpSensitivity(const axis_t axis) { |
|
|
int getTMCBumpSensitivity(const axis_t axis) { |
|
|
switch (axis) { |
|
|
switch (axis) { |
|
|
#if ENABLED(X_SENSORLESS) |
|
|
OPTCODE(X_SENSORLESS, case X: return stepperX.homing_threshold()) |
|
|
case X: return stepperX.homing_threshold(); |
|
|
OPTCODE(Y_SENSORLESS, case Y: return stepperY.homing_threshold()) |
|
|
|
|
|
OPTCODE(Z_SENSORLESS, case Z: return stepperZ.homing_threshold()) |
|
|
|
|
|
OPTCODE(I_SENSORLESS, case I: return stepperI.homing_threshold()) |
|
|
|
|
|
OPTCODE(J_SENSORLESS, case J: return stepperJ.homing_threshold()) |
|
|
|
|
|
OPTCODE(K_SENSORLESS, case K: return stepperK.homing_threshold()) |
|
|
|
|
|
OPTCODE(X2_SENSORLESS, case X2: return stepperX2.homing_threshold()) |
|
|
|
|
|
OPTCODE(Y2_SENSORLESS, case Y2: return stepperY2.homing_threshold()) |
|
|
|
|
|
OPTCODE(Z2_SENSORLESS, case Z2: return stepperZ2.homing_threshold()) |
|
|
|
|
|
OPTCODE(Z3_SENSORLESS, case Z3: return stepperZ3.homing_threshold()) |
|
|
|
|
|
OPTCODE(Z4_SENSORLESS, case Z4: return stepperZ4.homing_threshold()) |
|
|
|
|
|
default: return 0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void setTMCBumpSensitivity(const_float_t value, const axis_t axis) { |
|
|
|
|
|
switch (axis) { |
|
|
|
|
|
#if X_SENSORLESS |
|
|
|
|
|
case X: stepperX.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(X2_SENSORLESS) |
|
|
#if Y_SENSORLESS |
|
|
case X2: return stepperX2.homing_threshold(); |
|
|
case Y: stepperY.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(Y_SENSORLESS) |
|
|
#if Z_SENSORLESS |
|
|
case Y: return stepperY.homing_threshold(); |
|
|
case Z: stepperZ.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(Y2_SENSORLESS) |
|
|
#if I_SENSORLESS |
|
|
case Y2: return stepperY2.homing_threshold(); |
|
|
case I: stepperI.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(Z_SENSORLESS) |
|
|
#if J_SENSORLESS |
|
|
case Z: return stepperZ.homing_threshold(); |
|
|
case J: stepperJ.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(Z2_SENSORLESS) |
|
|
#if K_SENSORLESS |
|
|
case Z2: return stepperZ2.homing_threshold(); |
|
|
case K: stepperK.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(Z3_SENSORLESS) |
|
|
#if X2_SENSORLESS |
|
|
case Z3: return stepperZ3.homing_threshold(); |
|
|
case X2: stepperX2.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(Z4_SENSORLESS) |
|
|
#if Y2_SENSORLESS |
|
|
case Z4: return stepperZ4.homing_threshold(); |
|
|
case Y2: stepperY2.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
default: return 0; |
|
|
#if Z2_SENSORLESS |
|
|
} |
|
|
case Z2: stepperZ2.homing_threshold(value); break; |
|
|
} |
|
|
#endif |
|
|
|
|
|
#if Z3_SENSORLESS |
|
|
void setTMCBumpSensitivity(const_float_t value, const axis_t axis) { |
|
|
case Z3: stepperZ3.homing_threshold(value); break; |
|
|
switch (axis) { |
|
|
#endif |
|
|
#if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS |
|
|
#if Z4_SENSORLESS |
|
|
#if X_SENSORLESS |
|
|
case Z4: stepperZ4.homing_threshold(value); break; |
|
|
case X: stepperX.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if X2_SENSORLESS |
|
|
|
|
|
case X2: stepperX2.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Y_SENSORLESS |
|
|
|
|
|
case Y: stepperY.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Y2_SENSORLESS |
|
|
|
|
|
case Y2: stepperY2.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Z_SENSORLESS |
|
|
|
|
|
case Z: stepperZ.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Z2_SENSORLESS |
|
|
|
|
|
case Z2: stepperZ2.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Z3_SENSORLESS |
|
|
|
|
|
case Z3: stepperZ3.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Z4_SENSORLESS |
|
|
|
|
|
case Z4: stepperZ4.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#else |
|
|
|
|
|
UNUSED(value); |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
default: break; |
|
|
default: break; |
|
|
} |
|
|
} |
|
|
|
|
|
UNUSED(value); |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
@ -661,9 +670,7 @@ namespace ExtUI { |
|
|
|
|
|
|
|
|
#if HAS_JUNCTION_DEVIATION |
|
|
#if HAS_JUNCTION_DEVIATION |
|
|
|
|
|
|
|
|
float getJunctionDeviation_mm() { |
|
|
float getJunctionDeviation_mm() { return planner.junction_deviation_mm; } |
|
|
return planner.junction_deviation_mm; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void setJunctionDeviation_mm(const_float_t value) { |
|
|
void setJunctionDeviation_mm(const_float_t value) { |
|
|
planner.junction_deviation_mm = constrain(value, 0.001, 0.3); |
|
|
planner.junction_deviation_mm = constrain(value, 0.001, 0.3); |
|
@ -682,7 +689,7 @@ namespace ExtUI { |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if PREHEAT_COUNT |
|
|
#if PREHEAT_COUNT |
|
|
uint16_t getMaterial_preset_E(const uint16_t index) { return ui.material_preset[index].hotend_temp; } |
|
|
uint16_t getMaterial_preset_E(const uint16_t index) { return ui.material_preset[index].hotend_temp; } |
|
|
#if HAS_HEATED_BED |
|
|
#if HAS_HEATED_BED |
|
|
uint16_t getMaterial_preset_B(const uint16_t index) { return ui.material_preset[index].bed_temp; } |
|
|
uint16_t getMaterial_preset_B(const uint16_t index) { return ui.material_preset[index].bed_temp; } |
|
|
#endif |
|
|
#endif |
|
@ -709,9 +716,13 @@ namespace ExtUI { |
|
|
switch (axis) { |
|
|
switch (axis) { |
|
|
#if ENABLED(BABYSTEP_XY) |
|
|
#if ENABLED(BABYSTEP_XY) |
|
|
case X: babystep.add_steps(X_AXIS, steps); break; |
|
|
case X: babystep.add_steps(X_AXIS, steps); break; |
|
|
case Y: babystep.add_steps(Y_AXIS, steps); break; |
|
|
#if HAS_Y_AXIS |
|
|
|
|
|
case Y: babystep.add_steps(Y_AXIS, steps); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|
|
|
#if HAS_Z_AXIS |
|
|
|
|
|
case Z: babystep.add_steps(Z_AXIS, steps); break; |
|
|
#endif |
|
|
#endif |
|
|
case Z: babystep.add_steps(Z_AXIS, steps); break; |
|
|
|
|
|
default: return false; |
|
|
default: return false; |
|
|
}; |
|
|
}; |
|
|
return true; |
|
|
return true; |
|
@ -750,8 +761,8 @@ namespace ExtUI { |
|
|
hotend_offset[e][axis] += mm; |
|
|
hotend_offset[e][axis] += mm; |
|
|
|
|
|
|
|
|
normalizeNozzleOffset(X); |
|
|
normalizeNozzleOffset(X); |
|
|
normalizeNozzleOffset(Y); |
|
|
TERN_(HAS_Y_AXIS, normalizeNozzleOffset(Y)); |
|
|
normalizeNozzleOffset(Z); |
|
|
TERN_(HAS_Z_AXIS, normalizeNozzleOffset(Z)); |
|
|
} |
|
|
} |
|
|
#else |
|
|
#else |
|
|
UNUSED(linked_nozzles); |
|
|
UNUSED(linked_nozzles); |
|
@ -1014,8 +1025,7 @@ namespace ExtUI { |
|
|
TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); |
|
|
TERN_(HAS_FAN, thermalManager.zero_fan_speeds()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool awaitingUserConfirm() { return wait_for_user; } |
|
|
bool awaitingUserConfirm() { return TERN0(HAS_RESUME_CONTINUE, wait_for_user); } |
|
|
|
|
|
|
|
|
void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); } |
|
|
void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); } |
|
|
|
|
|
|
|
|
void printFile(const char *filename) { |
|
|
void printFile(const char *filename) { |
|
@ -1038,9 +1048,9 @@ namespace ExtUI { |
|
|
|
|
|
|
|
|
bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED() && card.isMounted()); } |
|
|
bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED() && card.isMounted()); } |
|
|
|
|
|
|
|
|
void pausePrint() { ui.pause_print(); } |
|
|
void pausePrint() { ui.pause_print(); } |
|
|
void resumePrint() { ui.resume_print(); } |
|
|
void resumePrint() { ui.resume_print(); } |
|
|
void stopPrint() { ui.abort_print(); } |
|
|
void stopPrint() { ui.abort_print(); } |
|
|
|
|
|
|
|
|
void onUserConfirmRequired_P(PGM_P const pstr) { |
|
|
void onUserConfirmRequired_P(PGM_P const pstr) { |
|
|
char msg[strlen_P(pstr) + 1]; |
|
|
char msg[strlen_P(pstr) + 1]; |
|
|