From 30c0f79afda7380a9c0c507ba84c5e05b6103684 Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Tue, 3 Jan 2017 10:10:35 -0700 Subject: [PATCH] Spindle enable pin with variable spindle option fix. - [fix] When USE_SPINDLE_DIR_AS_ENABLE_PIN is enabled in config.h, the enable pin was not being set when spindle speed is zero. This behavior should now be fixed. --- doc/log/commit_log_v1.1.txt | 14 ++++++++++++++ grbl/grbl.h | 2 +- grbl/spindle_control.c | 15 ++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/doc/log/commit_log_v1.1.txt b/doc/log/commit_log_v1.1.txt index 48a1260..ebb2439 100644 --- a/doc/log/commit_log_v1.1.txt +++ b/doc/log/commit_log_v1.1.txt @@ -1,3 +1,17 @@ +---------------- +Date: 2016-12-19 +Author: Sonny Jeon +Subject: Fixed homing fail alarm handling. Re-integrated software debouncing. + +- [bug] Fixed a homing fail issue, where the alarm was not being set +right, not cleared correctly. It would report the wrong code and enter +an infinite alarm loop. This was due to how alarm codes were altered a +while back. Now updated and fixed to show the right codes. + +- [feature] Re-installed optional software debouncing for hard limit +switches. By request. + + ---------------- Date: 2016-12-18 Author: Sonny Jeon diff --git a/grbl/grbl.h b/grbl/grbl.h index d23fd80..3121204 100644 --- a/grbl/grbl.h +++ b/grbl/grbl.h @@ -23,7 +23,7 @@ // Grbl versioning system #define GRBL_VERSION "1.1e" -#define GRBL_VERSION_BUILD "20161219" +#define GRBL_VERSION_BUILD "20170103" // Define standard libraries used by Grbl. #include diff --git a/grbl/spindle_control.c b/grbl/spindle_control.c index 2b66800..159b77d 100644 --- a/grbl/spindle_control.c +++ b/grbl/spindle_control.c @@ -115,19 +115,11 @@ void spindle_stop() // and stepper ISR. Keep routine small and efficient. void spindle_set_speed(uint8_t pwm_value) { + SPINDLE_OCR_REGISTER = pwm_value; // Set PWM output level. if (pwm_value == SPINDLE_PWM_OFF_VALUE) { - spindle_stop(); + SPINDLE_TCCRA_REGISTER &= ~(1<