Improvements for Laser / Spindle (#17661)

This commit is contained in:
Luu Lac
2020-06-08 00:47:31 -05:00
committed by GitHub
parent 5ac66b0f95
commit eda2fd8dbe
16 changed files with 448 additions and 268 deletions

View File

@ -142,11 +142,11 @@
//
#if EITHER(SPINDLE_FEATURE, LASER_FEATURE)
#define HAS_CUTTER 1
#define _CUTTER_DISP_PWM255 1
#define _CUTTER_DISP_PERCENT 2
#define _CUTTER_DISP_RPM 3
#define _CUTTER_DISP(V) _CAT(_CUTTER_DISP_, V)
#define CUTTER_DISPLAY_IS(V) (_CUTTER_DISP(CUTTER_POWER_DISPLAY) == _CUTTER_DISP(V))
#define _CUTTER_POWER_PWM255 1
#define _CUTTER_POWER_PERCENT 2
#define _CUTTER_POWER_RPM 3
#define _CUTTER_POWER(V) _CAT(_CUTTER_POWER_, V)
#define CUTTER_UNIT_IS(V) (_CUTTER_POWER(CUTTER_POWER_UNIT) == _CUTTER_POWER(V))
#endif
// Add features that need hardware PWM here

View File

@ -421,6 +421,8 @@
#error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP. Please update your Configuration_adv.h."
#elif defined(SPINDLE_LASER_ENABLE_INVERT)
#error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_HIGH. Please update your Configuration_adv.h."
#elif defined(CUTTER_POWER_DISPLAY)
#error "CUTTER_POWER_DISPLAY is now CUTTER_POWER_UNIT. Please update your Configuration_adv.h."
#elif defined(CHAMBER_HEATER_PIN)
#error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins."
#elif defined(TMC_Z_CALIBRATION)
@ -2825,10 +2827,10 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#endif
#if HAS_CUTTER
#ifndef CUTTER_POWER_DISPLAY
#error "CUTTER_POWER_DISPLAY is required with a spindle or laser. Please update your Configuration_adv.h."
#elif !CUTTER_DISPLAY_IS(PWM255) && !CUTTER_DISPLAY_IS(PERCENT) && !CUTTER_DISPLAY_IS(RPM)
#error "CUTTER_POWER_DISPLAY must be PWM255, PERCENT, or RPM. Please update your Configuration_adv.h."
#ifndef CUTTER_POWER_UNIT
#error "CUTTER_POWER_UNIT is required with a spindle or laser. Please update your Configuration_adv.h."
#elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM)
#error "CUTTER_POWER_UNIT must be PWM255, PERCENT, or RPM. Please update your Configuration_adv.h."
#endif
#if ENABLED(LASER_POWER_INLINE)
@ -2878,7 +2880,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
#elif !defined(SPINDLE_LASER_PWM_INVERT)
#error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
#elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) || !defined(SPEED_POWER_STARTUP)
#elif !(defined(SPEED_POWER_INTERCEPT) && defined(SPEED_POWER_MIN) && defined(SPEED_POWER_MAX) && defined(SPEED_POWER_STARTUP))
#error "SPINDLE_LASER_PWM equation constant(s) missing."
#elif _PIN_CONFLICT(X_MIN)
#error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN."