From 234195e721a58d4e46f21b63afcf1e5990570de0 Mon Sep 17 00:00:00 2001 From: Sungeun Jeon Date: Fri, 27 Mar 2015 19:59:34 -0600 Subject: [PATCH] Compile-option for inverting spindle enable. - Installed a compile-option for inverting the spindle enable pin for certain electronics boards users have reported needing this. --- grbl/config.h | 7 +++++++ grbl/spindle_control.c | 24 ++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/grbl/config.h b/grbl/config.h index f430694..d45b260 100644 --- a/grbl/config.h +++ b/grbl/config.h @@ -156,6 +156,13 @@ // NOTE: Will eventually be added to Grbl settings in v1.0. // #define INVERT_CONTROL_PIN // Default disabled. Uncomment to enable. +// Inverts the spindle enable pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful +// for some pre-built electronic boards. +// NOTE: If VARIABLE_SPINDLE is enabled(default), this option has no effect as the PWM output and +// spindle enable are combined to one pin. If you need both this option and spindle speed PWM, +// uncomment the config option USE_SPINDLE_DIR_AS_ENABLE_PIN below. +// #define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable. + // Enable limit pin states feedback in status reports. The data is presented as 0 (low) or 1(high), // where the order is XYZ. For example, if the Y- and Z-limit pins are active, Grbl will include the // following string in the status report "Lim:011". This is generally useful for setting up a new diff --git a/grbl/spindle_control.c b/grbl/spindle_control.c index 18c92ac..d9c5c10 100644 --- a/grbl/spindle_control.c +++ b/grbl/spindle_control.c @@ -49,10 +49,18 @@ void spindle_stop() #ifdef VARIABLE_SPINDLE TCCRA_REGISTER &= ~(1<