diff --git a/.travis.yml b/.travis.yml index 12b4af9963c810ffb93aa1147bec9defeac179c2..6a33a1936743af7a27646e652deacb2fbd760b9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,18 +83,23 @@ script: - opt_set TEMP_SENSOR_1 1 - build_marlin # - # Test 3 extruders on RUMBA (can use any board with >=3 extruders defined) + # Test 5 extruders on AZTEEG_X3_PRO (can use any board with >=5 extruders defined) # Include a test for LIN_ADVANCE here also # - - opt_set MOTHERBOARD BOARD_RUMBA - - opt_set EXTRUDERS 3 - - opt_set TEMP_SENSOR_2 1 + - opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO + - opt_set EXTRUDERS 5 + - opt_set TEMP_SENSOR_1 1 + - opt_set TEMP_SENSOR_2 5 + - opt_set TEMP_SENSOR_3 20 + - opt_set TEMP_SENSOR_4 999 + - opt_set TEMP_SENSOR_BED 1 - opt_enable_adv LIN_ADVANCE - build_marlin # # Test PIDTEMPBED # - restore_configs + - opt_set TEMP_SENSOR_BED 1 - opt_enable PIDTEMPBED - build_marlin # @@ -158,11 +163,12 @@ script: - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT - build_marlin # - # Mixing Extruder + # Mixing Extruder with 5 steppers # - restore_configs + - opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO - opt_enable MIXING_EXTRUDER - - opt_set MIXING_STEPPERS 2 + - opt_set MIXING_STEPPERS 5 - build_marlin # # Test DUAL_X_CARRIAGE diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index d69b1b1ec781222e7a131573fb50faae1597807e..734df230fe05c6f909c0ffad621f02fd142862a2 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -374,7 +374,7 @@ /** * Set a flag for any enabled probe */ - #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED)) + #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) /** * Clear probe pin settings when no probe is selected diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index e96ffb7b9ff97831c5a8fca5716f0a6be85e14e5..78a73b27c24502ab3cd14517fef7534a7b3a0a46 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -435,18 +435,100 @@ /** * Shorthand for pin tests, used wherever needed */ + + // Steppers + #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) + #define HAS_X_DIR (PIN_EXISTS(X_DIR)) + #define HAS_X_STEP (PIN_EXISTS(X_STEP)) + #define HAS_X_MICROSTEPS (PIN_EXISTS(X_MS1)) + + #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) + #define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) + #define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) + #define HAS_Y_MICROSTEPS (PIN_EXISTS(Y_MS1)) + + #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) + #define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) + #define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) + #define HAS_Z_MICROSTEPS (PIN_EXISTS(Z_MS1)) + + #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) + #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) + #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) + + #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) + #define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) + #define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) + + #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) + #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) + #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) + + // Extruder steppers and solenoids + #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) + #define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) + #define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) + #define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1)) + #define HAS_SOLENOID_0 (PIN_EXISTS(SOL0)) + + #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) + #define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) + #define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) + #define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1)) + #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) + + #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) + #define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) + #define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) + #define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1)) + #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) + + #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) + #define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) + #define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) + #define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1)) + #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) + + #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE)) + #define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) + #define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) + #define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1)) + #define HAS_SOLENOID_4 (PIN_EXISTS(SOL4)) + + // Endstops and bed probe + #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X_MIN_PIN)) + #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X_MAX_PIN)) + #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y_MIN_PIN)) + #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y_MAX_PIN)) + #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z_MIN_PIN)) + #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z_MAX_PIN)) + #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) + #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) + #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE)) + + // Thermistors #define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 > -2) #define HAS_TEMP_1 (PIN_EXISTS(TEMP_1) && TEMP_SENSOR_1 != 0 && TEMP_SENSOR_1 > -2) #define HAS_TEMP_2 (PIN_EXISTS(TEMP_2) && TEMP_SENSOR_2 != 0 && TEMP_SENSOR_2 > -2) #define HAS_TEMP_3 (PIN_EXISTS(TEMP_3) && TEMP_SENSOR_3 != 0 && TEMP_SENSOR_3 > -2) #define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2) + #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675)) #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2) + + // Heaters #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1)) #define HAS_HEATER_2 (PIN_EXISTS(HEATER_2)) #define HAS_HEATER_3 (PIN_EXISTS(HEATER_3)) #define HAS_HEATER_4 (PIN_EXISTS(HEATER_4)) #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) + + // Thermal protection + #define HAS_THERMALLY_PROTECTED_BED (ENABLED(THERMAL_PROTECTION_BED) && HAS_TEMP_BED && HAS_HEATER_BED) + #define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) + #define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0) + + // Auto fans #define HAS_AUTO_FAN_0 (PIN_EXISTS(E0_AUTO_FAN)) #define HAS_AUTO_FAN_1 (HOTENDS > 1 && PIN_EXISTS(E1_AUTO_FAN)) #define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN)) @@ -463,87 +545,38 @@ #define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) #define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) #define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN) + + // Other fans #define HAS_FAN0 (PIN_EXISTS(FAN)) #define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLERFAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN) #define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLERFAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN) #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN)) + + // Servos #define HAS_SERVOS (defined(NUM_SERVOS) && NUM_SERVOS > 0) #define HAS_SERVO_0 (PIN_EXISTS(SERVO0)) #define HAS_SERVO_1 (PIN_EXISTS(SERVO1)) #define HAS_SERVO_2 (PIN_EXISTS(SERVO2)) #define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) + + // Sensors #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) #define HAS_FIL_RUNOUT (PIN_EXISTS(FIL_RUNOUT)) + + // User Interface #define HAS_HOME (PIN_EXISTS(HOME)) #define HAS_KILL (PIN_EXISTS(KILL)) #define HAS_SUICIDE (PIN_EXISTS(SUICIDE)) #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH)) - #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X_MIN_PIN)) - #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X_MAX_PIN)) - #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y_MIN_PIN)) - #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y_MAX_PIN)) - #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z_MIN_PIN)) - #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z_MAX_PIN)) - #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN)) - #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX)) - #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE)) - #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1)) - #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2)) - #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3)) - #define HAS_MICROSTEPS_X (PIN_EXISTS(X_MS1)) - #define HAS_MICROSTEPS_Y (PIN_EXISTS(Y_MS1)) - #define HAS_MICROSTEPS_Z (PIN_EXISTS(Z_MS1)) - #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1)) - #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1)) - #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1)) - #define HAS_MICROSTEPS (HAS_MICROSTEPS_X || HAS_MICROSTEPS_Y || HAS_MICROSTEPS_Z || HAS_MICROSTEPS_E0 || HAS_MICROSTEPS_E1 || HAS_MICROSTEPS_E2) - #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) - #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE)) - #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE)) - #define HAS_Y_ENABLE (PIN_EXISTS(Y_ENABLE)) - #define HAS_Y2_ENABLE (PIN_EXISTS(Y2_ENABLE)) - #define HAS_Z_ENABLE (PIN_EXISTS(Z_ENABLE)) - #define HAS_Z2_ENABLE (PIN_EXISTS(Z2_ENABLE)) - #define HAS_E0_ENABLE (PIN_EXISTS(E0_ENABLE)) - #define HAS_E1_ENABLE (PIN_EXISTS(E1_ENABLE)) - #define HAS_E2_ENABLE (PIN_EXISTS(E2_ENABLE)) - #define HAS_E3_ENABLE (PIN_EXISTS(E3_ENABLE)) - #define HAS_E4_ENABLE (PIN_EXISTS(E4_ENABLE)) - #define HAS_X_DIR (PIN_EXISTS(X_DIR)) - #define HAS_X2_DIR (PIN_EXISTS(X2_DIR)) - #define HAS_Y_DIR (PIN_EXISTS(Y_DIR)) - #define HAS_Y2_DIR (PIN_EXISTS(Y2_DIR)) - #define HAS_Z_DIR (PIN_EXISTS(Z_DIR)) - #define HAS_Z2_DIR (PIN_EXISTS(Z2_DIR)) - #define HAS_E0_DIR (PIN_EXISTS(E0_DIR)) - #define HAS_E1_DIR (PIN_EXISTS(E1_DIR)) - #define HAS_E2_DIR (PIN_EXISTS(E2_DIR)) - #define HAS_E3_DIR (PIN_EXISTS(E3_DIR)) - #define HAS_E4_DIR (PIN_EXISTS(E4_DIR)) - #define HAS_X_STEP (PIN_EXISTS(X_STEP)) - #define HAS_X2_STEP (PIN_EXISTS(X2_STEP)) - #define HAS_Y_STEP (PIN_EXISTS(Y_STEP)) - #define HAS_Y2_STEP (PIN_EXISTS(Y2_STEP)) - #define HAS_Z_STEP (PIN_EXISTS(Z_STEP)) - #define HAS_Z2_STEP (PIN_EXISTS(Z2_STEP)) - #define HAS_E0_STEP (PIN_EXISTS(E0_STEP)) - #define HAS_E1_STEP (PIN_EXISTS(E1_STEP)) - #define HAS_E2_STEP (PIN_EXISTS(E2_STEP)) - #define HAS_E3_STEP (PIN_EXISTS(E3_STEP)) - #define HAS_E4_STEP (PIN_EXISTS(E4_STEP)) - #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) #define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER)) #define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT)) + // Digital control + #define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS) + #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) + #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) - #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675)) - - #define HAS_THERMALLY_PROTECTED_BED (HAS_TEMP_BED && HAS_HEATER_BED && ENABLED(THERMAL_PROTECTION_BED)) - - #define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) - #define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0) - /** * This setting is also used by M109 when trying to calculate * a ballpark safe margin to prevent wait-forever situation. diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index cc57bff662ee371c60d9dd05ea3449791de544a2..0fca8aa5b0a8962b8f583fc7a12a22be6c1a2693 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -593,6 +593,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6c77f907c95b1c3dc652a521526a6d49036907d0..e04620dcaa0c8cee66959efe722a6e0f6628c411 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 36fcc70c30774f866139b486111e5b4cdcfb2246..2ca660c99109c084fa1c1456b28e03281101986d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -963,15 +963,15 @@ void servo_init() { // This variant uses 3 separate pins for the RGB components. // If the pins can do PWM then their intensity will be set. - digitalWrite(RGB_LED_R_PIN, r ? HIGH : LOW); - digitalWrite(RGB_LED_G_PIN, g ? HIGH : LOW); - digitalWrite(RGB_LED_B_PIN, b ? HIGH : LOW); + WRITE(RGB_LED_R_PIN, r ? HIGH : LOW); + WRITE(RGB_LED_G_PIN, g ? HIGH : LOW); + WRITE(RGB_LED_B_PIN, b ? HIGH : LOW); analogWrite(RGB_LED_R_PIN, r); analogWrite(RGB_LED_G_PIN, g); analogWrite(RGB_LED_B_PIN, b); #if ENABLED(RGBW_LED) - digitalWrite(RGB_LED_W_PIN, w ? HIGH : LOW); + WRITE(RGB_LED_W_PIN, w ? HIGH : LOW); analogWrite(RGB_LED_W_PIN, w); #endif @@ -1854,8 +1854,8 @@ static void clean_up_after_endstop_or_probe_move() { // Dock sled a bit closer to ensure proper capturing do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET - ((stow) ? 1 : 0)); - #if PIN_EXISTS(SLED) - digitalWrite(SLED_PIN, !stow); // switch solenoid + #if HAS_SOLENOID_1 && DISABLED(EXT_SOLENOID) + WRITE(SOL1_PIN, !stow); // switch solenoid #endif } @@ -2123,7 +2123,13 @@ static void clean_up_after_endstop_or_probe_move() { // otherwise an Allen-Key probe can't be stowed. #endif - #if ENABLED(Z_PROBE_SLED) + #if ENABLED(SOLENOID_PROBE) + + #if HAS_SOLENOID_1 + WRITE(SOL1_PIN, deploy); + #endif + + #elif ENABLED(Z_PROBE_SLED) dock_sled(!deploy); @@ -7588,26 +7594,31 @@ inline void gcode_M303() { #if ENABLED(EXT_SOLENOID) - void enable_solenoid(uint8_t num) { + void enable_solenoid(const uint8_t num) { switch (num) { case 0: OUT_WRITE(SOL0_PIN, HIGH); break; - #if HAS_SOLENOID_1 + #if HAS_SOLENOID_1 && EXTRUDERS > 1 case 1: OUT_WRITE(SOL1_PIN, HIGH); break; #endif - #if HAS_SOLENOID_2 + #if HAS_SOLENOID_2 && EXTRUDERS > 2 case 2: OUT_WRITE(SOL2_PIN, HIGH); break; #endif - #if HAS_SOLENOID_3 + #if HAS_SOLENOID_3 && EXTRUDERS > 3 case 3: OUT_WRITE(SOL3_PIN, HIGH); break; #endif + #if HAS_SOLENOID_4 && EXTRUDERS > 4 + case 4: + OUT_WRITE(SOL4_PIN, HIGH); + break; + #endif default: SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_INVALID_SOLENOID); @@ -7619,9 +7630,18 @@ inline void gcode_M303() { void disable_all_solenoids() { OUT_WRITE(SOL0_PIN, LOW); - OUT_WRITE(SOL1_PIN, LOW); - OUT_WRITE(SOL2_PIN, LOW); - OUT_WRITE(SOL3_PIN, LOW); + #if HAS_SOLENOID_1 && EXTRUDERS > 1 + OUT_WRITE(SOL1_PIN, LOW); + #endif + #if HAS_SOLENOID_2 && EXTRUDERS > 2 + OUT_WRITE(SOL2_PIN, LOW); + #endif + #if HAS_SOLENOID_3 && EXTRUDERS > 3 + OUT_WRITE(SOL3_PIN, LOW); + #endif + #if HAS_SOLENOID_4 && EXTRUDERS > 4 + OUT_WRITE(SOL4_PIN, LOW); + #endif } /** @@ -8548,7 +8568,7 @@ inline void gcode_M907() { uint8_t case_light_brightness = 255; void update_case_light() { - digitalWrite(CASE_LIGHT_PIN, case_light_on != INVERT_CASE_LIGHT ? HIGH : LOW); + WRITE(CASE_LIGHT_PIN, case_light_on != INVERT_CASE_LIGHT ? HIGH : LOW); analogWrite(CASE_LIGHT_PIN, case_light_on != INVERT_CASE_LIGHT ? case_light_brightness : 0); } @@ -10739,7 +10759,7 @@ void prepare_move_to_destination() { uint8_t speed = (!lastMotorOn || ELAPSED(ms, lastMotorOn + (CONTROLLERFAN_SECS) * 1000UL)) ? 0 : CONTROLLERFAN_SPEED; // allows digital or PWM fan output to be used (see M42 handling) - digitalWrite(CONTROLLERFAN_PIN, speed); + WRITE(CONTROLLERFAN_PIN, speed); analogWrite(CONTROLLERFAN_PIN, speed); } } @@ -11437,9 +11457,9 @@ void setup() { dac_init(); #endif - #if ENABLED(Z_PROBE_SLED) && PIN_EXISTS(SLED) - OUT_WRITE(SLED_PIN, LOW); // turn it off - #endif // Z_PROBE_SLED + #if (ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE)) && HAS_SOLENOID_1 + OUT_WRITE(SOL1_PIN, LOW); // turn it off + #endif setup_homepin(); @@ -11451,10 +11471,13 @@ void setup() { OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off #endif - #if ENABLED(RGB_LED) + #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) SET_OUTPUT(RGB_LED_R_PIN); SET_OUTPUT(RGB_LED_G_PIN); SET_OUTPUT(RGB_LED_B_PIN); + #if ENABLED(RGBW_LED) + SET_OUTPUT(RGB_LED_W_PIN); + #endif #endif lcd_init(); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 34b00ceebdbc5da0c52d863497471d8b4beb7074..8f4c295421d5463f5ecbf6bf2cf88048e6cbb978 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -172,6 +172,8 @@ #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." #elif defined(min_software_endstops) || defined(max_software_endstops) #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." +#elif ENABLED(Z_PROBE_SLED) && defined(SLED_PIN) + #error "Replace SLED_PIN with SOL1_PIN (applies to both Z_PROBE_SLED and SOLENOID_PROBE)." #endif /** @@ -459,6 +461,9 @@ static_assert(1 >= 0 #if ENABLED(Z_PROBE_SLED) + 1 #endif + #if ENABLED(SOLENOID_PROBE) + + 1 + #endif , "Please enable only one probe: PROBE_MANUALLY, FIX_MOUNTED_PROBE, Z Servo, BLTOUCH, Z_PROBE_ALLEN_KEY, or Z_PROBE_SLED." ); @@ -472,6 +477,17 @@ static_assert(1 >= 0 #error "You cannot use Z_PROBE_SLED with DELTA." #endif + /** + * SOLENOID_PROBE requirements + */ + #if ENABLED(SOLENOID_PROBE) + #if ENABLED(EXT_SOLENOID) + #error "SOLENOID_PROBE is incompatible with EXT_SOLENOID." + #elif !HAS_SOLENOID_1 + #error "SOLENOID_PROBE requires SOL1_PIN. It can be added to your Configuration.h." + #endif + #endif + /** * NUM_SERVOS is required for a Z servo probe */ diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 6a2382fa46ac7ac75f47fe665d84d9417a8fd082..26fd8841226af24eda839020b84d29e3c35ee020 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -592,6 +592,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 649bf4e869e2dec4b6e2ab5ec6db0191a87d3220..bfaa39d4c49e02508903c4428c6fbafa665aec30 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index f7cf0e3241de7f2ac493d7bb974a15f93728838b..2062fc343175d7ac251294092ae4c7a8c90bf544 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -576,6 +576,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index b470e2f21a6ea753b51ff0d89f3a0c9d2015731d..3c2610e831c29c605d6b5947a30d7181dae335f4 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 96b9eb19c8423628b31baadad739087a02a41b46..45a8ac6b26e03fb9f3ab211ff375981c2125de51 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -576,6 +576,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 5488cf6e7cff6bd5cdbd28fadd6bd50f95953f30..e3a844f8d3fe3327c62c49c0df33ea5ca47d70ce 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -584,6 +584,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 9aa2652edb0868e7cde37be0defd0075cdc87f61..95c0c5c05ea15d3f6aa6b346d36bd5b024f9d247 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 277bf536459a867a32502ebd34159186a39b1327..2b3d2487cce17fcf11a5402260cc8479fa3b3ce3 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -587,6 +587,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 0d23aa8c003b370a064f2a1247a36ee326adafea..c5d3f5c6c86c659a1d2434d7d2d32d2d62d3c4d8 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index be48f771d3173ee22692e7de42f5fc3c9bec3f17..cd6e3bf763f4d42ed382e8ee4a60d2db50c2e62f 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -622,6 +622,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index edf8e4dd46b8aac42abb8c513f66a7d7bab6ac26..6616b12bfb74f1bcf48540905a4d53d0316d87a6 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -340,7 +340,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 94565900044a84328de84fda27c4a962faedd6ef..07a368c823912621ef21f717d86150a9b884de93 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -593,6 +593,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 0ab0ebdf0ec35ec1063820259240b5f8adbed422..7db7af3110b3aecd2ef2aa2fe29fb0df9b568358 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 4a4d29dc13153cb3da435511337c6016cb1753f2..43ce27098a251ead52d0ce039bba9d5a61b3c3a7 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -593,6 +593,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 6b521ff03a8943b25e18c54972aeaf881731aea4..5fbea32d9bded7de30eedfe65ea66937a7f06f51 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -593,6 +593,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index b5b33631699056b8b77d33a3a5159128d81acd5e..d75440d73def00a38a8ce088247fc35d1afca58e 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -592,6 +592,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e1c9e74dd1991b5cffbcd0ea77c60f5010eb1537..2badf51885485d71bf05288dfa884398a027a492 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index b116d9f9abebbfb80b2142d140a023f1abce8969..9b6eb56da4e2a9628132d3fe8bef5e83aead3edc 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -608,6 +608,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index a98ad89af9c378075cafba63a79ee103f8c94039..ba87a8daa1890f422933b416afbe6380a86f1c02 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 4960cf1d5c08ca1a1016897558b5fd8bb37710cd..ab7bb0df6e136a9b67bd834e1d9d103ed3018e4f 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -613,6 +613,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 68a12319acdbeb118f7d57739881e144862b7cfb..e3fcad98113e90d0ddaad808d0972adc1ba29699 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -335,7 +335,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 8fce9fa9794f11d47571dac3e3451ad78f03f0a2..6581f688975c9429de93dd7c264df3e265347c7a 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -644,6 +644,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index 8042ed2e0176c5226c2fcc9ee534e9a910f44e68..4133091a0d5deaf32c23ff1887eba386f93a4318 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index ffa1fe60aba81fe38c40293a53ca81cea111d2bc..7fa675e8d265ea3df68badbb8b499090ebc7a406 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -584,6 +584,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 9aa2652edb0868e7cde37be0defd0075cdc87f61..95c0c5c05ea15d3f6aa6b346d36bd5b024f9d247 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index eaf532eb266f4a0bf70156ec34eec1d8bb30eb6f..d89067b9b2c932d43ac6643edcbfe0d35122c9e1 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -593,6 +593,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h index d66f45e2f0ff5babba3042d9c8f9cd058b3c07d6..c8d085fadbf78954a1a4855b791d66c1e57c14e1 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h @@ -662,6 +662,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h index a529d6f5a568546de73198413899adb9f1067e14..6faad15106be1fe567de07d0338a6670c00572c3 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 4716101a3763a7dc95aaa97e20249ce7ff9b6a90..3d088639b161d9d1343ed93a32bf990e6a5452e4 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -649,6 +649,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index d06c258dd34f05612361f07c5da145316c65ec54..b95998e3972ba13ec0c4ce96e18648ccac1f1dfd 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index dd3f38b56bfa5525776ee1e1925dc634c1627347..5a47dd7588346307686381741609a0b2362ddbb7 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -642,6 +642,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index d06c258dd34f05612361f07c5da145316c65ec54..b95998e3972ba13ec0c4ce96e18648ccac1f1dfd 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 78717d4283fbc05bb2b55624140e1d349470d104..71f8f62edccaa0e8b46fcc652e8ec5a11c487f03 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -643,6 +643,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index e7a2485c802010e0db6c8f53028bf80b48a9c4e6..c984b940fa989afbba14614e4181894a8e4486b4 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -332,7 +332,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 60610f7dce6e5e94160be67b2665a35862fb28ab..eb3e3e430949cfd418cead643373b2d0f80b064d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -662,6 +662,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 492677ea2bfa826ad0453d5f237e35218a7388be..d7fb200cb0eb5c0bb11989dc9870e865e8dac326 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 25090738e9afced9618a0dc08d28cc18620ce618..ceb79512402d6289a17fe856b4cec0a7ec0462a5 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -596,6 +596,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index a9020e110f3b6bc75d5ad82f2cf6d7282eac1159..c22d6add27f136702fbdb18ec925c56ac23c6666 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 9fe6a9160f7cb029627220e52ba4ac673ffd242b..a6da3cb7a9640edc689353768206a6aafb2bcba7 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -589,6 +589,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index d2fe7ae861307d39c3c4b2b11df483a3f77dbceb..c85d848d0055c9e43ab98d980eeb56a71db93128 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index 83f517fa63288a3cf300fc70a51bf680aa22e24f..9740a45d71266cff197b8e5b46ce20bf0c87d50b 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -598,6 +598,9 @@ * is enabled then it also applies to Z_PROBE_SPEED_SLOW. */ +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + // Enable if you have a Z probe mounted on a sled like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h index b64d4915274a4a71c733d6e656b54762c39c5a43..605eaee934fd2ed244e75273fd10a7b5b6e09b33 100644 --- a/Marlin/example_configurations/wt150/Configuration_adv.h +++ b/Marlin/example_configurations/wt150/Configuration_adv.h @@ -327,7 +327,11 @@ // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 -#endif //DUAL_X_CARRIAGE +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID // @section homing diff --git a/Marlin/pins_MEGATRONICS_3.h b/Marlin/pins_MEGATRONICS_3.h index cc1c947bd4533a00ebb395c1bfbab6dcb33f6b78..419f80ba596ee8afd2ca70c86d13ba9b24df08af 100644 --- a/Marlin/pins_MEGATRONICS_3.h +++ b/Marlin/pins_MEGATRONICS_3.h @@ -61,8 +61,6 @@ #define Z_MIN_PROBE_PIN 19 #endif -#define SLED_PIN -1 - // // Steppers // diff --git a/Marlin/pins_RAMBO.h b/Marlin/pins_RAMBO.h index 8289940752870db5994d0ba46bf006e6ae8062ba..e4df16677f70994918e7e0b9df78d23cac95430c 100755 --- a/Marlin/pins_RAMBO.h +++ b/Marlin/pins_RAMBO.h @@ -63,10 +63,6 @@ #define Z_MIN_PROBE_PIN 30 #endif -#if ENABLED(Z_PROBE_SLED) - #define SLED_PIN -1 -#endif - // // Limit Switches // diff --git a/Marlin/pins_RAMPS.h b/Marlin/pins_RAMPS.h index da14a6dab2ec4f5accf5456db3542b81b95f6e56..767e9908571e59db58421b5a136103c0e22cc057 100644 --- a/Marlin/pins_RAMPS.h +++ b/Marlin/pins_RAMPS.h @@ -85,8 +85,6 @@ #define Z_MIN_PROBE_PIN 32 #endif -#define SLED_PIN -1 - // // Steppers // diff --git a/Marlin/pins_SANGUINOLOLU_11.h b/Marlin/pins_SANGUINOLOLU_11.h index b7315fba754fdd31a9006ccdbaa8f7e8d5a20308..62d92b61e814eaa330468e762c5e6a116c47a19f 100644 --- a/Marlin/pins_SANGUINOLOLU_11.h +++ b/Marlin/pins_SANGUINOLOLU_11.h @@ -41,13 +41,6 @@ #define Y_STOP_PIN 19 #define Z_STOP_PIN 20 -// -// Z Probe (when not Z_MIN_PIN) -// -#if ENABLED(Z_PROBE_SLED) - #define SLED_PIN -1 -#endif - // // Steppers // diff --git a/Marlin/pins_SCOOVO_X9H.h b/Marlin/pins_SCOOVO_X9H.h index dcb36a24a991ddc4bff9e17e739873786f8076d1..a5ef15236b9a3d3482692e3b393590109d3d08ca 100644 --- a/Marlin/pins_SCOOVO_X9H.h +++ b/Marlin/pins_SCOOVO_X9H.h @@ -57,8 +57,6 @@ #define Z_MIN_PROBE_PIN 30 #endif -#define SLED_PIN -1 - // // Steppers // diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index ed235ca345a0d3458bda182f174ecf267cdf62fa..11d20251f3e0a3d0f227ce0342fd4e43ab7b9748 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1076,6 +1076,9 @@ void Stepper::init() { #if HAS_E3_STEP E_AXIS_INIT(3); #endif + #if HAS_E4_STEP + E_AXIS_INIT(4); + #endif // waveform generation = 0100 = CTC CBI(TCCR1B, WGM13); @@ -1461,22 +1464,34 @@ void Stepper::report_positions() { void Stepper::microstep_init() { SET_OUTPUT(X_MS1_PIN); SET_OUTPUT(X_MS2_PIN); - #if HAS_MICROSTEPS_Y + #if HAS_Y_MICROSTEPS SET_OUTPUT(Y_MS1_PIN); SET_OUTPUT(Y_MS2_PIN); #endif - #if HAS_MICROSTEPS_Z + #if HAS_Z_MICROSTEPS SET_OUTPUT(Z_MS1_PIN); SET_OUTPUT(Z_MS2_PIN); #endif - #if HAS_MICROSTEPS_E0 + #if HAS_E0_MICROSTEPS SET_OUTPUT(E0_MS1_PIN); SET_OUTPUT(E0_MS2_PIN); #endif - #if HAS_MICROSTEPS_E1 + #if HAS_E1_MICROSTEPS SET_OUTPUT(E1_MS1_PIN); SET_OUTPUT(E1_MS2_PIN); #endif + #if HAS_E2_MICROSTEPS + SET_OUTPUT(E2_MS1_PIN); + SET_OUTPUT(E2_MS2_PIN); + #endif + #if HAS_E3_MICROSTEPS + SET_OUTPUT(E3_MS1_PIN); + SET_OUTPUT(E3_MS2_PIN); + #endif + #if HAS_E4_MICROSTEPS + SET_OUTPUT(E4_MS1_PIN); + SET_OUTPUT(E4_MS2_PIN); + #endif static const uint8_t microstep_modes[] = MICROSTEP_MODES; for (uint16_t i = 0; i < COUNT(microstep_modes); i++) microstep_mode(i, microstep_modes[i]); @@ -1484,33 +1499,51 @@ void Stepper::report_positions() { void Stepper::microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if (ms1 >= 0) switch (driver) { - case 0: digitalWrite(X_MS1_PIN, ms1); break; - #if HAS_MICROSTEPS_Y - case 1: digitalWrite(Y_MS1_PIN, ms1); break; + case 0: WRITE(X_MS1_PIN, ms1); break; + #if HAS_Y_MICROSTEPS + case 1: WRITE(Y_MS1_PIN, ms1); break; + #endif + #if HAS_Z_MICROSTEPS + case 2: WRITE(Z_MS1_PIN, ms1); break; + #endif + #if HAS_E0_MICROSTEPS + case 3: WRITE(E0_MS1_PIN, ms1); break; + #endif + #if HAS_E1_MICROSTEPS + case 4: WRITE(E1_MS1_PIN, ms1); break; #endif - #if HAS_MICROSTEPS_Z - case 2: digitalWrite(Z_MS1_PIN, ms1); break; + #if HAS_E2_MICROSTEPS + case 5: WRITE(E2_MS1_PIN, ms1); break; #endif - #if HAS_MICROSTEPS_E0 - case 3: digitalWrite(E0_MS1_PIN, ms1); break; + #if HAS_E3_MICROSTEPS + case 6: WRITE(E3_MS1_PIN, ms1); break; #endif - #if HAS_MICROSTEPS_E1 - case 4: digitalWrite(E1_MS1_PIN, ms1); break; + #if HAS_E4_MICROSTEPS + case 7: WRITE(E4_MS1_PIN, ms1); break; #endif } if (ms2 >= 0) switch (driver) { - case 0: digitalWrite(X_MS2_PIN, ms2); break; - #if HAS_MICROSTEPS_Y - case 1: digitalWrite(Y_MS2_PIN, ms2); break; + case 0: WRITE(X_MS2_PIN, ms2); break; + #if HAS_Y_MICROSTEPS + case 1: WRITE(Y_MS2_PIN, ms2); break; #endif - #if HAS_MICROSTEPS_Z - case 2: digitalWrite(Z_MS2_PIN, ms2); break; + #if HAS_Z_MICROSTEPS + case 2: WRITE(Z_MS2_PIN, ms2); break; #endif - #if HAS_MICROSTEPS_E0 - case 3: digitalWrite(E0_MS2_PIN, ms2); break; + #if HAS_E0_MICROSTEPS + case 3: WRITE(E0_MS2_PIN, ms2); break; #endif - #if HAS_MICROSTEPS_E1 - case 4: digitalWrite(E1_MS2_PIN, ms2); break; + #if HAS_E1_MICROSTEPS + case 4: WRITE(E1_MS2_PIN, ms2); break; + #endif + #if HAS_E2_MICROSTEPS + case 5: WRITE(E2_MS2_PIN, ms2); break; + #endif + #if HAS_E3_MICROSTEPS + case 6: WRITE(E3_MS2_PIN, ms2); break; + #endif + #if HAS_E4_MICROSTEPS + case 7: WRITE(E4_MS2_PIN, ms2); break; #endif } } @@ -1530,26 +1563,41 @@ void Stepper::report_positions() { SERIAL_PROTOCOLPGM("X: "); SERIAL_PROTOCOL(READ(X_MS1_PIN)); SERIAL_PROTOCOLLN(READ(X_MS2_PIN)); - #if HAS_MICROSTEPS_Y + #if HAS_Y_MICROSTEPS SERIAL_PROTOCOLPGM("Y: "); SERIAL_PROTOCOL(READ(Y_MS1_PIN)); SERIAL_PROTOCOLLN(READ(Y_MS2_PIN)); #endif - #if HAS_MICROSTEPS_Z + #if HAS_Z_MICROSTEPS SERIAL_PROTOCOLPGM("Z: "); SERIAL_PROTOCOL(READ(Z_MS1_PIN)); SERIAL_PROTOCOLLN(READ(Z_MS2_PIN)); #endif - #if HAS_MICROSTEPS_E0 + #if HAS_E0_MICROSTEPS SERIAL_PROTOCOLPGM("E0: "); SERIAL_PROTOCOL(READ(E0_MS1_PIN)); SERIAL_PROTOCOLLN(READ(E0_MS2_PIN)); #endif - #if HAS_MICROSTEPS_E1 + #if HAS_E1_MICROSTEPS SERIAL_PROTOCOLPGM("E1: "); SERIAL_PROTOCOL(READ(E1_MS1_PIN)); SERIAL_PROTOCOLLN(READ(E1_MS2_PIN)); #endif + #if HAS_E2_MICROSTEPS + SERIAL_PROTOCOLPGM("E2: "); + SERIAL_PROTOCOL(READ(E2_MS1_PIN)); + SERIAL_PROTOCOLLN(READ(E2_MS2_PIN)); + #endif + #if HAS_E3_MICROSTEPS + SERIAL_PROTOCOLPGM("E3: "); + SERIAL_PROTOCOL(READ(E3_MS1_PIN)); + SERIAL_PROTOCOLLN(READ(E3_MS2_PIN)); + #endif + #if HAS_E4_MICROSTEPS + SERIAL_PROTOCOLPGM("E4: "); + SERIAL_PROTOCOL(READ(E4_MS1_PIN)); + SERIAL_PROTOCOLLN(READ(E4_MS2_PIN)); + #endif } #endif // HAS_MICROSTEPS diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index 05ec9a30a93e1160931e8cbe23891c604fdb6fed..3777cf2e42abd464f9417a0737503d2bc0099721 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -226,6 +226,15 @@ #define HEATER_3_RAW_LO_TEMP 0 #endif #endif +#ifndef HEATER_4_RAW_HI_TEMP + #ifdef HEATER_4_USES_THERMISTOR + #define HEATER_4_RAW_HI_TEMP 0 + #define HEATER_4_RAW_LO_TEMP 16383 + #else + #define HEATER_4_RAW_HI_TEMP 16383 + #define HEATER_4_RAW_LO_TEMP 0 + #endif +#endif #ifndef HEATER_BED_RAW_HI_TEMP #ifdef BED_USES_THERMISTOR #define HEATER_BED_RAW_HI_TEMP 0