|
@@ -66,6 +66,9 @@ void SpindleLaser::init() {
|
66
|
66
|
void SpindleLaser::set_ocr(const uint8_t ocr) {
|
67
|
67
|
WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_HIGH); // turn spindle on
|
68
|
68
|
analogWrite(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
|
|
69
|
+ #if NEEDS_HARDWARE_PWM && SPINDLE_LASER_FREQUENCY
|
|
70
|
+ set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
|
|
71
|
+ #endif
|
69
|
72
|
}
|
70
|
73
|
void SpindleLaser::ocr_off() {
|
71
|
74
|
WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Turn spindle off
|