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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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") {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user