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

User I/O array error

This commit is contained in:
bdring
2020-09-15 11:42:43 -05:00
parent adec46c753
commit d697d8d26f
2 changed files with 7 additions and 4 deletions

View File

@@ -97,9 +97,9 @@ void system_ini() { // Renamed from system_init() due to conflict with esp32 fi
// Setup M62,M63,M64,M65 pins
myDigitalOutputs[0] = new UserOutput::DigitalOutput(0, USER_DIGITAL_PIN_0);
myDigitalOutputs[0] = new UserOutput::DigitalOutput(1, USER_DIGITAL_PIN_1);
myDigitalOutputs[0] = new UserOutput::DigitalOutput(2, USER_DIGITAL_PIN_2);
myDigitalOutputs[0] = new UserOutput::DigitalOutput(3, USER_DIGITAL_PIN_3);
myDigitalOutputs[1] = new UserOutput::DigitalOutput(1, USER_DIGITAL_PIN_1);
myDigitalOutputs[2] = new UserOutput::DigitalOutput(2, USER_DIGITAL_PIN_2);
myDigitalOutputs[3] = new UserOutput::DigitalOutput(3, USER_DIGITAL_PIN_3);
// Setup M67 Pins
myAnalogOutputs[0] = new UserOutput::AnalogOutput(0, USER_ANALOG_PIN_0, USER_ANALOG_PIN_0_FREQ);

View File

@@ -58,6 +58,9 @@ namespace UserOutput {
_pin = pin;
_pwm_frequency = pwm_frequency;
if (pin == UNDEFINED_PIN)
return;
// determine the highest bit precision allowed by frequency
_resolution_bits = sys_calc_pwm_precision(_pwm_frequency);
@@ -87,7 +90,7 @@ namespace UserOutput {
float duty;
// look for errors, but ignore if turning off to prevent mask turn off from generating errors
if (_number == UNDEFINED_PIN && percent != 0.0) {
if (_number == UNDEFINED_PIN) {
return false;
}