mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-03-15 02:36:19 +00:00
🩹 Simple IA-Creality babystep patch
See https://github.com/MarlinFirmware/Marlin/issues/26896#issuecomment-2015630458 Co-Authored-By: ellensp <530024+ellensp@users.noreply.github.com>
This commit is contained in:
parent
cecc745844
commit
489ef6e5e1
2 changed files with 10 additions and 4 deletions
|
@ -793,7 +793,7 @@ void RTS::handleData() {
|
|||
tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100;
|
||||
else
|
||||
tmp_zprobe_offset = float(recdat.data[0]) / 100;
|
||||
if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
|
||||
if (WITHIN(tmp_zprobe_offset, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
|
||||
int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z));
|
||||
if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1;
|
||||
smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false);
|
||||
|
|
|
@ -71,12 +71,16 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
|
|||
}
|
||||
#endif
|
||||
|
||||
const float diff = motionAxisState.currentStepSize * direction;
|
||||
float diff = motionAxisState.currentStepSize * direction;
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
|
||||
if (axis == Z_AXIS && motionAxisState.z_selection == Z_SELECTION_Z_PROBE) {
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
|
||||
diff = 0;
|
||||
|
||||
const int16_t babystep_increment = direction * BABYSTEP_SIZE_Z;
|
||||
const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
|
||||
const float bsDiff = planner.mm_per_step[Z_AXIS] * babystep_increment,
|
||||
|
@ -97,7 +101,8 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
|
|||
else
|
||||
drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS));
|
||||
|
||||
#else
|
||||
#else // !BABYSTEP_ZPROBE_OFFSET
|
||||
|
||||
// Only change probe.offset.z
|
||||
probe.offset.z += diff;
|
||||
if (direction < 0 && current_position.z < PROBE_OFFSET_ZMIN) {
|
||||
|
@ -112,7 +117,8 @@ void moveAxis(const AxisEnum axis, const int8_t direction) {
|
|||
drawMessage_P(NUL_STR); // Clear the error
|
||||
|
||||
drawAxisValue(axis);
|
||||
#endif
|
||||
|
||||
#endif // !BABYSTEP_ZPROBE_OFFSET
|
||||
}
|
||||
|
||||
#endif // HAS_BED_PROBE
|
||||
|
|
Loading…
Add table
Reference in a new issue