🧑💻 Unify DIAG endstop pins aliasing #27839
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
In the distant past the presence of an endstop pin define was used to determine if the endstop was monitored, and later we added defines to indicate which endstop plugs were in use to preserve the needed endstop pin defines. We then refactored endstops and removed those defines, using configuration alone to determine whether endstop pins are needed, enabled, monitored, and reported.
Physical Endstop Pins
Endstop Pin Defines
Our ideal is to have all endstop pin defaults defined at the board level based on standard patterns:
#undef
so they can be used by name for other functions.It all makes for an interesting challenge to account for DIAG pins that may require a jumper, may include the E axes, on boards with variable numbers of exposed headers for wired endstops….
Most boards should aim to keep the labeled "MIN" and "MAX" pins on the board from flipping around —at the board pins definition level— because we need to consider future repurposing on top of the board's original intended use. For that it's good to have pin names match the silk-screen whenever possible.
Boards with DIAG pins are unique –some of them– in having DIAG route to pin labeled "MIN" when it could be either end. So there is no set MIN/MAX for either pin in that configuration. One is "STOP" and the other is –well– "OTHR" I suppose.
This PR aims to move redundant handling of DIAG aliases to
pins_postprocess.h
and to clarify how DIAG pins and other endstop pins are aliased in different endstop configurations. Boards that have DIAG pins routed to one pin can define the "*_OTHR_PIN
" and that will be automatically aliased to MIN/MAX (the other end of the axis).There are some boards (Einsy Retro) that pick different "OTHR" endstop pins depending on the homing direction, but this is not needed for most cases.
Overall the result is a simpler set of pin definitions in the board pins files, centralized definition of DIAG pin aliasing, and a stage for future standardization of this important facet.