1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-30 17:49:56 +02:00

Better solution to no_pin reporting.

This commit is contained in:
Mitch Bradley
2021-06-29 10:51:54 -10:00
parent 0ff2304992
commit d15ca365ab
3 changed files with 5 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ void IRAM_ATTR ControlPin::handleISR() {
}
void ControlPin::init() {
if (_pin.undefined() || _pin.name() == "NO_PIN") {
if (_pin.undefined()) {
return;
}
_pin.report(_legend);
@@ -23,11 +23,7 @@ void ControlPin::init() {
}
void ControlPin::report(char* status) {
if (_pin.undefined()) {
return;
}
if (_pin.read()) {
if (get()) {
addPinReport(status, _letter);
}
}

View File

@@ -117,7 +117,7 @@ const char* Pin::parse(StringRange tmp, Pins::PinDetail*& pinImplementation) {
}
#endif
if (prefix == "no_pin") {
pinImplementation = new Pins::VoidPinDetail();
pinImplementation = undefinedPin;
}
if (prefix == "void") {

View File

@@ -23,7 +23,7 @@
namespace UserOutput {
DigitalOutput::DigitalOutput(uint8_t number, Pin& pin) : _number(number), _pin(pin) {
if (_pin.undefined() || _pin.name() == "NO_PIN") {
if (_pin.undefined()) {
return;
}
init();
@@ -50,7 +50,7 @@ namespace UserOutput {
// ==================================================================
AnalogOutput::AnalogOutput(uint8_t number, Pin& pin, float pwm_frequency) : _number(number), _pin(pin), _pwm_frequency(pwm_frequency) {
if (_pin.undefined() || _pin.name() == "NO_PIN") {
if (_pin.undefined()) {
return;
}