This includes:
- Initialize them in mendel.c.
- While running, switch the pin only.
- Sort mendel.c the same order as in pinio.h.
- Remove the requirement of a parameter for this flag, like
it's with all other flags.
To INVERT an endstop, #define X_INVERT_MIN etc.
To leave it uninverted, define nothing, i.e. comment the #define out.
Probably, this change should be extended to INVERT_DIR and
INVERT_ENABLE, too.
The problem was, preprocessor flags are usually set with a simple
"#define X_INVERT_MIN", so X_INVERT_MIN is defined, but of
arbitrary value. Applies to other axes and INVERT_MAX also,
of course.
Initially, it was planned to allow "#define X_INVERT_MIN" as well
as "#define X_INVERT_MIN 0" but that turned out to be _really_
complex. See http://www.velocityreviews.com/forums/t720190-test-of-a-preprocessor-symbol-defined-as-nothing-vs-zero.html .
For curiosity, I've ported this to our purposes, debug messages
left in place:
#ifdef X_INVERT_MAX
#if CAT(1,X_INVERT_MAX) == 1
#warning "X enabled, inverted"
#define x_max() (READ(X_MAX_PIN)?0:1)
#elif X_INVERT_MAX
#warning "X enabled, inverted"
#define x_max() (READ(X_MAX_PIN)?0:1)
#else
#warning "X enabled, uninverted"
#define x_max() (READ(X_MAX_PIN)?1:0)
#endif
#else
#warning "X enabled, uninverted"
#define x_max() (READ(X_MAX_PIN)?1:0)
#endif
#warning "X disabled"
#define x_max() (0)