|
|
@ -67,7 +67,7 @@ cutter_frequency_t SpindleLaser::frequency; // PWM fre |
|
|
|
void SpindleLaser::init() { |
|
|
|
#if ENABLED(SPINDLE_SERVO) |
|
|
|
servo[SPINDLE_SERVO_NR].move(SPINDLE_SERVO_MIN); |
|
|
|
#else |
|
|
|
#elif PIN_EXISTS(SPINDLE_LASER_ENA) |
|
|
|
OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off
|
|
|
|
#endif |
|
|
|
#if ENABLED(SPINDLE_CHANGE_DIR) |
|
|
@ -104,12 +104,16 @@ void SpindleLaser::init() { |
|
|
|
} |
|
|
|
|
|
|
|
void SpindleLaser::set_ocr(const uint8_t ocr) { |
|
|
|
#if PIN_EXISTS(SPINDLE_LASER_ENA) |
|
|
|
WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_STATE); // Cutter ON
|
|
|
|
#endif |
|
|
|
_set_ocr(ocr); |
|
|
|
} |
|
|
|
|
|
|
|
void SpindleLaser::ocr_off() { |
|
|
|
#if PIN_EXISTS(SPINDLE_LASER_ENA) |
|
|
|
WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Cutter OFF
|
|
|
|
#endif |
|
|
|
_set_ocr(0); |
|
|
|
} |
|
|
|
#endif // SPINDLE_LASER_USE_PWM
|
|
|
|