|
@ -68,7 +68,7 @@ void SpindleLaser::init() { |
|
|
SET_PWM(SPINDLE_LASER_PWM_PIN); |
|
|
SET_PWM(SPINDLE_LASER_PWM_PIN); |
|
|
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed
|
|
|
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed
|
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY) |
|
|
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY |
|
|
set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_FREQUENCY); |
|
|
set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_FREQUENCY); |
|
|
TERN_(MARLIN_DEV_MODE, frequency = SPINDLE_LASER_FREQUENCY); |
|
|
TERN_(MARLIN_DEV_MODE, frequency = SPINDLE_LASER_FREQUENCY); |
|
|
#endif |
|
|
#endif |
|
@ -78,9 +78,7 @@ void SpindleLaser::init() { |
|
|
#if ENABLED(AIR_ASSIST) |
|
|
#if ENABLED(AIR_ASSIST) |
|
|
OUT_WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); // Init Air Assist OFF
|
|
|
OUT_WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); // Init Air Assist OFF
|
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(I2C_AMMETER) |
|
|
TERN_(I2C_AMMETER, ammeter.init()); // Init I2C Ammeter
|
|
|
ammeter.init(); // Init I2C Ammeter
|
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#if ENABLED(SPINDLE_LASER_USE_PWM) |
|
|
#if ENABLED(SPINDLE_LASER_USE_PWM) |
|
@ -90,7 +88,7 @@ void SpindleLaser::init() { |
|
|
* @param ocr Power value |
|
|
* @param ocr Power value |
|
|
*/ |
|
|
*/ |
|
|
void SpindleLaser::_set_ocr(const uint8_t ocr) { |
|
|
void SpindleLaser::_set_ocr(const uint8_t ocr) { |
|
|
#if NEEDS_HARDWARE_PWM && SPINDLE_LASER_FREQUENCY |
|
|
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY |
|
|
set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), TERN(MARLIN_DEV_MODE, frequency, SPINDLE_LASER_FREQUENCY)); |
|
|
set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), TERN(MARLIN_DEV_MODE, frequency, SPINDLE_LASER_FREQUENCY)); |
|
|
#endif |
|
|
#endif |
|
|
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); |
|
|
set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF); |
|
|