Gradual step towards EXTRUDERS 0 support

This commit is contained in:
Scott Lahteine 2019-03-01 01:51:24 -06:00
parent 99d0022fae
commit 2f1e1dcb42
10 changed files with 191 additions and 145 deletions

View file

@ -53,6 +53,7 @@ void controllerfan_update() {
#if HAS_Z3_ENABLE #if HAS_Z3_ENABLE
|| Z3_ENABLE_READ == Z_ENABLE_ON || Z3_ENABLE_READ == Z_ENABLE_ON
#endif #endif
#if E_STEPPERS
|| E0_ENABLE_READ == E_ENABLE_ON || E0_ENABLE_READ == E_ENABLE_ON
#if E_STEPPERS > 1 #if E_STEPPERS > 1
|| E1_ENABLE_READ == E_ENABLE_ON || E1_ENABLE_READ == E_ENABLE_ON
@ -64,11 +65,12 @@ void controllerfan_update() {
|| E4_ENABLE_READ == E_ENABLE_ON || E4_ENABLE_READ == E_ENABLE_ON
#if E_STEPPERS > 5 #if E_STEPPERS > 5
|| E5_ENABLE_READ == E_ENABLE_ON || E5_ENABLE_READ == E_ENABLE_ON
#endif #endif // E_STEPPERS > 5
#endif #endif // E_STEPPERS > 4
#endif #endif // E_STEPPERS > 3
#endif #endif // E_STEPPERS > 2
#endif #endif // E_STEPPERS > 1
#endif // E_STEPPERS
) { ) {
lastMotorOn = ms; //... set time to NOW so the fan will turn on lastMotorOn = ms; //... set time to NOW so the fan will turn on
} }

View file

@ -64,6 +64,7 @@ bool Power::is_power_needed() {
#if HAS_Z2_ENABLE #if HAS_Z2_ENABLE
|| Z2_ENABLE_READ == Z_ENABLE_ON || Z2_ENABLE_READ == Z_ENABLE_ON
#endif #endif
#if E_STEPPERS
|| E0_ENABLE_READ == E_ENABLE_ON || E0_ENABLE_READ == E_ENABLE_ON
#if E_STEPPERS > 1 #if E_STEPPERS > 1
|| E1_ENABLE_READ == E_ENABLE_ON || E1_ENABLE_READ == E_ENABLE_ON
@ -75,11 +76,12 @@ bool Power::is_power_needed() {
|| E4_ENABLE_READ == E_ENABLE_ON || E4_ENABLE_READ == E_ENABLE_ON
#if E_STEPPERS > 5 #if E_STEPPERS > 5
|| E5_ENABLE_READ == E_ENABLE_ON || E5_ENABLE_READ == E_ENABLE_ON
#endif #endif // E_STEPPERS > 5
#endif #endif // E_STEPPERS > 4
#endif #endif // E_STEPPERS > 3
#endif #endif // E_STEPPERS > 2
#endif #endif // E_STEPPERS > 1
#endif // E_STEPPERS
) return true; ) return true;
HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true; HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true;

View file

@ -232,6 +232,7 @@
#endif #endif
break; break;
case E_AXIS: { case E_AXIS: {
#if E_STEPPERS
const int8_t target_extruder = get_target_extruder_from_command(); const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return; if (target_extruder < 0) return;
switch (target_extruder) { switch (target_extruder) {
@ -254,6 +255,7 @@
case 5: TMC_SET_PWMTHRS_E(5); break; case 5: TMC_SET_PWMTHRS_E(5); break;
#endif #endif
} }
#endif // E_STEPPERS
} break; } break;
} }
} }
@ -280,7 +282,7 @@
#if AXIS_HAS_STEALTHCHOP(Z3) #if AXIS_HAS_STEALTHCHOP(Z3)
TMC_SAY_PWMTHRS(Z,Z3); TMC_SAY_PWMTHRS(Z,Z3);
#endif #endif
#if AXIS_HAS_STEALTHCHOP(E0) #if E_STEPPERS && AXIS_HAS_STEALTHCHOP(E0)
TMC_SAY_PWMTHRS_E(0); TMC_SAY_PWMTHRS_E(0);
#endif #endif
#if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1) #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)

View file

