Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control pin fixes #901

Open
wants to merge 2 commits into
base: Devt
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Grbl_Esp32/src/Grbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Grbl versioning system
const char* const GRBL_VERSION = "1.3a";
const char* const GRBL_VERSION_BUILD = "20210424";
const char* const GRBL_VERSION_BUILD = "20210517";

//#include <sdkconfig.h>
#include <Arduino.h>
Expand Down
4 changes: 0 additions & 4 deletions Grbl_Esp32/src/Spindles/10vSpindle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,17 @@ namespace Spindles {
pinMode(SPINDLE_OUTPUT_PIN, INPUT);
#endif
#ifdef SPINDLE_ENABLE_PIN
gpio_reset_pin(SPINDLE_ENABLE_PIN);
pinMode(SPINDLE_ENABLE_PIN, INPUT);
#endif

#ifdef SPINDLE_DIR_PIN
gpio_reset_pin(SPINDLE_DIR_PIN);
pinMode(SPINDLE_DIR_PIN, INPUT);
#endif
#ifdef SPINDLE_FORWARD_PIN
gpio_reset_pin(SPINDLE_FORWARD_PIN);
pinMode(SPINDLE_FORWARD_PIN, INPUT);
#endif

#ifdef SPINDLE_REVERSE_PIN
gpio_reset_pin(SPINDLE_FORWARD_PIN);
pinMode(SPINDLE_FORWARD_PIN, INPUT);
#endif
}
Expand Down
1 change: 0 additions & 1 deletion Grbl_Esp32/src/Spindles/Laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ namespace Spindles {
#endif

#ifdef LASER_ENABLE_PIN
gpio_reset_pin(LASER_ENABLE_PIN);
pinMode(LASER_ENABLE_PIN, INPUT);
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions Grbl_Esp32/src/Spindles/PWMSpindle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,10 @@ namespace Spindles {
pinMode(SPINDLE_OUTPUT_PIN, INPUT);
#endif
#ifdef SPINDLE_ENABLE_PIN
gpio_reset_pin(SPINDLE_ENABLE_PIN);
pinMode(SPINDLE_ENABLE_PIN, INPUT);
#endif

#ifdef SPINDLE_DIR_PIN
gpio_reset_pin(SPINDLE_DIR_PIN);
pinMode(SPINDLE_DIR_PIN, INPUT);
#endif
}
Expand Down
3 changes: 1 addition & 2 deletions Grbl_Esp32/src/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@ ControlPins system_control_get_state() {
}

// execute the function of the control pin
void system_exec_control_pin(ControlPins pins) {
void IRAM_ATTR system_exec_control_pin(ControlPins pins) {
if (pins.bit.reset) {
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "Reset via control pin");
mc_reset();
} else if (pins.bit.cycleStart) {
sys_rt_exec_state.bit.cycleStart = true;
Expand Down
4 changes: 2 additions & 2 deletions Grbl_Esp32/src/System.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ void system_convert_array_steps_to_mpos(float* position, int32_t* steps);
float* system_get_mpos();

// A task that runs after a control switch interrupt for debouncing.
void controlCheckTask(void* pvParameters);
void system_exec_control_pin(ControlPins pins);
void controlCheckTask(void* pvParameters);
void IRAM_ATTR system_exec_control_pin(ControlPins pins);

bool sys_set_digital(uint8_t io_num, bool turnOn);
void sys_digital_all_off();
Expand Down