Skip to content

Commit 489ef6e

Browse files
thinkyheadellensp
andcommitted
🩹 Simple IA-Creality babystep patch
See #26896 (comment) Co-Authored-By: ellensp <530024+ellensp@users.noreply.github.com>
1 parent cecc745 commit 489ef6e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ void RTS::handleData() {
793793
tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100;
794794
else
795795
tmp_zprobe_offset = float(recdat.data[0]) / 100;
796-
if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
796+
if (WITHIN(tmp_zprobe_offset, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
797797
int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z));
798798
if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1;
799799
smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false);

Marlin/src/lcd/tft/ui_common.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,16 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
7171
}
7272
#endif
7373

74-
const float diff = motionAxisState.currentStepSize * direction;
74+
float diff = motionAxisState.currentStepSize * direction;
7575

7676
#if HAS_BED_PROBE
7777

7878
if (axis == Z_AXIS && motionAxisState.z_selection == Z_SELECTION_Z_PROBE) {
79+
7980
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
81+
82+
diff = 0;
83+
8084
const int16_t babystep_increment = direction * BABYSTEP_SIZE_Z;
8185
const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
8286
const float bsDiff = planner.mm_per_step[Z_AXIS] * babystep_increment,
@@ -97,7 +101,8 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
97101
else
98102
drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
99103

100-
#else
104+
#else // !BABYSTEP_ZPROBE_OFFSET
105+
101106
// Only change probe.offset.z
102107
probe.offset.z += diff;
103108
if (direction < 0 && current_position.z < PROBE_OFFSET_ZMIN) {
@@ -112,7 +117,8 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
112117
drawMessage_P(NUL_STR); // Clear the error
113118

114119
drawAxisValue(axis);
115-
#endif
120+
121+
#endif // !BABYSTEP_ZPROBE_OFFSET
116122
}
117123

118124
#endif // HAS_BED_PROBE

0 commit comments

Comments
 (0)