Singleton for cutting tools (#14429)

This commit is contained in:
Scott Lahteine
2019-06-27 23:06:49 -05:00
committed by GitHub
parent 2fde1475cb
commit d7d80418ae
127 changed files with 2773 additions and 2675 deletions

View File

@ -26,6 +26,8 @@
* Defines that depend on advanced configuration.
*/
#define HAS_CUTTER EITHER(SPINDLE_FEATURE, LASER_FEATURE)
#if !defined(__AVR__) || !defined(USBCON)
// Define constants and variables for buffering serial data.
// Use only 0 or powers of 2 greater than 1

View File

@ -1692,7 +1692,7 @@
#endif
#endif
// needs to be here so that we catch the above changes to our defines
// Defined here to catch the above defines
#if ENABLED(SDCARD_SORT_ALPHA)
#define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
#endif

View File

@ -348,8 +348,16 @@
#error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins."
#elif defined(MAX6675_SS2)
#error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins."
#elif defined(SPINDLE_LASER_ENABLE)
#error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE. Please update your Configuration_adv.h."
#elif defined(SPINDLE_LASER_ENABLE_PIN)
#error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your configuration and/or pins."
#error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your Configuration_adv.h and/or pins."
#elif defined(SPINDLE_DIR_CHANGE)
#error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR. Please update your Configuration_adv.h."
#elif defined(SPINDLE_STOP_ON_DIR_CHANGE)
#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(CHAMBER_HEATER_PIN)
#error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins."
#elif defined(TMC_Z_CALIBRATION)
@ -2284,3 +2292,63 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends."
#endif
#endif
#if HAS_CUTTER
#define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
#if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
#error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
#elif !PIN_EXISTS(SPINDLE_LASER_ENA)
#error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN."
#elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
#error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
#elif ENABLED(SPINDLE_LASER_PWM)
#if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0
#error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_PWM."
#elif !PWM_PIN(SPINDLE_LASER_PWM_PIN)
#error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
#elif SPINDLE_LASER_POWERUP_DELAY < 1
#error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
#elif SPINDLE_LASER_POWERDOWN_DELAY < 1
#error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
#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)
#error "SPINDLE_LASER_PWM equation constant(s) missing."
#elif _PIN_CONFLICT(X_MIN)
#error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN."
#elif _PIN_CONFLICT(X_MAX)
#error "SPINDLE_LASER_PWM pin conflicts with X_MAX_PIN."
#elif _PIN_CONFLICT(Z_STEP)
#error "SPINDLE_LASER_PWM pin conflicts with Z_STEP_PIN."
#elif _PIN_CONFLICT(CASE_LIGHT)
#error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN."
#elif _PIN_CONFLICT(E0_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E1_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E2_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E3_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E4_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(E5_AUTO_FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN."
#elif _PIN_CONFLICT(FAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN."
#elif _PIN_CONFLICT(FAN1)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN."
#elif _PIN_CONFLICT(FAN2)
#error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN."
#elif _PIN_CONFLICT(CONTROLLERFAN)
#error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN."
#elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY)
#error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY."
#elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z)
#error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z."
#elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E)
#error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E."
#endif
#endif
#undef _PIN_CONFLICT
#endif