1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-27 08:14:31 +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:
Mitch Bradley
2020-07-24 12:48:35 -10:00
parent 975864189c
commit fd9fde3c3d
3 changed files with 10 additions and 2 deletions

View File

@@ -435,8 +435,8 @@ void mc_reset() {
// Kill spindle and coolant.
spindle->stop();
coolant_stop();
// turn off all digital I/O
sys_io_control(0xFF, false);
// turn off all digital I/O immediately
fast_sys_io_control(0xFF, false);
#ifdef ENABLE_SD_CARD
// do we need to stop a running SD job?
if (get_sd_state(false) == SDCARD_BUSY_PRINTING) {

View File

@@ -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
// 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) {
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
if (io_num_mask & bit(1)) {
digitalWrite(USER_DIGITAL_PIN_1, turnOn);

View File

@@ -226,6 +226,7 @@ void controlCheckTask(void* pvParameters);
void system_exec_control_pin(uint8_t pin);
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();