@ -370,6 +370,16 @@
* *
*/ */
#if EXTRUDERS == 0
#undef DISTINCT_E_FACTORS
#undef SINGLENOZZLE
#undef SWITCHING_EXTRUDER
#undef SWITCHING_NOZZLE
#undef MIXING_EXTRUDER
#undef MK2_MULTIPLEXER
#undef PRUSA_MMU2
#endif
#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS #if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS
#if EXTRUDERS > 4 #if EXTRUDERS > 4
#define E_STEPPERS 3 #define E_STEPPERS 3

View file

@ -43,6 +43,16 @@
#define NOT_A_PIN 0 // For PINS_DEBUGGING #define NOT_A_PIN 0 // For PINS_DEBUGGING
#endif #endif
#if EXTRUDERS == 0
#define NO_VOLUMETRICS
#undef FWRETRACT
#undef LIN_ADVANCE
#undef ADVANCED_PAUSE_FEATURE
#undef DISABLE_INACTIVE_EXTRUDER
#undef EXTRUDER_RUNOUT_PREVENT
#undef FILAMENT_LOAD_UNLOAD_GCODES
#endif
#define HAS_CLASSIC_JERK (IS_KINEMATIC || DISABLED(JUNCTION_DEVIATION)) #define HAS_CLASSIC_JERK (IS_KINEMATIC || DISABLED(JUNCTION_DEVIATION))
/** /**

View file

@ -475,7 +475,7 @@ DEFINE_PIDTEMP_FUNCS(0);
#endif // E_STEPPERS > 4 #endif // E_STEPPERS > 4
#endif // E_STEPPERS > 3 #endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2 #endif // E_STEPPERS > 2
#else #elif E_STEPPERS
MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, 999); MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, 999);
#endif #endif
@ -525,7 +525,7 @@ DEFINE_PIDTEMP_FUNCS(0);
#endif // E_STEPPERS > 4 #endif // E_STEPPERS > 4
#endif // E_STEPPERS > 3 #endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2 #endif // E_STEPPERS > 2
#else #elif E_STEPPERS
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates);
#endif #endif
@ -588,7 +588,7 @@ DEFINE_PIDTEMP_FUNCS(0);
#endif // E_STEPPERS > 4 #endif // E_STEPPERS > 4
#endif // E_STEPPERS > 3 #endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2 #endif // E_STEPPERS > 2
#else #elif E_STEPPERS
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning);
#endif #endif

View file

@ -104,6 +104,7 @@ void _menu_temp_filament_op(const AdvancedPauseMode mode, const int8_t extruder)
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb);
END_MENU(); END_MENU();
} }
#if E_STEPPERS
void menu_temp_e0_filament_change() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); } void menu_temp_e0_filament_change() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); }
void menu_temp_e0_filament_load() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); } void menu_temp_e0_filament_load() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); }
void menu_temp_e0_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); } void menu_temp_e0_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); }
@ -130,6 +131,7 @@ void menu_temp_e0_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MOD
#endif // E_STEPPERS > 3 #endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2 #endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1 #endif // E_STEPPERS > 1
#endif // E_STEPPERS
/** /**
* *

View file

@ -43,6 +43,7 @@
#endif #endif
// Refresh the E factor after changing flow // Refresh the E factor after changing flow
#if EXTRUDERS
void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); } void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
#if EXTRUDERS > 1 #if EXTRUDERS > 1
void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); } void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); }
@ -60,6 +61,7 @@ void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
#endif // EXTRUDERS > 3 #endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2 #endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1 #endif // EXTRUDERS > 1
#endif // EXTRUDERS
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
@ -174,7 +176,7 @@ void menu_tune() {
// //
#if EXTRUDERS == 1 #if EXTRUDERS == 1
MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0);
#else // EXTRUDERS > 1 #elif EXTRUDERS
MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor); MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor);
#define EDIT_FLOW(N) MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_LCD_N##N, &planner.flow_percentage[N], 10, 999, _lcd_refresh_e_factor_##N) #define EDIT_FLOW(N) MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_LCD_N##N, &planner.flow_percentage[N], 10, 999, _lcd_refresh_e_factor_##N)
EDIT_FLOW(0); EDIT_FLOW(0);
@ -191,7 +193,7 @@ void menu_tune() {
#endif // EXTRUDERS > 4 #endif // EXTRUDERS > 4
#endif // EXTRUDERS > 3 #endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2 #endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1 #endif // EXTRUDERS
// //
// Babystep X: // Babystep X:

View file

@ -628,8 +628,12 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) #define NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0)
#define REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) #define REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0)
#endif #endif
#else #elif E_STEPPERS
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
#define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR)
#else
#define E_STEP_WRITE(E,V) NOOP
#define NORM_E_DIR(E) NOOP
#define REV_E_DIR(E) NOOP
#endif #endif

View file

@ -133,25 +133,28 @@
|| (ENABLED(SWITCHING_EXTRUDER) && E_STEPPERS > N) \ || (ENABLED(SWITCHING_EXTRUDER) && E_STEPPERS > N) \
|| (DISABLED(SWITCHING_EXTRUDER) && DISABLED(MIXING_EXTRUDER) && EXTRUDERS > N) || (DISABLED(SWITCHING_EXTRUDER) && DISABLED(MIXING_EXTRUDER) && EXTRUDERS > N)
#if PIN_EXISTS(E0_CS)
#define _E0_CS E0_CS_PIN,
#else
#define _E0_CS #define _E0_CS
#define _E0_MS1
#define _E0_MS2
#define _E0_MS3
#if E_NEEDED(0)
#if PIN_EXISTS(E0_CS)
#undef _E0_CS
#define _E0_CS E0_CS_PIN,
#endif #endif
#if PIN_EXISTS(E0_MS1) #if PIN_EXISTS(E0_MS1)
#undef _E0_MS1
#define _E0_MS1 E0_MS1_PIN, #define _E0_MS1 E0_MS1_PIN,
#else
#define _E0_MS1
#endif #endif
#if PIN_EXISTS(E0_MS2) #if PIN_EXISTS(E0_MS2)
#undef _E0_MS2
#define _E0_MS2 E0_MS2_PIN, #define _E0_MS2 E0_MS2_PIN,
#else
#define _E0_MS2
#endif #endif
#if PIN_EXISTS(E0_MS3) #if PIN_EXISTS(E0_MS3)
#undef _E0_MS3
#define _E0_MS3 E0_MS3_PIN, #define _E0_MS3 E0_MS3_PIN,
#else #endif
#define _E0_MS3
#endif #endif
#define _E1_CS #define _E1_CS
@ -278,13 +281,18 @@
// E Steppers // E Steppers
// //
#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, _E0_CS _E0_MS1 _E0_MS2 _E0_MS3 #define _E0_PINS
#define _E1_PINS #define _E1_PINS
#define _E2_PINS #define _E2_PINS
#define _E3_PINS #define _E3_PINS
#define _E4_PINS #define _E4_PINS
#define _E5_PINS #define _E5_PINS
#if EXTRUDERS
#undef _E0_PINS
#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, _E0_CS _E0_MS1 _E0_MS2 _E0_MS3
#endif
#if ENABLED(SWITCHING_EXTRUDER) #if ENABLED(SWITCHING_EXTRUDER)
// Tools 0 and 1 use E0 // Tools 0 and 1 use E0
#if EXTRUDERS > 2 // Tools 2 and 3 use E1 #if EXTRUDERS > 2 // Tools 2 and 3 use E1
@ -320,13 +328,16 @@
// Heaters, Fans, Temp Sensors // Heaters, Fans, Temp Sensors
// //
#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN), #define _H0_PINS
#define _H1_PINS #define _H1_PINS
#define _H2_PINS #define _H2_PINS
#define _H3_PINS #define _H3_PINS
#define _H4_PINS #define _H4_PINS
#define _H5_PINS #define _H5_PINS
#if HOTENDS
#undef _H0_PINS
#define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
#if HOTENDS > 1 #if HOTENDS > 1
#undef _H1_PINS #undef _H1_PINS
#define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN), #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
@ -347,6 +358,7 @@
#endif // HOTENDS > 3 #endif // HOTENDS > 3
#endif // HOTENDS > 2 #endif // HOTENDS > 2
#endif // HOTENDS > 1 #endif // HOTENDS > 1
#endif // HOTENDS
#define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN), #define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),