From cf2922f1645614ede75d9cba68cdaa87612b17a1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 6 Jan 2018 15:29:22 -0600 Subject: [PATCH] Laser/spindle PWM off on M5 --- Marlin/src/gcode/control/M3-M5.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 7cfa4472d..1fea7e56f 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -131,6 +131,9 @@ void GcodeSuite::M3_M4(bool is_M3) { void GcodeSuite::M5() { stepper.synchronize(); WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); + #if ENABLED(SPINDLE_LASER_PWM) + analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); + #endif delay_for_power_down(); }