Skip to content

Commit

Permalink
Fix Spindle/Laser PWM DC (MarlinFirmware#18871)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and thinkyhead committed Aug 3, 2020
1 parent fa5ca86 commit 02a500d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Marlin/src/feature/spindle_laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ void SpindleLaser::init() {
void SpindleLaser::set_ocr(const uint8_t ocr) {
WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_HIGH); // turn spindle on
analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
#if NEEDS_HARDWARE_PWM && SPINDLE_LASER_FREQUENCY
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
#endif
}
void SpindleLaser::ocr_off() {
WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Turn spindle off
Expand Down

0 comments on commit 02a500d

Please sign in to comment.