mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-01 18:32:37 +02:00
Basic fixes to control pins
- Remove MSG from reset via control pin - remove gpio_reset_pin(...) from digital pins. This is a ESP32 only function and will cause issues with I2SO pins - Add IRAM_ATTR to system_exec_control_pin(...)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -94,7 +94,6 @@ namespace Spindles {
|
||||
#endif
|
||||
|
||||
#ifdef LASER_ENABLE_PIN
|
||||
gpio_reset_pin(LASER_ENABLE_PIN);
|
||||
pinMode(LASER_ENABLE_PIN, INPUT);
|
||||
#endif
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user