1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-31 01:59:54 +02:00

fixed dual switches when inverted (#614)

* fixed dual switches when inverted

* Removed debug message
This commit is contained in:
bdring
2020-09-24 18:22:36 -05:00
committed by GitHub
parent c656a62d41
commit 1c12106869

View File

@@ -376,7 +376,10 @@ uint8_t limits_get_state() {
for (int gang_index = 0; gang_index < 2; gang_index++) {
uint8_t pin = limit_pins[axis][gang_index];
if (pin != UNDEFINED_PIN) {
pinMask |= (digitalRead(pin) << axis);
if (limit_invert->get())
pinMask |= (!digitalRead(pin) << axis);
else
pinMask |= (digitalRead(pin) << axis);
}
}
}
@@ -384,9 +387,6 @@ uint8_t limits_get_state() {
#ifdef INVERT_LIMIT_PIN_MASK // not normally used..unless you have both normal and inverted switches
pinMask ^= INVERT_LIMIT_PIN_MASK;
#endif
if (limit_invert->get()) {
pinMask ^= limit_mask;
}
return pinMask;
}