|
@ -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,52 +517,47 @@ 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()) |
|
|
#endif |
|
|
OPTCODE(Z_SENSORLESS, case Z: return stepperZ.homing_threshold()) |
|
|
#if ENABLED(X2_SENSORLESS) |
|
|
OPTCODE(I_SENSORLESS, case I: return stepperI.homing_threshold()) |
|
|
case X2: return stepperX2.homing_threshold(); |
|
|
OPTCODE(J_SENSORLESS, case J: return stepperJ.homing_threshold()) |
|
|
#endif |
|
|
OPTCODE(K_SENSORLESS, case K: return stepperK.homing_threshold()) |
|
|
#if ENABLED(Y_SENSORLESS) |
|
|
OPTCODE(X2_SENSORLESS, case X2: return stepperX2.homing_threshold()) |
|
|
case Y: return stepperY.homing_threshold(); |
|
|
OPTCODE(Y2_SENSORLESS, case Y2: return stepperY2.homing_threshold()) |
|
|
#endif |
|
|
OPTCODE(Z2_SENSORLESS, case Z2: return stepperZ2.homing_threshold()) |
|
|
#if ENABLED(Y2_SENSORLESS) |
|
|
OPTCODE(Z3_SENSORLESS, case Z3: return stepperZ3.homing_threshold()) |
|
|
case Y2: return stepperY2.homing_threshold(); |
|
|
OPTCODE(Z4_SENSORLESS, case Z4: return stepperZ4.homing_threshold()) |
|
|
#endif |
|
|
|
|
|
#if ENABLED(Z_SENSORLESS) |
|
|
|
|
|
case Z: return stepperZ.homing_threshold(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(Z2_SENSORLESS) |
|
|
|
|
|
case Z2: return stepperZ2.homing_threshold(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(Z3_SENSORLESS) |
|
|
|
|
|
case Z3: return stepperZ3.homing_threshold(); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(Z4_SENSORLESS) |
|
|
|
|
|
case Z4: return stepperZ4.homing_threshold(); |
|
|
|
|
|
#endif |
|
|
|
|
|
default: return 0; |
|
|
default: return 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void setTMCBumpSensitivity(const_float_t value, const axis_t axis) { |
|
|
void setTMCBumpSensitivity(const_float_t value, const axis_t axis) { |
|
|
switch (axis) { |
|
|
switch (axis) { |
|
|
#if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS |
|
|
|
|
|
#if X_SENSORLESS |
|
|
#if X_SENSORLESS |
|
|
case X: stepperX.homing_threshold(value); break; |
|
|
case X: stepperX.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if X2_SENSORLESS |
|
|
|
|
|
case X2: stepperX2.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Y_SENSORLESS |
|
|
#if Y_SENSORLESS |
|
|
case Y: stepperY.homing_threshold(value); break; |
|
|
case Y: stepperY.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#if Y2_SENSORLESS |
|
|
|
|
|
case Y2: stepperY2.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Z_SENSORLESS |
|
|
#if Z_SENSORLESS |
|
|
case Z: stepperZ.homing_threshold(value); break; |
|
|
case Z: stepperZ.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if I_SENSORLESS |
|
|
|
|
|
case I: stepperI.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if J_SENSORLESS |
|
|
|
|
|
case J: stepperJ.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if K_SENSORLESS |
|
|
|
|
|
case K: stepperK.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if X2_SENSORLESS |
|
|
|
|
|
case X2: stepperX2.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
|
|
|
#if Y2_SENSORLESS |
|
|
|
|
|
case Y2: stepperY2.homing_threshold(value); break; |
|
|
|
|
|
#endif |
|
|
#if Z2_SENSORLESS |
|
|
#if Z2_SENSORLESS |
|
|
case Z2: stepperZ2.homing_threshold(value); break; |
|
|
case Z2: stepperZ2.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
@ -556,11 +567,9 @@ namespace ExtUI { |
|
|
#if Z4_SENSORLESS |
|
|
#if Z4_SENSORLESS |
|
|
case Z4: stepperZ4.homing_threshold(value); break; |
|
|
case Z4: stepperZ4.homing_threshold(value); break; |
|
|
#endif |
|
|
#endif |
|
|
#else |
|
|
|
|
|
UNUSED(value); |
|
|
|
|
|
#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); |
|
@ -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; |
|
|
|
|
|
#if HAS_Y_AXIS |
|
|
case Y: babystep.add_steps(Y_AXIS, steps); break; |
|
|
case Y: babystep.add_steps(Y_AXIS, steps); break; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|
|
|
#if HAS_Z_AXIS |
|
|
case Z: babystep.add_steps(Z_AXIS, steps); break; |
|
|
case Z: babystep.add_steps(Z_AXIS, steps); break; |
|
|
|
|
|
#endif |
|
|
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) { |
|
|