diff --git a/.gitignore b/.gitignore index 4bb3c08b..737bd477 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ Grbl_Esp32.vcxproj.filters *.suo Grbl_Esp32.ino.cpp packages/ +pio_machine.h diff --git a/Grbl_Esp32/Custom/atari_1020.cpp b/Grbl_Esp32/Custom/atari_1020.cpp index 5661ae6d..01ddaa50 100644 --- a/Grbl_Esp32/Custom/atari_1020.cpp +++ b/Grbl_Esp32/Custom/atari_1020.cpp @@ -44,6 +44,7 @@ uint8_t current_tool; void machine_init() { solenoid_pull_count = 0; // initialize grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Atari 1020 Solenoid"); + // setup PWM channel solenoid_pwm_chan_num = sys_get_next_PWM_chan_num(); ledcSetup(solenoid_pwm_chan_num, SOLENOID_PWM_FREQ, SOLENOID_PWM_RES_BITS); diff --git a/Grbl_Esp32/Custom/mpcnc_laser_module.cpp b/Grbl_Esp32/Custom/mpcnc_laser_module.cpp index e65ce629..73347306 100644 --- a/Grbl_Esp32/Custom/mpcnc_laser_module.cpp +++ b/Grbl_Esp32/Custom/mpcnc_laser_module.cpp @@ -27,9 +27,11 @@ machine_init() is called when Grbl_ESP32 first starts. You can use it to do any special things your machine needs at startup. */ void machine_init() { + Pin levelShift = Pin::create(LVL_SHIFT_ENABLE); + // force this on all the time grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Custom machine_init() Level Shift Enabled"); - pinMode(LVL_SHIFT_ENABLE, OUTPUT); - digitalWrite(LVL_SHIFT_ENABLE, HIGH); + levelShift.setAttr(Pin::Attr::Output); + levelShift.on(); } #endif diff --git a/Grbl_Esp32/src/Machines/atari_1020.h b/Grbl_Esp32/src/Machines/atari_1020.h index 8846b691..b82b1770 100644 --- a/Grbl_Esp32/src/Machines/atari_1020.h +++ b/Grbl_Esp32/src/Machines/atari_1020.h @@ -51,13 +51,13 @@ #define Y_PIN_PHASE_2 "gpio.26" #define Y_PIN_PHASE_3 "gpio.32" -#define SOLENOID_DIRECTION_PIN "gpio.4" -#define SOLENOID_PEN_PIN "gpio.2" +#define SOLENOID_DIRECTION_PIN GPIO_NUM_4 +#define SOLENOID_PEN_PIN GPIO_NUM_2 // this 'bot only homes the X axis // Set $Homing/Cycle0=0 -#define REED_SW_PIN "gpio.17" +#define REED_SW_PIN GPIO_NUM_17 #ifndef ENABLE_CONTROL_SW_DEBOUNCE #define ENABLE_CONTROL_SW_DEBOUNCE