X_SENSORLESS includes AXIS_HAS_STALLGUARD
This commit is contained in:
parent
e3fd0519b3
commit
806d64e1bf
@ -977,7 +977,10 @@
|
|||||||
#define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_STALL_SENSITIVITY))
|
#define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_STALL_SENSITIVITY))
|
||||||
#define X2_SENSORLESS (AXIS_HAS_STALLGUARD(X2) && defined(X2_STALL_SENSITIVITY))
|
#define X2_SENSORLESS (AXIS_HAS_STALLGUARD(X2) && defined(X2_STALL_SENSITIVITY))
|
||||||
#define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_STALL_SENSITIVITY))
|
#define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_STALL_SENSITIVITY))
|
||||||
|
#define Y2_SENSORLESS (AXIS_HAS_STALLGUARD(Y2) && defined(Y2_STALL_SENSITIVITY))
|
||||||
#define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY))
|
#define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY))
|
||||||
|
#define Z2_SENSORLESS (AXIS_HAS_STALLGUARD(Z2) && defined(Z2_STALL_SENSITIVITY))
|
||||||
|
#define Z3_SENSORLESS (AXIS_HAS_STALLGUARD(Z3) && defined(Z3_STALL_SENSITIVITY))
|
||||||
#if ENABLED(SPI_ENDSTOPS)
|
#if ENABLED(SPI_ENDSTOPS)
|
||||||
#define X_SPI_SENSORLESS X_SENSORLESS
|
#define X_SPI_SENSORLESS X_SENSORLESS
|
||||||
#define Y_SPI_SENSORLESS Y_SENSORLESS
|
#define Y_SPI_SENSORLESS Y_SENSORLESS
|
||||||
|
@ -35,21 +35,21 @@ void StepperBumpSensitivityScreen::onRedraw(draw_mode_t what) {
|
|||||||
w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST);
|
w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST);
|
||||||
w.heading( GET_TEXTF(HOME_SENSE));
|
w.heading( GET_TEXTF(HOME_SENSE));
|
||||||
w.color(x_axis) .adjuster( 2, GET_TEXTF(AXIS_X), getTMCBumpSensitivity(X),
|
w.color(x_axis) .adjuster( 2, GET_TEXTF(AXIS_X), getTMCBumpSensitivity(X),
|
||||||
#if X_SENSORLESS && AXIS_HAS_STALLGUARD(X)
|
#if X_SENSORLESS
|
||||||
true
|
true
|
||||||
#else
|
#else
|
||||||
false
|
false
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
w.color(y_axis) .adjuster( 4, GET_TEXTF(AXIS_Y), getTMCBumpSensitivity(Y),
|
w.color(y_axis) .adjuster( 4, GET_TEXTF(AXIS_Y), getTMCBumpSensitivity(Y),
|
||||||
#if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y)
|
#if Y_SENSORLESS
|
||||||
true
|
true
|
||||||
#else
|
#else
|
||||||
false
|
false
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
w.color(z_axis) .adjuster( 6, GET_TEXTF(AXIS_Z), getTMCBumpSensitivity(Z),
|
w.color(z_axis) .adjuster( 6, GET_TEXTF(AXIS_Z), getTMCBumpSensitivity(Z),
|
||||||
#if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z)
|
#if Z_SENSORLESS
|
||||||
true
|
true
|
||||||
#else
|
#else
|
||||||
false
|
false
|
||||||
|
@ -516,13 +516,13 @@ namespace ExtUI {
|
|||||||
|
|
||||||
int getTMCBumpSensitivity(const axis_t axis) {
|
int getTMCBumpSensitivity(const axis_t axis) {
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
#if X_SENSORLESS && AXIS_HAS_STALLGUARD(X)
|
#if X_SENSORLESS
|
||||||
case X: return stepperX.homing_threshold();
|
case X: return stepperX.homing_threshold();
|
||||||
#endif
|
#endif
|
||||||
#if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y)
|
#if Y_SENSORLESS
|
||||||
case Y: return stepperY.homing_threshold();
|
case Y: return stepperY.homing_threshold();
|
||||||
#endif
|
#endif
|
||||||
#if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z)
|
#if Z_SENSORLESS
|
||||||
case Z: return stepperZ.homing_threshold();
|
case Z: return stepperZ.homing_threshold();
|
||||||
#endif
|
#endif
|
||||||
default: return 0;
|
default: return 0;
|
||||||
@ -531,18 +531,16 @@ namespace ExtUI {
|
|||||||
|
|
||||||
void setTMCBumpSensitivity(const float value, const axis_t axis) {
|
void setTMCBumpSensitivity(const float value, const axis_t axis) {
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
#if X_SENSORLESS && AXIS_HAS_STALLGUARD(X)
|
#if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
|
||||||
case X: stepperX.homing_threshold(value); break;
|
#if X_SENSORLESS
|
||||||
#else
|
case X: stepperX.homing_threshold(value); break;
|
||||||
UNUSED(value);
|
#endif
|
||||||
#endif
|
#if Y_SENSORLESS
|
||||||
#if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y)
|
case Y: stepperY.homing_threshold(value); break;
|
||||||
case Y: stepperY.homing_threshold(value); break;
|
#endif
|
||||||
#else
|
#if Z_SENSORLESS
|
||||||
UNUSED(value);
|
case Z: stepperZ.homing_threshold(value); break;
|
||||||
#endif
|
#endif
|
||||||
#if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z)
|
|
||||||
case Z: stepperZ.homing_threshold(value); break;
|
|
||||||
#else
|
#else
|
||||||
UNUSED(value);
|
UNUSED(value);
|
||||||
#endif
|
#endif
|
||||||
|
@ -3246,27 +3246,23 @@ void MarlinSettings::reset() {
|
|||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HAS_X2_SENSORLESS (defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2))
|
#if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS
|
||||||
#define HAS_Y2_SENSORLESS (defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2))
|
|
||||||
#define HAS_Z2_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2))
|
|
||||||
#define HAS_Z3_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3))
|
|
||||||
#if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS
|
|
||||||
CONFIG_ECHO_START();
|
CONFIG_ECHO_START();
|
||||||
say_M914();
|
say_M914();
|
||||||
SERIAL_ECHOPGM(" I1");
|
SERIAL_ECHOPGM(" I1");
|
||||||
#if HAS_X2_SENSORLESS
|
#if X2_SENSORLESS
|
||||||
SERIAL_ECHOPAIR(" X", stepperX2.homing_threshold());
|
SERIAL_ECHOPAIR(" X", stepperX2.homing_threshold());
|
||||||
#endif
|
#endif
|
||||||
#if HAS_Y2_SENSORLESS
|
#if Y2_SENSORLESS
|
||||||
SERIAL_ECHOPAIR(" Y", stepperY2.homing_threshold());
|
SERIAL_ECHOPAIR(" Y", stepperY2.homing_threshold());
|
||||||
#endif
|
#endif
|
||||||
#if HAS_Z2_SENSORLESS
|
#if Z2_SENSORLESS
|
||||||
SERIAL_ECHOPAIR(" Z", stepperZ2.homing_threshold());
|
SERIAL_ECHOPAIR(" Z", stepperZ2.homing_threshold());
|
||||||
#endif
|
#endif
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_Z3_SENSORLESS
|
#if Z3_SENSORLESS
|
||||||
CONFIG_ECHO_START();
|
CONFIG_ECHO_START();
|
||||||
say_M914();
|
say_M914();
|
||||||
SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold());
|
SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold());
|
||||||
|
Loading…
Reference in New Issue
Block a user