mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-01 18:32:37 +02:00
setAttr() was discarding attributes from YAML
This commit is contained in:
@@ -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.
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user