From e3021201ebff6643cbb5e13c9f96f43de973c58a Mon Sep 17 00:00:00 2001 From: tjslip Date: Fri, 11 Aug 2017 16:29:54 +1000 Subject: [PATCH] Invert VARIABLE_SPINDLE PWM output --- grbl/config.h | 3 +++ grbl/cpu_map.h | 5 +++++ grbl/spindle_control.c | 10 +++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/grbl/config.h b/grbl/config.h index 28dafa11..04477314 100644 --- a/grbl/config.h +++ b/grbl/config.h @@ -210,6 +210,9 @@ // uncomment the config option USE_SPINDLE_DIR_AS_ENABLE_PIN below. // #define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable. +// Invert the PWM signal for VARIABLE_SPINDLE +// #define INVERT_SPINDLE_PWM // Disabled by default. Uncomment to enable. + // Inverts the selected coolant pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful // for some pre-built electronic boards. // #define INVERT_COOLANT_FLOOD_PIN // Default disabled. Uncomment to enable. diff --git a/grbl/cpu_map.h b/grbl/cpu_map.h index 0e2b25e5..d0ddec01 100644 --- a/grbl/cpu_map.h +++ b/grbl/cpu_map.h @@ -137,6 +137,11 @@ // Prescaled, 8-bit Fast PWM mode. #define SPINDLE_TCCRA_INIT_MASK ((1< 62.5kHz // #define SPINDLE_TCCRB_INIT_MASK (1< 7.8kHz (Used in v0.9) // #define SPINDLE_TCCRB_INIT_MASK ((1< 1.96kHz diff --git a/grbl/spindle_control.c b/grbl/spindle_control.c index 61cb90b8..595e6fd7 100644 --- a/grbl/spindle_control.c +++ b/grbl/spindle_control.c @@ -67,7 +67,7 @@ uint8_t spindle_get_state() if (bit_istrue(SPINDLE_ENABLE_PORT,(1<