mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-28 08:39:51 +02:00
Fixed reset problem.
To repro the problem: $Homing/enable=on <reboot> $X <hit a limit switch to cause an ALARM> ^x <now the command interpreter will not accept characters>
This commit is contained in:
@@ -435,8 +435,8 @@ void mc_reset() {
|
|||||||
// Kill spindle and coolant.
|
// Kill spindle and coolant.
|
||||||
spindle->stop();
|
spindle->stop();
|
||||||
coolant_stop();
|
coolant_stop();
|
||||||
// turn off all digital I/O
|
// turn off all digital I/O immediately
|
||||||
sys_io_control(0xFF, false);
|
fast_sys_io_control(0xFF, false);
|
||||||
#ifdef ENABLE_SD_CARD
|
#ifdef ENABLE_SD_CARD
|
||||||
// do we need to stop a running SD job?
|
// do we need to stop a running SD job?
|
||||||
if (get_sd_state(false) == SDCARD_BUSY_PRINTING) {
|
if (get_sd_state(false) == SDCARD_BUSY_PRINTING) {
|
||||||
|
@@ -339,8 +339,15 @@ int32_t system_convert_corexy_to_y_axis_steps(int32_t* steps) {
|
|||||||
|
|
||||||
// io_num is the virtual pin# and has nothing to do with the actual esp32 GPIO_NUM_xx
|
// io_num is the virtual pin# and has nothing to do with the actual esp32 GPIO_NUM_xx
|
||||||
// It uses a mask so all can be turned of in ms_reset
|
// It uses a mask so all can be turned of in ms_reset
|
||||||
|
// This version waits until realtime commands have been executed
|
||||||
void sys_io_control(uint8_t io_num_mask, bool turnOn) {
|
void sys_io_control(uint8_t io_num_mask, bool turnOn) {
|
||||||
protocol_buffer_synchronize();
|
protocol_buffer_synchronize();
|
||||||
|
fast_sys_io_control(io_num_mask, turnOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This version works immediately, without waiting, to prevent deadlocks.
|
||||||
|
// It is used when resetting via mc_reset()
|
||||||
|
void fast_sys_io_control(uint8_t io_num_mask, bool turnOn) {
|
||||||
#ifdef USER_DIGITAL_PIN_1
|
#ifdef USER_DIGITAL_PIN_1
|
||||||
if (io_num_mask & bit(1)) {
|
if (io_num_mask & bit(1)) {
|
||||||
digitalWrite(USER_DIGITAL_PIN_1, turnOn);
|
digitalWrite(USER_DIGITAL_PIN_1, turnOn);
|
||||||
|
@@ -226,6 +226,7 @@ void controlCheckTask(void* pvParameters);
|
|||||||
void system_exec_control_pin(uint8_t pin);
|
void system_exec_control_pin(uint8_t pin);
|
||||||
|
|
||||||
void sys_io_control(uint8_t io_num_mask, bool turnOn);
|
void sys_io_control(uint8_t io_num_mask, bool turnOn);
|
||||||
|
void fast_sys_io_control(uint8_t io_num_mask, bool turnOn);
|
||||||
|
|
||||||
//
|
//
|
||||||
int8_t sys_get_next_RMT_chan_num();
|
int8_t sys_get_next_RMT_chan_num();
|
||||||
|
Reference in New Issue
Block a user