1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-29 17:19:50 +02:00

Fix Spindle State broken in earlier PR

This commit is contained in:
bdring
2020-11-24 09:45:18 -06:00
parent 60c5a6c9e1
commit 8ac74d4017

View File

@@ -155,7 +155,7 @@ namespace Spindles {
return; // Block during abort. return; // Block during abort.
} }
if (_current_state == SpindleState::Disable) { // Halt or set spindle direction and rpm. if (state == SpindleState::Disable) { // Halt or set spindle direction and rpm.
sys.spindle_speed = 0; sys.spindle_speed = 0;
stop(); stop();
if (use_delays && (_current_state != state)) { if (use_delays && (_current_state != state)) {
@@ -164,9 +164,9 @@ namespace Spindles {
//grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinDown Done"); //grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinDown Done");
} }
} else { } else {
set_dir_pin(_current_state == SpindleState::Cw); set_dir_pin(state == SpindleState::Cw);
set_rpm(rpm); set_rpm(rpm);
set_enable_pin(_current_state != SpindleState::Disable); // must be done after setting rpm for enable features to work set_enable_pin(state != SpindleState::Disable); // must be done after setting rpm for enable features to work
if (use_delays && (_current_state != state)) { if (use_delays && (_current_state != state)) {
//grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinUp Start %d", rpm); //grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "SpinUp Start %d", rpm);
mc_dwell(spindle_delay_spinup->get()); mc_dwell(spindle_delay_spinup->get());