diff --git a/Grbl_Esp32/src/Config.h b/Grbl_Esp32/src/Config.h index fbf7ad86..250ff3c8 100644 --- a/Grbl_Esp32/src/Config.h +++ b/Grbl_Esp32/src/Config.h @@ -266,23 +266,6 @@ const int ACCELERATION_TICKS_PER_SECOND = 100; // NOTE: For now disabled, will enable if flash space permits. // #define MAX_STEP_RATE_HZ 30000 // Hz -// By default, Grbl sets all input pins to normal-high operation with their internal pull-up resistors -// enabled. This simplifies the wiring for users by requiring only a switch connected to ground, -// although its recommended that users take the extra step of wiring in low-pass filter to reduce -// electrical noise detected by the pin. If the user inverts the pin in Grbl settings, this just flips -// which high or low reading indicates an active signal. In normal operation, this means the user -// needs to connect a normal-open switch, but if inverted, this means the user should connect a -// normal-closed switch. -// The following options disable the internal pull-up resistors, sets the pins to a normal-low -// operation, and switches must be now connect to Vcc instead of ground. This also flips the meaning -// of the invert pin Grbl setting, where an inverted setting now means the user should connect a -// normal-open switch and vice versa. -// NOTE: All pins associated with the feature are disabled, i.e. XYZ limit pins, not individual axes. -// WARNING: When the pull-ups are disabled, this requires additional wiring with pull-down resistors! -//#define DISABLE_LIMIT_PIN_PULL_UP -//#define DISABLE_PROBE_PIN_PULL_UP -//#define DISABLE_CONTROL_PIN_PULL_UP - // Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with // the selected axis with the tool oriented toward the negative direction. In other words, a positive // tool length offset value is subtracted from the current location. diff --git a/Grbl_Esp32/src/Limits.cpp b/Grbl_Esp32/src/Limits.cpp index 4957a09c..584f2598 100644 --- a/Grbl_Esp32/src/Limits.cpp +++ b/Grbl_Esp32/src/Limits.cpp @@ -304,12 +304,6 @@ void limits_init() { if (gangConfig->_endstops != nullptr && gangConfig->_endstops->_dual.defined()) { Pin& pin = gangConfig->_endstops->_dual; -#ifndef DISABLE_LIMIT_PIN_PULL_UP - if (pin.capabilities().has(Pins::PinCapabilities::PullUp)) { - mode = mode | Pin::Attr::PullUp; - } -#endif - pin.setAttr(mode); bitnum_true(limit_mask, axis); if (gangConfig->_endstops->_hardLimits) { diff --git a/Grbl_Esp32/src/Pins/GPIOPinDetail.cpp b/Grbl_Esp32/src/Pins/GPIOPinDetail.cpp index a0ef067a..379df6dd 100644 --- a/Grbl_Esp32/src/Pins/GPIOPinDetail.cpp +++ b/Grbl_Esp32/src/Pins/GPIOPinDetail.cpp @@ -148,7 +148,7 @@ namespace Pins { Assert(!_attributes.conflictsWith(value) || _index == 1 || _index == 3, "Attributes on this pin have been set before, and there's a conflict."); - _attributes = value; + _attributes = _attributes | value; // Handle attributes: uint8_t pinModeValue = 0; diff --git a/Grbl_Esp32/src/Probe.cpp b/Grbl_Esp32/src/Probe.cpp index 1471880d..e81e82f5 100644 --- a/Grbl_Esp32/src/Probe.cpp +++ b/Grbl_Esp32/src/Probe.cpp @@ -30,16 +30,14 @@ void Probe::init() { static bool show_init_msg = true; // used to show message only once. - if (!_probePin.undefined()) { -#ifdef DISABLE_PROBE_PIN_PULL_UP - _probePin.setAttr(Pin::Attr::Input); -#else + if (_probePin.defined()) { if (_probePin.capabilities().has(Pins::PinCapabilities::PullUp)) { + // XXX Do we really want to default this instead of letting + // YAML control it explicitly _probePin.setAttr(Pin::Attr::Input | Pin::Attr::PullUp); // Enable internal pull-up resistors. Normal high operation. } else { _probePin.setAttr(Pin::Attr::Input); } -#endif if (show_init_msg) { grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Probe on pin %s", _probePin.name().c_str());