Made the double touch portion a conditional compile based on the
PROBE_DOUBLE_TOUCH flag.
==============================================
Bugfix
The current G38 only stopped a move if it involved the Z axis.
Moved all the G38 code to it's own section and put it where it would
always be executed no matter what axis was moving or if the endstop was
enabled.
Also added a comment to configuration_adv to alert the user the double
tap had to be turned on.
==============================================
Change G38 back to using Z_MIN_PROBE
There's no Z_MIN endstop if Z_DUAL_ENDSTOPS is enabled and you have them
set to the top of the gantry.
G38 started out as using the Z_MIN_PROBE pin. I don't remember why we
changed it to the Z_MIN endstop.
In the endstop testing section, add the "reverse" logic in addition to "normal" core handling.
In CoreXY/YZ/XZ steppers rotating the same direction gives X movement. Opposing directions produces Y movement.
In CoreYX/ZY/ZX this is reversed. Same = Y, Opposite = X.
----
Fixes the issue where the Y endstop was being checked when moving in the X direction, etc.
1) modified 3 code files
Marlin.h
Marlin_main.cpp
endstops.cpp
2) modified config files so I could test on my machine
Testing was done on an AzteegX3pro based machine.
The probe was hooked to the Z_MIN endstop.
My controller doesn't have a dedicated Z_PROBE input so I couldn't test
that functionality.
Verified that a large file (without any G38 commands) executed the same
before and after the changes.
Verified that the head moves as expected when G38.2 and G38.3 commands
are issued. Single & multiple axis moves were tested along with + and -
directions.
Code was added to the main ISR. In normal operation only one extra IF
statement is evaluated. I didn't notice any performance degradation
because of the added code.
The G38 commands are expected to be issued manually by the operator
during machine setup. The G38 commands wait until the machine is idle
before proceeding. That way the other commands are minimally impacted
by the extra ISR overhead when a G38 command is in the queue.
The G38 commands are very similar to the G28 commands except 1) only the
Z_PROBE is used and movement can be in the + or - direction.
See issue 4677 for a discussion on adding G38 commands to Marlin.
Feature request: add ability to use G38.2 command (CNC)
MarlinFirmware/Marlin#4677
Additional follow-up the PR #3631(Encapsulate Stepper, Planner, Endstops in singleton classes)
・Change from abort_on_endstop_hit to stepper.abort_on_endstop_hit in endstop.cpp, Marlin_main.cpp, and ultralcd.cpp
・Add include path to cardreader.h and temperature.h in endstop.cpp(for CardReader class and disable_all_heaters())
It fix compilation error when ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED and SDSUPPORT are enabled.
・Change from digipot_current() to stepper.digipot_current() in Marlin_main.cpp
・Change from digitalPotWrite() to stepper.digitalPotWrite() in Marlin_main.cpp
It fix compilation errors when HAS_DIGIPOTSS is enabled.
・Change from microstep_mode() to stepper.microstep_mode() in Marlin_main.cpp
・Change attribute of microstep_mode() from private to public in stepper.h
・Change from microstep_readings() to stepper.microstep_readings() in Marlin_main.cpp
・Change from microstep_ms() to stepper.microstep_ms() in Marlin_main.
It fix compilation errors when HAS_MICROSTEPS is enabled.