1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-24 20:43:32 +00:00

Turn off laser power pin when PWM goes to 0

This commit is contained in:
Scott Lahteine 2017-11-11 21:56:35 -06:00
parent 564fbc8dec
commit 802ae73b13

View File

@ -6449,6 +6449,7 @@ inline void gcode_G92() {
const float spindle_laser_power = parser.floatval('S'); const float spindle_laser_power = parser.floatval('S');
if (spindle_laser_power == 0) { if (spindle_laser_power == 0) {
WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low) WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low)
analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // only write low byte
delay_for_power_down(); delay_for_power_down();
} }
else { else {