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

Fixed a few small pin issues in custom code.

This commit is contained in:
Stefan de Bruijn
2020-11-01 22:13:06 +01:00
parent 25d2426051
commit 5a1daa3ff5
4 changed files with 9 additions and 5 deletions

1
.gitignore vendored
View File

@@ -21,3 +21,4 @@ Grbl_Esp32.vcxproj.filters
*.suo
Grbl_Esp32.ino.cpp
packages/
pio_machine.h

View File

@@ -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);

View File

@@ -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

View File

@@ -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