From edf18977c1cc2113820a10faabbe1237fbb70996 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 6 Apr 2017 17:15:09 -0500 Subject: [PATCH 1/4] Patch pins files hotends/e-steppers sanity check --- Marlin/pins_AZTEEG_X3.h | 4 ++-- Marlin/pins_BAM_DICE_DUE.h | 4 ++-- Marlin/pins_FELIX2.h | 4 ++-- Marlin/pins_MEGACONTROLLER.h | 4 ++-- Marlin/pins_MINITRONICS.h | 4 ++-- Marlin/pins_MKS_13.h | 4 ++-- Marlin/pins_MKS_BASE.h | 4 ++-- Marlin/pins_RUMBA.h | 4 ++-- Marlin/pins_SAINSMART_2IN1.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Marlin/pins_AZTEEG_X3.h b/Marlin/pins_AZTEEG_X3.h index 26f274e6fe..364697d608 100644 --- a/Marlin/pins_AZTEEG_X3.h +++ b/Marlin/pins_AZTEEG_X3.h @@ -24,8 +24,8 @@ * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments */ -#if HOTENDS > 2 - #error "Azteeg X3 supports up to 2 hotends. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Azteeg X3 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "Azteeg X3" diff --git a/Marlin/pins_BAM_DICE_DUE.h b/Marlin/pins_BAM_DICE_DUE.h index 488861d5c9..0da4f08c40 100644 --- a/Marlin/pins_BAM_DICE_DUE.h +++ b/Marlin/pins_BAM_DICE_DUE.h @@ -24,8 +24,8 @@ * BAM&DICE Due (Arduino Mega) pin assignments */ -#if HOTENDS > 2 - #error "2PrintBeta Due supports up to 2 hotends. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "2PrintBeta Due supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "2PrintBeta Due" diff --git a/Marlin/pins_FELIX2.h b/Marlin/pins_FELIX2.h index 45bf257c42..28894fe97a 100644 --- a/Marlin/pins_FELIX2.h +++ b/Marlin/pins_FELIX2.h @@ -24,8 +24,8 @@ * FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments */ -#if HOTENDS > 2 - #error "Felix 2.0+ supports up to 2 hotends. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Felix 2.0+ supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "Felix 2.0+" diff --git a/Marlin/pins_MEGACONTROLLER.h b/Marlin/pins_MEGACONTROLLER.h index 10ffe3283a..f15b231fc8 100644 --- a/Marlin/pins_MEGACONTROLLER.h +++ b/Marlin/pins_MEGACONTROLLER.h @@ -28,8 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if E_STEPPERS > 2 || HOTENDS > 2 - #error "Mega Controller supports up to 2 hotends / E-steppers. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Mega Controller supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "Mega Controller" diff --git a/Marlin/pins_MINITRONICS.h b/Marlin/pins_MINITRONICS.h index 7ee89a0a45..d9a03c41fc 100644 --- a/Marlin/pins_MINITRONICS.h +++ b/Marlin/pins_MINITRONICS.h @@ -28,8 +28,8 @@ #error "Oops! Make sure you have 'Minitronics' selected from the 'Tools -> Boards' menu." #endif -#if HOTENDS > 2 - #error "Minitronics supports up to 2 hotends. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Minitronics supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "Minitronics v1.0 / v1.1" diff --git a/Marlin/pins_MKS_13.h b/Marlin/pins_MKS_13.h index ce1217157c..8b466c652a 100644 --- a/Marlin/pins_MKS_13.h +++ b/Marlin/pins_MKS_13.h @@ -29,8 +29,8 @@ * MKS v1.4 (Extruder, Extruder, Fan, Bed) */ -#if HOTENDS > 2 - #error "MKS 1.3/1.4 supports up to 2 hotends. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS 1.3/1.4 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "MKS > v1.3" diff --git a/Marlin/pins_MKS_BASE.h b/Marlin/pins_MKS_BASE.h index c098341530..12bf8b7491 100644 --- a/Marlin/pins_MKS_BASE.h +++ b/Marlin/pins_MKS_BASE.h @@ -24,8 +24,8 @@ * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments */ -#if HOTENDS > 2 - #error "MKS BASE 1.0 supports up to 2 hotends. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS BASE 1.0 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "MKS BASE 1.0" diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h index 5d221cc290..376197c556 100644 --- a/Marlin/pins_RUMBA.h +++ b/Marlin/pins_RUMBA.h @@ -28,8 +28,8 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if E_STEPPERS > 3 || HOTENDS > 3 - #error "RUMBA supports up to 3 hotends / E-steppers. Comment this line to keep going." +#if HOTENDS > 3 || E_STEPPERS > 3 + #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue." #endif #define DEFAULT_MACHINE_NAME "Rumba" diff --git a/Marlin/pins_SAINSMART_2IN1.h b/Marlin/pins_SAINSMART_2IN1.h index b418308da8..bf01a9e051 100644 --- a/Marlin/pins_SAINSMART_2IN1.h +++ b/Marlin/pins_SAINSMART_2IN1.h @@ -24,8 +24,8 @@ * Sainsmart 2-in-1 pin assignments */ -#if HOTENDS > 2 - #error "Sainsmart 2-in-1 supports up to 2 hotends. Comment this line to keep going." +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Sainsmart 2-in-1 supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif #define BOARD_NAME "Sainsmart" From 2a84122edd48e5fd31a8236028dd29f9cdcec241 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 6 Apr 2017 16:45:29 -0500 Subject: [PATCH 2/4] Configuration changes to support 5 extruders --- Marlin/Conditionals_post.h | 28 ++++++++++++++++-- Marlin/Configuration.h | 4 +++ Marlin/Configuration_adv.h | 1 + Marlin/SanityCheck.h | 29 ++++++++++++++++--- .../Cartesio/Configuration.h | 3 ++ .../Cartesio/Configuration_adv.h | 1 + .../Felix/Configuration.h | 4 +++ .../Felix/Configuration_adv.h | 1 + .../Felix/DUAL/Configuration.h | 4 +++ .../Hephestos/Configuration.h | 3 ++ .../Hephestos/Configuration_adv.h | 1 + .../Hephestos_2/Configuration.h | 28 ++++++++++-------- .../Hephestos_2/Configuration_adv.h | 1 + .../K8200/Configuration.h | 4 +++ .../K8200/Configuration_adv.h | 1 + .../K8400/Configuration.h | 4 +++ .../K8400/Configuration_adv.h | 1 + .../K8400/Dual-head/Configuration.h | 4 +++ .../RepRapWorld/Megatronics/Configuration.h | 4 +++ .../RigidBot/Configuration.h | 4 +++ .../RigidBot/Configuration_adv.h | 1 + .../SCARA/Configuration.h | 4 +++ .../SCARA/Configuration_adv.h | 1 + .../TAZ4/Configuration.h | 3 ++ .../TAZ4/Configuration_adv.h | 1 + .../TinyBoy2/Configuration.h | 4 +++ .../TinyBoy2/Configuration_adv.h | 1 + .../WITBOX/Configuration.h | 3 ++ .../WITBOX/Configuration_adv.h | 1 + .../adafruit/ST7565/Configuration.h | 4 +++ .../delta/flsun_kossel_mini/Configuration.h | 4 +++ .../flsun_kossel_mini/Configuration_adv.h | 1 + .../delta/generic/Configuration.h | 4 +++ .../delta/generic/Configuration_adv.h | 1 + .../delta/kossel_mini/Configuration.h | 4 +++ .../delta/kossel_mini/Configuration_adv.h | 1 + .../delta/kossel_pro/Configuration.h | 4 +++ .../delta/kossel_pro/Configuration_adv.h | 1 + .../delta/kossel_xl/Configuration.h | 4 +++ .../delta/kossel_xl/Configuration_adv.h | 1 + .../makibox/Configuration.h | 4 +++ .../makibox/Configuration_adv.h | 1 + .../tvrrug/Round2/Configuration.h | 4 +++ .../tvrrug/Round2/Configuration_adv.h | 1 + 44 files changed, 169 insertions(+), 19 deletions(-) diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index ca36789960..a0f7233bb3 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -279,6 +279,18 @@ #define HEATER_3_USES_THERMISTOR #endif + #if TEMP_SENSOR_4 <= -2 + #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_4" + #elif TEMP_SENSOR_4 == -1 + #define HEATER_4_USES_AD595 + #elif TEMP_SENSOR_4 == 0 + #undef HEATER_4_MINTEMP + #undef HEATER_4_MAXTEMP + #elif TEMP_SENSOR_4 > 0 + #define THERMISTORHEATER_4 TEMP_SENSOR_4 + #define HEATER_4_USES_THERMISTOR + #endif + #if TEMP_SENSOR_BED <= -2 #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_BED" #elif TEMP_SENSOR_BED == -1 @@ -427,16 +439,19 @@ #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_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2) #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)) #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)) #define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)) + #define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)) #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3) #define AUTO_1_IS_0 (E1_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) #define AUTO_2_IS_0 (E2_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) @@ -444,6 +459,10 @@ #define AUTO_3_IS_0 (E3_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) #define AUTO_3_IS_1 (E3_AUTO_FAN_PIN == E1_AUTO_FAN_PIN) #define AUTO_3_IS_2 (E3_AUTO_FAN_PIN == E2_AUTO_FAN_PIN) + #define AUTO_4_IS_0 (E4_AUTO_FAN_PIN == E0_AUTO_FAN_PIN) + #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) #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) @@ -543,9 +562,12 @@ #define WRITE_HEATER_2(v) WRITE(HEATER_2_PIN, v) #if HOTENDS > 3 #define WRITE_HEATER_3(v) WRITE(HEATER_3_PIN, v) - #endif - #endif - #endif + #if HOTENDS > 4 + #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, v) + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if ENABLED(HEATERS_PARALLEL) #define WRITE_HEATER_0(v) { WRITE_HEATER_0P(v); WRITE_HEATER_1(v); } #else diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bc85cc2fb8..15d7238f5c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -752,6 +755,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 955110dfd5..660f498460 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 301f32735d..63abf9c7cf 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -309,8 +309,8 @@ */ #if EXTRUDERS > 1 - #if EXTRUDERS > 4 - #error "The maximum number of EXTRUDERS in Marlin is 4." + #if EXTRUDERS > 5 + #error "Marlin supports a maximum of 5 EXTRUDERS." #endif #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) @@ -800,19 +800,34 @@ static_assert(1 >= 0 #endif #if HOTENDS > 3 #if TEMP_SENSOR_3 == 0 - #error "TEMP_SENSOR_3 is required with 4 HOTENDS." + #error "TEMP_SENSOR_3 is required with 4 or more HOTENDS." #elif !HAS_HEATER_3 #error "HEATER_3_PIN not defined for this board." #elif !PIN_EXISTS(TEMP_3) #error "TEMP_3_PIN not defined for this board." #endif + #if HOTENDS > 4 + #if TEMP_SENSOR_4 == 0 + #error "TEMP_SENSOR_4 is required with 5 HOTENDS." + #elif !HAS_HEATER_4 + #error "HEATER_4_PIN not defined for this board." + #elif !PIN_EXISTS(TEMP_4) + #error "TEMP_4_PIN not defined for this board." + #endif + #elif TEMP_SENSOR_4 != 0 + #error "TEMP_SENSOR_4 shouldn't be set with only 4 extruders." + #endif #elif TEMP_SENSOR_3 != 0 #error "TEMP_SENSOR_3 shouldn't be set with only 3 extruders." + #elif TEMP_SENSOR_4 != 0 + #error "TEMP_SENSOR_4 shouldn't be set with only 3 extruders." #endif #elif TEMP_SENSOR_2 != 0 #error "TEMP_SENSOR_2 shouldn't be set with only 2 extruders." #elif TEMP_SENSOR_3 != 0 #error "TEMP_SENSOR_3 shouldn't be set with only 2 extruders." + #elif TEMP_SENSOR_4 != 0 + #error "TEMP_SENSOR_4 shouldn't be set with only 2 extruders." #endif #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) #error "TEMP_SENSOR_1 shouldn't be set with only 1 extruder." @@ -820,6 +835,8 @@ static_assert(1 >= 0 #error "TEMP_SENSOR_2 shouldn't be set with only 1 extruder." #elif TEMP_SENSOR_3 != 0 #error "TEMP_SENSOR_3 shouldn't be set with only 1 extruder." +#elif TEMP_SENSOR_4 != 0 + #error "TEMP_SENSOR_4 shouldn't be set with only 1 extruder." #endif #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0 @@ -853,7 +870,11 @@ static_assert(1 >= 0 /** * Test Extruder Pins */ -#if EXTRUDERS > 3 +#if EXTRUDERS > 4 + #if !PIN_EXISTS(E4_STEP) || !PIN_EXISTS(E4_DIR) || !PIN_EXISTS(E4_ENABLE) + #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board." + #endif +#elif EXTRUDERS > 3 #if !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE) #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board." #endif diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index a11bb7d70b..05c1036bb2 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -255,6 +255,7 @@ #define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_2 1 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -283,6 +284,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -752,6 +754,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index a9d497e382..2bda7419ab 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -221,6 +221,7 @@ //#define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 35 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index f327479d11..1b3704f2e2 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -735,6 +738,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index d1204fc630..e46b3bd5b5 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index bf60c1be59..771ece9b3e 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 1 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -735,6 +738,7 @@ #define INVERT_E1_DIR true #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 3c12c03c98..15ad5c2478 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -257,6 +257,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -285,6 +286,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -744,6 +746,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 86ea0fc565..6b0b8ea722 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index e01cc0ee82..9a415d782d 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -250,10 +250,11 @@ * * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } */ -#define TEMP_SENSOR_0 70 -#define TEMP_SENSOR_1 0 -#define TEMP_SENSOR_2 0 -#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_0 70 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -279,19 +280,21 @@ // to check that the wiring to the thermistor is not broken. // Otherwise this would lead to the heater being powered on all the time. #define HEATER_0_MINTEMP 15 -//#define HEATER_1_MINTEMP 5 -//#define HEATER_2_MINTEMP 5 -//#define HEATER_3_MINTEMP 5 -//#define BED_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! // You should use MINTEMP for thermistor short/failure protection. #define HEATER_0_MAXTEMP 250 -//#define HEATER_1_MAXTEMP 275 -//#define HEATER_2_MAXTEMP 275 -//#define HEATER_3_MAXTEMP 275 -//#define BED_MAXTEMP 150 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define BED_MAXTEMP 150 //=========================================================================== //============================= PID Settings ================================ @@ -746,6 +749,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index cae6946983..fed37e6c2f 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -221,6 +221,7 @@ //#define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 1b6ff0645e..2e78a8c955 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -274,6 +274,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -302,6 +303,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -311,6 +313,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -780,6 +783,7 @@ #define INVERT_E1_DIR true #define INVERT_E2_DIR true #define INVERT_E3_DIR true +#define INVERT_E4_DIR true // @section homing // K8200: it is usual to have clamps for the glass plate on the heatbed diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 734e4c6614..3a12e24fca 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -234,6 +234,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index ac16107a53..98cf55e871 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -752,6 +755,7 @@ #define INVERT_E1_DIR true #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 06f214726e..9064d2ffdf 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index b40eb460e5..381f771f2b 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 5 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -752,6 +755,7 @@ #define INVERT_E1_DIR true #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 20ca7ae84c..c86a4f8a32 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -752,6 +755,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 5ccf190359..4a49291849 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -257,6 +257,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -285,6 +286,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -294,6 +296,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -751,6 +754,7 @@ #define INVERT_E1_DIR true #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index 420b7b8dad..8c21ced0ec 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index f118d361f1..063c1e2471 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -286,6 +286,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -314,6 +315,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -323,6 +325,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -767,6 +770,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 22f7ca0755..68f5e427bb 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 8793a41a15..bf9420d8f0 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 7 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 7 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -773,6 +775,7 @@ #define INVERT_E1_DIR true #define INVERT_E2_DIR true #define INVERT_E3_DIR true +#define INVERT_E4_DIR true // @section homing diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 3fee26733d..f916d6bec6 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -229,6 +229,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 952d95f135..e99110a2f1 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -276,6 +276,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #if ENABLED(TB2_HEATBED_MOD) // K8200 Heatbed 1206/100k/3950K spare part #define TEMP_SENSOR_BED 7 @@ -309,6 +310,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -318,6 +320,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 100 //=========================================================================== @@ -802,6 +805,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index 3bc3a02c79..aba1cb5cd0 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index dd8c3d759a..68c15d8885 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -257,6 +257,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -285,6 +286,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -744,6 +746,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 86ea0fc565..6b0b8ea722 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index e55e394a13..dc612f96b6 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -752,6 +755,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h index f71c9c4c37..310b102e33 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -859,6 +862,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing 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 9982b7d38d..1ebf49c8e0 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 2060eace9e..c14266b676 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 0 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -843,6 +846,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 954c6de6e6..661c87ff67 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 4e82838ede..36b95d8c38 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 11 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -838,6 +841,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 954c6de6e6..661c87ff67 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 2d3b215020..64ebb80fbb 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -258,6 +258,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -286,6 +287,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -295,6 +297,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -845,6 +848,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 9a6cf9f38c..a352286725 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -226,6 +226,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index bb0a094abb..dd35df765d 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -854,6 +857,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index a51d824c22..c9ddf65fe7 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 71df0a5d11..8db0a52a7a 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 12 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -755,6 +758,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 4dd929522e..c05b8b2fe7 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index d2aaaf147f..8285c43a05 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -254,6 +254,7 @@ #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_BED 5 // Dummy thermistor constant temperature readings, for use with 998 and 999 @@ -282,6 +283,7 @@ #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 #define BED_MINTEMP 5 // When temperature exceeds max temp, your heater will be switched off. @@ -291,6 +293,7 @@ #define HEATER_1_MAXTEMP 275 #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -748,6 +751,7 @@ #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false +#define INVERT_E4_DIR false // @section homing diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 3efc63760e..0dc3b7860b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -221,6 +221,7 @@ #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed From 04050237f0e0faa015b7a32109a0e014f48927af Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 6 Apr 2017 16:46:30 -0500 Subject: [PATCH 3/4] Header and pins changes to support 5 extruders --- Marlin/Marlin.h | 10 ++++++++++ Marlin/enum.h | 2 ++ Marlin/language.h | 5 +++++ Marlin/macros.h | 10 ++++++---- Marlin/pins.h | 27 +++++++++++++++------------ Marlin/pins_AZTEEG_X3_PRO.h | 4 ++++ Marlin/stepper_indirection.h | 10 +++++++++- Marlin/thermistortable_20.h | 4 ++++ Marlin/thermistortables.h | 12 +++++++++++- 9 files changed, 66 insertions(+), 18 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index d2b168b427..da2d4d9ea5 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -113,6 +113,8 @@ void manage_inactivity(bool ignore_stepper_queue = false); #define disable_e2() NOOP #define enable_e3() NOOP #define disable_e3() NOOP + #define enable_e4() NOOP + #define disable_e4() NOOP #else // !MIXING_EXTRUDER @@ -148,6 +150,14 @@ void manage_inactivity(bool ignore_stepper_queue = false); #define disable_e3() NOOP #endif + #if E_STEPPERS > 4 && HAS_E4_ENABLE + #define enable_e4() E4_ENABLE_WRITE( E_ENABLE_ON) + #define disable_e4() E4_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_e4() NOOP + #define disable_e4() NOOP + #endif + #endif // !MIXING_EXTRUDER #if ENABLED(G38_PROBE_TARGET) diff --git a/Marlin/enum.h b/Marlin/enum.h index 542f10f8d3..bad4b4dcf7 100755 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -106,6 +106,8 @@ enum TempState { MeasureTemp_2, PrepareTemp_3, MeasureTemp_3, + PrepareTemp_4, + MeasureTemp_4, Prepare_FILWIDTH, Measure_FILWIDTH, StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle diff --git a/Marlin/language.h b/Marlin/language.h index b415adf1b6..96865fb2f7 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -268,22 +268,27 @@ #define MSG_H2 "2" #define MSG_H3 "3" #define MSG_H4 "4" +#define MSG_H5 "5" #define MSG_N1 " 1" #define MSG_N2 " 2" #define MSG_N3 " 3" #define MSG_N4 " 4" +#define MSG_N5 " 5" #define MSG_E1 "E1" #define MSG_E2 "E2" #define MSG_E3 "E3" #define MSG_E4 "E4" +#define MSG_E5 "E5" #define MSG_MOVE_E1 "1" #define MSG_MOVE_E2 "2" #define MSG_MOVE_E3 "3" #define MSG_MOVE_E4 "4" +#define MSG_MOVE_E5 "5" #define MSG_DIAM_E1 " 1" #define MSG_DIAM_E2 " 2" #define MSG_DIAM_E3 " 3" #define MSG_DIAM_E4 " 4" +#define MSG_DIAM_E5 " 5" #include INCLUDE_LANGUAGE diff --git a/Marlin/macros.h b/Marlin/macros.h index 18c5364a16..d84c277d58 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -128,10 +128,12 @@ #define CEILING(x,y) (((x) + (y) - 1) / (y)) -#define MIN3(a, b, c) min(min(a, b), c) -#define MIN4(a, b, c, d) min(min(a, b), min(c, d)) -#define MAX3(a, b, c) max(max(a, b), c) -#define MAX4(a, b, c, d) max(max(a, b), max(c, d)) +#define MIN3(a, b, c) min(min(a, b), c) +#define MIN4(a, b, c, d) min(MIN3(a, b, c), d) +#define MIN5(a, b, c, d, e) min(MIN4(a, b, c, d), e) +#define MAX3(a, b, c) max(max(a, b), c) +#define MAX4(a, b, c, d) max(MAX3(a, b, c), d) +#define MAX5(a, b, c, d, e) max(MAX4(a, b, c, d), e) #define UNEAR_ZERO(x) ((x) < 0.000001) #define NEAR_ZERO(x) WITHIN(x, -0.000001, 0.000001) diff --git a/Marlin/pins.h b/Marlin/pins.h index 6548bec46c..1e2030a867 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -252,6 +252,9 @@ #ifndef TEMP_3_PIN #define TEMP_3_PIN -1 #endif +#ifndef TEMP_4_PIN + #define TEMP_4_PIN -1 +#endif #ifndef TEMP_BED_PIN #define TEMP_BED_PIN -1 #endif @@ -279,7 +282,7 @@ #endif #ifndef MAX_EXTRUDERS - #define MAX_EXTRUDERS 4 + #define MAX_EXTRUDERS 5 #endif // Marlin needs to account for pins that equal -1 @@ -320,10 +323,10 @@ #if EXTRUDERS > 4 #undef _E4_PINS #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, - #endif - #endif - #endif -#endif + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 +#endif // EXTRUDERS > 1 #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN), #define _H1_PINS @@ -343,9 +346,9 @@ #if HOTENDS > 4 #undef _H4_PINS #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN), - #endif - #endif - #endif + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 #elif ENABLED(MIXING_EXTRUDER) #undef _E1_PINS #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, @@ -358,10 +361,10 @@ #if MIXING_STEPPERS > 4 #undef _E4_PINS #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, - #endif - #endif - #endif -#endif + #endif // MIXING_STEPPERS > 4 + #endif // MIXING_STEPPERS > 3 + #endif // MIXING_STEPPERS > 2 +#endif // MIXING_STEPPERS > 1 #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN), diff --git a/Marlin/pins_AZTEEG_X3_PRO.h b/Marlin/pins_AZTEEG_X3_PRO.h index 06c2934104..2d57a588d5 100644 --- a/Marlin/pins_AZTEEG_X3_PRO.h +++ b/Marlin/pins_AZTEEG_X3_PRO.h @@ -24,6 +24,10 @@ * AZTEEG_X3_PRO (Arduino Mega) pin assignments */ +#if HOTENDS > 5 || E_STEPPERS > 5 + #error "Azteeg X3 Pro supports up to 5 hotends / E-steppers. Comment out this line to continue." +#endif + #define BOARD_NAME "Azteeg X3 Pro" #include "pins_RAMPS.h" diff --git a/Marlin/stepper_indirection.h b/Marlin/stepper_indirection.h index 5b9a1715fc..22056072cd 100644 --- a/Marlin/stepper_indirection.h +++ b/Marlin/stepper_indirection.h @@ -388,6 +388,10 @@ #define E_STEP_WRITE(v) E0_STEP_WRITE(v) #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? INVERT_E0_DIR : !INVERT_E0_DIR) #define REV_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? !INVERT_E0_DIR : INVERT_E0_DIR) +#elif EXTRUDERS > 4 + #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 4: E4_STEP_WRITE(v); } } + #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } } + #define REV_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(INVERT_E4_DIR); } } #elif EXTRUDERS > 3 #define E_STEP_WRITE(v) { switch (current_block->active_extruder) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } } #define NORM_E_DIR() { switch (current_block->active_extruder) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } } @@ -408,7 +412,11 @@ #endif #elif ENABLED(MIXING_EXTRUDER) #define E_STEP_WRITE(v) NOOP /* not used for mixing extruders! */ - #if MIXING_STEPPERS > 3 + #if MIXING_STEPPERS > 4 + #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); break; case 4: E4_STEP_WRITE(v); } } + #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); E3_DIR_WRITE(!INVERT_E3_DIR); E4_DIR_WRITE(!INVERT_E4_DIR); } + #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); E3_DIR_WRITE( INVERT_E3_DIR); E4_DIR_WRITE( INVERT_E4_DIR); } + #elif MIXING_STEPPERS > 3 #define En_STEP_WRITE(n,v) { switch (n) { case 0: E0_STEP_WRITE(v); break; case 1: E1_STEP_WRITE(v); break; case 2: E2_STEP_WRITE(v); break; case 3: E3_STEP_WRITE(v); } } #define NORM_E_DIR() { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); E2_DIR_WRITE(!INVERT_E2_DIR); E3_DIR_WRITE(!INVERT_E3_DIR); } #define REV_E_DIR() { E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E1_DIR); E2_DIR_WRITE( INVERT_E2_DIR); E3_DIR_WRITE( INVERT_E3_DIR); } diff --git a/Marlin/thermistortable_20.h b/Marlin/thermistortable_20.h index 65f77cebdb..9ec51d238c 100644 --- a/Marlin/thermistortable_20.h +++ b/Marlin/thermistortable_20.h @@ -39,6 +39,10 @@ #define HEATER_3_RAW_HI_TEMP 16383 #define HEATER_3_RAW_LO_TEMP 0 #endif +#if (THERMISTORHEATER_4 == 20) + #define HEATER_4_RAW_HI_TEMP 16383 + #define HEATER_4_RAW_LO_TEMP 0 +#endif #if (THERMISTORBED == 20) #define HEATER_BED_RAW_HI_TEMP 16383 #define HEATER_BED_RAW_LO_TEMP 0 diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index 421cfb7b77..05ec9a30a9 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -28,7 +28,7 @@ #define OVERSAMPLENR 16 -#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORBED == n) +#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n) // Pt1000 and Pt100 handling // @@ -168,6 +168,16 @@ #define HEATER_3_TEMPTABLE_LEN 0 #endif +#ifdef THERMISTORHEATER_4 + #define HEATER_4_TEMPTABLE TT_NAME(THERMISTORHEATER_4) + #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE) +#elif defined(HEATER_4_USES_THERMISTOR) + #error "No heater 4 thermistor table specified" +#else + #define HEATER_4_TEMPTABLE NULL + #define HEATER_4_TEMPTABLE_LEN 0 +#endif + #ifdef THERMISTORBED #define BEDTEMPTABLE TT_NAME(THERMISTORBED) #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE) From 832064e4f23a3101c573954890dde962f50ad97e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 6 Apr 2017 16:46:52 -0500 Subject: [PATCH 4/4] Implementation changes to support 5 extruders --- Marlin/Marlin_main.cpp | 34 +++-- Marlin/configuration_store.cpp | 154 ++++++++++++----------- Marlin/planner.cpp | 33 ++++- Marlin/temperature.cpp | 207 +++++++++++++++++++------------ Marlin/temperature.h | 2 +- Marlin/ultralcd.cpp | 218 +++++++++++++++++++-------------- 6 files changed, 389 insertions(+), 259 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3efc2d433a..ca056e4189 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10707,9 +10707,12 @@ void prepare_move_to_destination() { || E2_ENABLE_READ == E_ENABLE_ON #if E_STEPPERS > 3 || E3_ENABLE_READ == E_ENABLE_ON - #endif - #endif - #endif + #if E_STEPPERS > 4 + || E4_ENABLE_READ == E_ENABLE_ON + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS > 1 ) { lastMotorOn = ms; //... set time to NOW so the fan will turn on } @@ -10930,6 +10933,7 @@ void enable_all_steppers() { enable_e1(); enable_e2(); enable_e3(); + enable_e4(); } void disable_e_steppers() { @@ -10937,6 +10941,7 @@ void disable_e_steppers() { disable_e1(); disable_e2(); disable_e3(); + disable_e4(); } void disable_all_steppers() { @@ -11135,9 +11140,15 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { oldstatus = E3_ENABLE_READ; enable_e3(); break; - #endif - #endif - #endif + #if E_STEPPERS > 4 + case 4: + oldstatus = E4_ENABLE_READ; + enable_e4(); + break; + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS > 1 } #endif // !SWITCHING_EXTRUDER @@ -11168,9 +11179,14 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { case 3: E3_ENABLE_WRITE(oldstatus); break; - #endif - #endif - #endif + #if E_STEPPERS > 4 + case 4: + E4_ENABLE_WRITE(oldstatus); + break; + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS > 1 } #endif // !SWITCHING_EXTRUDER } diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index c16666c484..ec8f9d1fba 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -36,7 +36,7 @@ * */ -#define EEPROM_VERSION "V31" +#define EEPROM_VERSION "V32" // Change EEPROM version if these are changed: #define EEPROM_OFFSET 100 @@ -44,45 +44,45 @@ /** * V31 EEPROM Layout: * - * 100 Version (char x4) - * 104 EEPROM Checksum (uint16_t) + * 100 Version (char x4) + * 104 EEPROM Checksum (uint16_t) * * 106 E_STEPPERS (uint8_t) - * 107 M92 XYZE planner.axis_steps_per_mm (float x4 ... x7) - * 123 M203 XYZE planner.max_feedrate_mm_s (float x4 ... x7) - * 139 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4 ... x7) - * 155 M204 P planner.acceleration (float) - * 159 M204 R planner.retract_acceleration (float) - * 163 M204 T planner.travel_acceleration (float) - * 167 M205 S planner.min_feedrate_mm_s (float) + * 107 M92 XYZE planner.axis_steps_per_mm (float x4 ... x8) + * 123 M203 XYZE planner.max_feedrate_mm_s (float x4 ... x8) + * 139 M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4 ... x8) + * 155 M204 P planner.acceleration (float) + * 159 M204 R planner.retract_acceleration (float) + * 163 M204 T planner.travel_acceleration (float) + * 167 M205 S planner.min_feedrate_mm_s (float) * 171 M205 T planner.min_travel_feedrate_mm_s (float) - * 175 M205 B planner.min_segment_time (ulong) - * 179 M205 X planner.max_jerk[X_AXIS] (float) - * 183 M205 Y planner.max_jerk[Y_AXIS] (float) - * 187 M205 Z planner.max_jerk[Z_AXIS] (float) - * 191 M205 E planner.max_jerk[E_AXIS] (float) - * 195 M206 XYZ home_offset (float x3) - * 207 M218 XYZ hotend_offset (float x3 per additional hotend) + * 175 M205 B planner.min_segment_time (ulong) + * 179 M205 X planner.max_jerk[X_AXIS] (float) + * 183 M205 Y planner.max_jerk[Y_AXIS] (float) + * 187 M205 Z planner.max_jerk[Z_AXIS] (float) + * 191 M205 E planner.max_jerk[E_AXIS] (float) + * 195 M206 XYZ home_offset (float x3) + * 207 M218 XYZ hotend_offset (float x3 per additional hotend) * - * Mesh bed leveling: - * 219 M420 S from mbl.status (bool) - * 220 mbl.z_offset (float) - * 224 GRID_MAX_POINTS_X (uint8 as set in firmware) - * 225 GRID_MAX_POINTS_Y (uint8 as set in firmware) - * 226 G29 S3 XYZ z_values[][] (float x9, by default, up to float x 81) +288 + * Mesh bed leveling: 43 bytes + * 219 M420 S from mbl.status (bool) + * 220 mbl.z_offset (float) + * 224 GRID_MAX_POINTS_X (uint8_t) + * 225 GRID_MAX_POINTS_Y (uint8_t) + * 226 G29 S3 XYZ z_values[][] (float x9, up to float x 81) +288 * - * AUTO BED LEVELING - * 262 M851 zprobe_zoffset (float) + * AUTO BED LEVELING 4 bytes + * 262 M851 zprobe_zoffset (float) * - * ABL_PLANAR (or placeholder): 36 bytes - * 266 planner.bed_level_matrix (matrix_3x3 = float x9) + * ABL_PLANAR (or placeholder): 36 bytes + * 266 planner.bed_level_matrix (matrix_3x3 = float x9) * - * AUTO_BED_LEVELING_BILINEAR (or placeholder): 47 bytes - * 302 GRID_MAX_POINTS_X (uint8_t) - * 303 GRID_MAX_POINTS_Y (uint8_t) - * 304 bilinear_grid_spacing (int x2) from G29: (B-F)/X, (R-L)/Y - * 308 G29 L F bilinear_start (int x2) - * 312 bed_level_grid[][] (float x9, up to float x256) +988 + * AUTO_BED_LEVELING_BILINEAR (or placeholder): 47 bytes + * 302 GRID_MAX_POINTS_X (uint8_t) + * 303 GRID_MAX_POINTS_Y (uint8_t) + * 304 bilinear_grid_spacing (int x2) + * 308 G29 L F bilinear_start (int x2) + * 312 bed_level_grid[][] (float x9, up to float x256) +988 * * DELTA (if deltabot): 48 bytes * 348 M666 XYZ endstop_adj (float x3) @@ -96,56 +96,57 @@ * 388 M665 J delta_tower_angle_trim[B] (float) * 392 M665 K delta_tower_angle_trim[C] (float) * - * Z_DUAL_ENDSTOPS (if not deltabot): 48 bytes - * 348 M666 Z z_endstop_adj (float) - * --- dummy data (float x11) + * Z_DUAL_ENDSTOPS (if not deltabot): 48 bytes + * 348 M666 Z z_endstop_adj (float) + * --- dummy data (float x11) * - * ULTIPANEL: 6 bytes - * 396 M145 S0 H lcd_preheat_hotend_temp (int x2) - * 400 M145 S0 B lcd_preheat_bed_temp (int x2) - * 404 M145 S0 F lcd_preheat_fan_speed (int x2) + * ULTIPANEL: 6 bytes + * 396 M145 S0 H lcd_preheat_hotend_temp (int x2) + * 400 M145 S0 B lcd_preheat_bed_temp (int x2) + * 404 M145 S0 F lcd_preheat_fan_speed (int x2) * - * PIDTEMP: 66 bytes - * 408 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) - * 424 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) - * 440 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) - * 456 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) - * 472 M301 L lpq_len (int) + * PIDTEMP: 66 bytes + * 408 M301 E0 PIDC Kp[0], Ki[0], Kd[0], Kc[0] (float x4) + * 424 M301 E1 PIDC Kp[1], Ki[1], Kd[1], Kc[1] (float x4) + * 440 M301 E2 PIDC Kp[2], Ki[2], Kd[2], Kc[2] (float x4) + * 456 M301 E3 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) + * 472 M301 E4 PIDC Kp[3], Ki[3], Kd[3], Kc[3] (float x4) + * 488 M301 L lpq_len (int) * * PIDTEMPBED: 12 bytes - * 474 M304 PID thermalManager.bedKp, .bedKi, .bedKd (float x3) + * 490 M304 PID thermalManager.bedKp, .bedKi, .bedKd (float x3) * * DOGLCD: 2 bytes - * 486 M250 C lcd_contrast (int) + * 502 M250 C lcd_contrast (int) * * FWRETRACT: 29 bytes - * 488 M209 S autoretract_enabled (bool) - * 489 M207 S retract_length (float) - * 493 M207 W retract_length_swap (float) - * 497 M207 F retract_feedrate_mm_s (float) - * 501 M207 Z retract_zlift (float) - * 505 M208 S retract_recover_length (float) - * 509 M208 W retract_recover_length_swap (float) - * 513 M208 F retract_recover_feedrate_mm_s (float) + * 504 M209 S autoretract_enabled (bool) + * 505 M207 S retract_length (float) + * 509 M207 W retract_length_swap (float) + * 513 M207 F retract_feedrate_mm_s (float) + * 517 M207 Z retract_zlift (float) + * 521 M208 S retract_recover_length (float) + * 525 M208 W retract_recover_length_swap (float) + * 529 M208 F retract_recover_feedrate_mm_s (float) * - * Volumetric Extrusion: 17 bytes - * 517 M200 D volumetric_enabled (bool) - * 518 M200 T D filament_size (float x4) (T0..3) + * Volumetric Extrusion: 21 bytes + * 533 M200 D volumetric_enabled (bool) + * 534 M200 T D filament_size (float x5) (T0..3) * * TMC2130 Stepper Current: 20 bytes - * 534 M906 X stepperX current (uint16_t) - * 536 M906 Y stepperY current (uint16_t) - * 538 M906 Z stepperZ current (uint16_t) - * 540 M906 X2 stepperX2 current (uint16_t) - * 542 M906 Y2 stepperY2 current (uint16_t) - * 544 M906 Z2 stepperZ2 current (uint16_t) - * 546 M906 E0 stepperE0 current (uint16_t) - * 548 M906 E1 stepperE1 current (uint16_t) - * 550 M906 E2 stepperE2 current (uint16_t) - * 552 M906 E3 stepperE3 current (uint16_t) + * 554 M906 X stepperX current (uint16_t) + * 556 M906 Y stepperY current (uint16_t) + * 558 M906 Z stepperZ current (uint16_t) + * 560 M906 X2 stepperX2 current (uint16_t) + * 562 M906 Y2 stepperY2 current (uint16_t) + * 564 M906 Z2 stepperZ2 current (uint16_t) + * 566 M906 E0 stepperE0 current (uint16_t) + * 568 M906 E1 stepperE1 current (uint16_t) + * 570 M906 E2 stepperE2 current (uint16_t) + * 572 M906 E3 stepperE3 current (uint16_t) * - * 554 Minimum end-point - * 1875 (554 + 36 + 9 + 288 + 988) Maximum end-point + * 574 Minimum end-point + * 1895 (574 + 36 + 9 + 288 + 988) Maximum end-point * */ #include "Marlin.h" @@ -1433,9 +1434,14 @@ void Config_ResetDefault() { CONFIG_ECHO_START; SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]); SERIAL_EOL; - #endif - #endif - #endif + #if EXTRUDERS > 4 + CONFIG_ECHO_START; + SERIAL_ECHOPAIR(" M200 T4 D", filament_size[4]); + SERIAL_EOL; + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 if (!volumetric_enabled) { CONFIG_ECHO_START; diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 4bf9ec5d6a..22da7a3de0 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -882,9 +882,12 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const if (g_uc_extruder_last_move[2] == 0) disable_e2(); #if EXTRUDERS > 3 if (g_uc_extruder_last_move[3] == 0) disable_e3(); - #endif - #endif - #endif + #if EXTRUDERS > 4 + if (g_uc_extruder_last_move[4] == 0) disable_e4(); + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 break; #if EXTRUDERS > 1 case 1: @@ -895,8 +898,11 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const if (g_uc_extruder_last_move[2] == 0) disable_e2(); #if EXTRUDERS > 3 if (g_uc_extruder_last_move[3] == 0) disable_e3(); - #endif - #endif + #if EXTRUDERS > 4 + if (g_uc_extruder_last_move[4] == 0) disable_e4(); + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 break; #if EXTRUDERS > 2 case 2: @@ -906,6 +912,9 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const if (g_uc_extruder_last_move[1] == 0) disable_e1(); #if EXTRUDERS > 3 if (g_uc_extruder_last_move[3] == 0) disable_e3(); + #if EXTRUDERS > 4 + if (g_uc_extruder_last_move[4] == 0) disable_e4(); + #endif #endif break; #if EXTRUDERS > 3 @@ -915,7 +924,20 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); if (g_uc_extruder_last_move[2] == 0) disable_e2(); + #if EXTRUDERS > 4 + if (g_uc_extruder_last_move[4] == 0) disable_e4(); + #endif break; + #if EXTRUDERS > 4 + case 4: + enable_e4(); + g_uc_extruder_last_move[4] = (BLOCK_BUFFER_SIZE) * 2; + if (g_uc_extruder_last_move[0] == 0) disable_e0(); + if (g_uc_extruder_last_move[1] == 0) disable_e1(); + if (g_uc_extruder_last_move[2] == 0) disable_e2(); + if (g_uc_extruder_last_move[3] == 0) disable_e3(); + break; + #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 @@ -925,6 +947,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const enable_e1(); enable_e2(); enable_e3(); + enable_e4(); #endif } diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 5a37c77509..909231fc0b 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -51,8 +51,8 @@ static void* heater_ttbl_map[2] = {(void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; #else - static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE); - static uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN); + static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE); + static uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN); #endif Temperature thermalManager; @@ -161,8 +161,8 @@ unsigned long Temperature::raw_temp_value[MAX_EXTRUDERS] = { 0 }; unsigned long Temperature::raw_temp_bed_value = 0; // Init min and max temp with extreme values to prevent false errors during startup -int Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP), - Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP), +int Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP, HEATER_4_RAW_LO_TEMP), + Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP, HEATER_4_RAW_HI_TEMP), Temperature::minttemp[HOTENDS] = { 0 }, Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); @@ -460,12 +460,13 @@ int Temperature::getHeaterPower(int heater) { #if HAS_AUTO_FAN void Temperature::checkExtruderAutoFans() { - const int8_t fanPin[] = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN }; - const int fanBit[] = { + constexpr int8_t fanPin[] = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN }; + constexpr int fanBit[] = { 0, AUTO_1_IS_0 ? 0 : 1, AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 : 2, - AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 : 3 + AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 : 3, + AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4 }; uint8_t fanState = 0; @@ -973,6 +974,9 @@ void Temperature::init() { #if HAS_HEATER_3 SET_OUTPUT(HEATER_3_PIN); #endif + #if HAS_HEATER_4 + SET_OUTPUT(HEATER_3_PIN); + #endif #if HAS_HEATER_BED SET_OUTPUT(HEATER_BED_PIN); #endif @@ -1033,6 +1037,9 @@ void Temperature::init() { #if HAS_TEMP_3 ANALOG_SELECT(TEMP_3_PIN); #endif + #if HAS_TEMP_4 + ANALOG_SELECT(TEMP_4_PIN); + #endif #if HAS_TEMP_BED ANALOG_SELECT(TEMP_BED_PIN); #endif @@ -1080,6 +1087,16 @@ void Temperature::init() { SET_OUTPUT(E3_AUTO_FAN_PIN); #endif #endif + #if HAS_AUTO_FAN_4 && !AUTO_4_IS_0 && !AUTO_4_IS_1 && !AUTO_4_IS_2 && !AUTO_4_IS_3 + #if E4_AUTO_FAN_PIN == FAN1_PIN + SET_OUTPUT(E4_AUTO_FAN_PIN); + #if ENABLED(FAST_PWM_FAN) + setPwmFrequency(E4_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 + #endif + #else + SET_OUTPUT(E4_AUTO_FAN_PIN); + #endif + #endif // Use timer0 for temperature measurement // Interleave temperature interrupt with millies interrupt @@ -1133,6 +1150,14 @@ void Temperature::init() { #ifdef HEATER_3_MAXTEMP TEMP_MAX_ROUTINE(3); #endif + #if HOTENDS > 4 + #ifdef HEATER_4_MINTEMP + TEMP_MIN_ROUTINE(4); + #endif + #ifdef HEATER_4_MAXTEMP + TEMP_MAX_ROUTINE(4); + #endif + #endif // HOTENDS > 4 #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 @@ -1264,18 +1289,18 @@ void Temperature::disable_all_heaters() { #if HAS_TEMP_HOTEND DISABLE_HEATER(0); - #endif - - #if HOTENDS > 1 && HAS_TEMP_1 - DISABLE_HEATER(1); - #endif - - #if HOTENDS > 2 && HAS_TEMP_2 - DISABLE_HEATER(2); - #endif - - #if HOTENDS > 3 && HAS_TEMP_3 - DISABLE_HEATER(3); + #if HOTENDS > 1 + DISABLE_HEATER(1); + #if HOTENDS > 2 + DISABLE_HEATER(2); + #if HOTENDS > 3 + DISABLE_HEATER(3); + #if HOTENDS > 4 + DISABLE_HEATER(4); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #endif #if HAS_TEMP_BED @@ -1384,6 +1409,9 @@ void Temperature::set_current_temp_raw() { current_temperature_raw[2] = raw_temp_value[2]; #if HAS_TEMP_3 current_temperature_raw[3] = raw_temp_value[3]; + #if HAS_TEMP_4 + current_temperature_raw[4] = raw_temp_value[4]; + #endif #endif #endif #endif @@ -1525,9 +1553,12 @@ void Temperature::isr() { ISR_STATICS(2); #if HOTENDS > 3 ISR_STATICS(3); - #endif - #endif - #endif + #if HOTENDS > 4 + ISR_STATICS(4); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if HAS_HEATER_BED ISR_STATICS(BED); #endif @@ -1561,9 +1592,13 @@ void Temperature::isr() { #if HOTENDS > 3 soft_pwm_3 = (soft_pwm_3 & pwm_mask) + soft_pwm[3]; WRITE_HEATER_3(soft_pwm_3 > pwm_mask ? HIGH : LOW); - #endif - #endif - #endif + #if HOTENDS > 4 + soft_pwm_4 = (soft_pwm_4 & pwm_mask) + soft_pwm[4]; + WRITE_HEATER_4(soft_pwm_4 > pwm_mask ? HIGH : LOW); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if HAS_HEATER_BED soft_pwm_BED = (soft_pwm_BED & pwm_mask) + soft_pwm_bed; @@ -1589,13 +1624,16 @@ void Temperature::isr() { if (soft_pwm_0 <= pwm_count_tmp) WRITE_HEATER_0(0); #if HOTENDS > 1 if (soft_pwm_1 <= pwm_count_tmp) WRITE_HEATER_1(0); - #endif - #if HOTENDS > 2 - if (soft_pwm_2 <= pwm_count_tmp) WRITE_HEATER_2(0); - #endif - #if HOTENDS > 3 - if (soft_pwm_3 <= pwm_count_tmp) WRITE_HEATER_3(0); - #endif + #if HOTENDS > 2 + if (soft_pwm_2 <= pwm_count_tmp) WRITE_HEATER_2(0); + #if HOTENDS > 3 + if (soft_pwm_3 <= pwm_count_tmp) WRITE_HEATER_3(0); + #if HOTENDS > 4 + if (soft_pwm_4 <= pwm_count_tmp) WRITE_HEATER_4(0); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if HAS_HEATER_BED if (soft_pwm_BED <= pwm_count_tmp) WRITE_HEATER_BED(0); @@ -1665,32 +1703,38 @@ void Temperature::isr() { if (slow_pwm_count == 0) { - SLOW_PWM_ROUTINE(0); // EXTRUDER 0 + SLOW_PWM_ROUTINE(0); #if HOTENDS > 1 - SLOW_PWM_ROUTINE(1); // EXTRUDER 1 + SLOW_PWM_ROUTINE(1); #if HOTENDS > 2 - SLOW_PWM_ROUTINE(2); // EXTRUDER 2 + SLOW_PWM_ROUTINE(2); #if HOTENDS > 3 - SLOW_PWM_ROUTINE(3); // EXTRUDER 3 - #endif - #endif - #endif + SLOW_PWM_ROUTINE(3); + #if HOTENDS > 4 + SLOW_PWM_ROUTINE(4); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if HAS_HEATER_BED _SLOW_PWM_ROUTINE(BED, soft_pwm_bed); // BED #endif } // slow_pwm_count == 0 - PWM_OFF_ROUTINE(0); // EXTRUDER 0 + PWM_OFF_ROUTINE(0); #if HOTENDS > 1 - PWM_OFF_ROUTINE(1); // EXTRUDER 1 + PWM_OFF_ROUTINE(1); #if HOTENDS > 2 - PWM_OFF_ROUTINE(2); // EXTRUDER 2 + PWM_OFF_ROUTINE(2); #if HOTENDS > 3 - PWM_OFF_ROUTINE(3); // EXTRUDER 3 - #endif - #endif - #endif + PWM_OFF_ROUTINE(3); + #if HOTENDS > 4 + PWM_OFF_ROUTINE(4); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if HAS_HEATER_BED PWM_OFF_ROUTINE(BED); // BED #endif @@ -1738,17 +1782,19 @@ void Temperature::isr() { slow_pwm_count++; slow_pwm_count &= 0x7F; - // EXTRUDER 0 if (state_timer_heater_0 > 0) state_timer_heater_0--; - #if HOTENDS > 1 // EXTRUDER 1 + #if HOTENDS > 1 if (state_timer_heater_1 > 0) state_timer_heater_1--; - #if HOTENDS > 2 // EXTRUDER 2 + #if HOTENDS > 2 if (state_timer_heater_2 > 0) state_timer_heater_2--; - #if HOTENDS > 3 // EXTRUDER 3 + #if HOTENDS > 3 if (state_timer_heater_3 > 0) state_timer_heater_3--; - #endif - #endif - #endif + #if HOTENDS > 4 + if (state_timer_heater_4 > 0) state_timer_heater_4--; + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if HAS_HEATER_BED if (state_timer_heater_BED > 0) state_timer_heater_BED--; #endif @@ -1763,7 +1809,7 @@ void Temperature::isr() { #define START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin) #endif - // Prepare or measure a sensor, each one every 12th frame + // Prepare or measure a sensor, each one every 14th frame switch (temp_state) { case PrepareTemp_0: #if HAS_TEMP_0 @@ -1832,6 +1878,20 @@ void Temperature::isr() { #if HAS_TEMP_3 raw_temp_value[3] += ADC; #endif + temp_state = PrepareTemp_4; + break; + + case PrepareTemp_4: + #if HAS_TEMP_4 + START_ADC(TEMP_4_PIN); + #endif + lcd_buttons_update(); + temp_state = MeasureTemp_4; + break; + case MeasureTemp_4: + #if HAS_TEMP_4 + raw_temp_value[4] += ADC; + #endif temp_state = Prepare_FILWIDTH; break; @@ -1879,35 +1939,26 @@ void Temperature::isr() { ZERO(raw_temp_value); raw_temp_bed_value = 0; + #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1) + int constexpr temp_dir[] = { #if ENABLED(HEATER_0_USES_MAX6675) 0 - #elif HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP - -1 #else - 1 - #endif - #if HAS_TEMP_1 && HOTENDS > 1 - #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP - , -1 - #else - , 1 - #endif - #endif - #if HAS_TEMP_2 && HOTENDS > 2 - #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP - , -1 - #else - , 1 - #endif - #endif - #if HAS_TEMP_3 && HOTENDS > 3 - #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP - , -1 - #else - , 1 - #endif + TEMPDIR(0) #endif + #if HOTENDS > 1 + , TEMPDIR(1) + #if HOTENDS > 2 + , TEMPDIR(2) + #if HOTENDS > 3 + , TEMPDIR(3) + #if HOTENDS > 4 + , TEMPDIR(4) + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 }; for (uint8_t e = 0; e < COUNT(temp_dir); e++) { diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 09cf44bd22..4e7e2a83ea 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -174,7 +174,7 @@ class Temperature { static millis_t next_bed_check_ms; #endif - static unsigned long raw_temp_value[4], + static unsigned long raw_temp_value[MAX_EXTRUDERS], raw_temp_bed_value; // Init min and max temp with extreme values to prevent false errors during startup diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 96dc01909f..ad37d2e0dd 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -919,31 +919,37 @@ void kill_screen(const char* lcd_msg) { * Watch temperature callbacks */ #if WATCH_HOTENDS - #if TEMP_SENSOR_0 != 0 + #if HAS_TEMP_HOTEND void watch_temp_callback_E0() { thermalManager.start_watching_heater(0); } + #if HOTENDS > 1 + void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); } + #if HOTENDS > 2 + void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); } + #if HOTENDS > 3 + void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); } + #if HOTENDS > 4 + void watch_temp_callback_E4() { thermalManager.start_watching_heater(4); } + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #endif - #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 - void watch_temp_callback_E1() { thermalManager.start_watching_heater(1); } - #endif // HOTENDS > 1 - #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 - void watch_temp_callback_E2() { thermalManager.start_watching_heater(2); } - #endif // HOTENDS > 2 - #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 - void watch_temp_callback_E3() { thermalManager.start_watching_heater(3); } - #endif // HOTENDS > 3 #else - #if TEMP_SENSOR_0 != 0 + #if HAS_TEMP_HOTEND void watch_temp_callback_E0() {} + #if HOTENDS > 1 + void watch_temp_callback_E1() {} + #if HOTENDS > 2 + void watch_temp_callback_E2() {} + #if HOTENDS > 3 + void watch_temp_callback_E3() {} + #if HOTENDS > 4 + void watch_temp_callback_E4() {} + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #endif - #if HOTENDS > 1 && TEMP_SENSOR_1 != 0 - void watch_temp_callback_E1() {} - #endif // HOTENDS > 1 - #if HOTENDS > 2 && TEMP_SENSOR_2 != 0 - void watch_temp_callback_E2() {} - #endif // HOTENDS > 2 - #if HOTENDS > 3 && TEMP_SENSOR_3 != 0 - void watch_temp_callback_E3() {} - #endif // HOTENDS > 3 #endif #if WATCH_THE_BED @@ -990,24 +996,17 @@ void kill_screen(const char* lcd_msg) { // Nozzle [1-4]: // #if HOTENDS == 1 - #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #endif + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); #else //HOTENDS > 1 - #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #endif - #if TEMP_SENSOR_1 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #endif + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); #if HOTENDS > 2 - #if TEMP_SENSOR_2 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #endif + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); #if HOTENDS > 3 - #if TEMP_SENSOR_3 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #endif + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); + #if HOTENDS > 4 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); + #endif // HOTENDS > 4 #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 @@ -1041,10 +1040,7 @@ void kill_screen(const char* lcd_msg) { // // Flow: - // Flow 1: - // Flow 2: - // Flow 3: - // Flow 4: + // Flow [1-5]: // #if EXTRUDERS == 1 MENU_ITEM_EDIT(int3, MSG_FLOW, &flow_percentage[0], 10, 999); @@ -1056,6 +1052,9 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &flow_percentage[2], 10, 999); #if EXTRUDERS > 3 MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N4, &flow_percentage[3], 10, 999); + #if EXTRUDERS > 4 + MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N5, &flow_percentage[4], 10, 999); + #endif //EXTRUDERS > 4 #endif //EXTRUDERS > 3 #endif //EXTRUDERS > 2 #endif //EXTRUDERS > 1 @@ -1109,7 +1108,7 @@ void kill_screen(const char* lcd_msg) { } #endif - constexpr int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP); + constexpr int heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); /** * @@ -1165,8 +1164,16 @@ void kill_screen(const char* lcd_msg) { void lcd_preheat_m1_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } void lcd_preheat_m2_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } #endif - #endif - #endif + #if HOTENDS > 4 + void lcd_preheat_m1_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } + void lcd_preheat_m2_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } + #if TEMP_SENSOR_BED != 0 + void lcd_preheat_m1_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } + void lcd_preheat_m2_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } + #endif + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 void lcd_preheat_m1_all() { #if HOTENDS > 1 @@ -1175,9 +1182,12 @@ void kill_screen(const char* lcd_msg) { thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 2); #if HOTENDS > 3 thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 3); - #endif - #endif - #endif + #if HOTENDS > 4 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 4); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if TEMP_SENSOR_BED != 0 lcd_preheat_m1_e0(); #else @@ -1191,9 +1201,12 @@ void kill_screen(const char* lcd_msg) { thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 2); #if HOTENDS > 3 thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 3); - #endif - #endif - #endif + #if HOTENDS > 4 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 4); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 #if TEMP_SENSOR_BED != 0 lcd_preheat_m2_e0(); #else @@ -1244,10 +1257,18 @@ void kill_screen(const char* lcd_msg) { #else MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only); #endif - #endif - #endif + #if HOTENDS > 4 + #if TEMP_SENSOR_BED != 0 + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4); + MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E5, lcd_preheat_m1_e4_only); + #else + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4_only); + #endif + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all); - #endif + #endif // HOTENDS > 1 #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly); #endif @@ -1288,10 +1309,18 @@ void kill_screen(const char* lcd_msg) { #else MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only); #endif - #endif - #endif + #if HOTENDS > 4 + #if TEMP_SENSOR_BED != 0 + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4); + MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E5, lcd_preheat_m2_e4_only); + #else + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4_only); + #endif + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all); - #endif + #endif // HOTENDS > 1 #if TEMP_SENSOR_BED != 0 MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly); #endif @@ -2104,16 +2133,16 @@ void kill_screen(const char* lcd_msg) { PID_PARAM(Kd, e) = scalePID_d(raw_Kd); thermalManager.updatePID(); } - #define _PIDTEMP_BASE_FUNCTIONS(eindex) \ - void copy_and_scalePID_i_E ## eindex() { copy_and_scalePID_i(eindex); } \ - void copy_and_scalePID_d_E ## eindex() { copy_and_scalePID_d(eindex); } + #define _PIDTEMP_BASE_FUNCTIONS(N) \ + void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \ + void copy_and_scalePID_d_E ## N() { copy_and_scalePID_d(N); } #if ENABLED(PID_AUTOTUNE_MENU) - #define _PIDTEMP_FUNCTIONS(eindex) \ - _PIDTEMP_BASE_FUNCTIONS(eindex); \ - void lcd_autotune_callback_E ## eindex() { _lcd_autotune(eindex); } + #define _PIDTEMP_FUNCTIONS(N) \ + _PIDTEMP_BASE_FUNCTIONS(N); \ + void lcd_autotune_callback_E ## N() { _lcd_autotune(N); } #else - #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex) + #define _PIDTEMP_FUNCTIONS(N) _PIDTEMP_BASE_FUNCTIONS(N) #endif _PIDTEMP_FUNCTIONS(0) @@ -2124,12 +2153,15 @@ void kill_screen(const char* lcd_msg) { _PIDTEMP_FUNCTIONS(2) #if HOTENDS > 3 _PIDTEMP_FUNCTIONS(3) - #endif //HOTENDS > 3 - #endif //HOTENDS > 2 - #endif //HOTENDS > 1 - #endif //PID_PARAMS_PER_HOTEND + #if HOTENDS > 4 + _PIDTEMP_FUNCTIONS(4) + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + #endif // PID_PARAMS_PER_HOTEND - #endif //PIDTEMP + #endif // PIDTEMP /** * @@ -2146,27 +2178,20 @@ void kill_screen(const char* lcd_msg) { // // Nozzle: - // Nozzle [1-4]: + // Nozzle [1-5]: // #if HOTENDS == 1 - #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #endif - #else //HOTENDS > 1 - #if TEMP_SENSOR_0 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #endif - #if TEMP_SENSOR_1 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #endif + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #else // HOTENDS > 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); #if HOTENDS > 2 - #if TEMP_SENSOR_2 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #endif + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); #if HOTENDS > 3 - #if TEMP_SENSOR_3 != 0 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #endif + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); + #if HOTENDS > 4 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); + #endif // HOTENDS > 4 #endif // HOTENDS > 3 #endif // HOTENDS > 2 #endif // HOTENDS > 1 @@ -2247,11 +2272,14 @@ void kill_screen(const char* lcd_msg) { PID_MENU_ITEMS(" " MSG_E3, 2); #if HOTENDS > 3 PID_MENU_ITEMS(" " MSG_E4, 3); - #endif //HOTENDS > 3 - #endif //HOTENDS > 2 - #else //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 + #if HOTENDS > 4 + PID_MENU_ITEMS(" " MSG_E5, 4); + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #else // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 PID_MENU_ITEMS("", 0); - #endif //!PID_PARAMS_PER_HOTEND || HOTENDS == 1 + #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 #endif //PIDTEMP @@ -2268,7 +2296,10 @@ void kill_screen(const char* lcd_msg) { } void _lcd_control_temperature_preheat_settings_menu(uint8_t material) { - #if HOTENDS > 3 + #if HOTENDS > 4 + #define MINTEMP_ALL MIN5(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) + #define MAXTEMP_ALL MAX5(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) + #elif HOTENDS > 3 #define MINTEMP_ALL MIN4(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) #define MAXTEMP_ALL MAX4(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) #elif HOTENDS > 2 @@ -2455,16 +2486,19 @@ void kill_screen(const char* lcd_msg) { if (volumetric_enabled) { #if EXTRUDERS == 1 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers); - #else //EXTRUDERS > 1 + #else // EXTRUDERS > 1 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers); #if EXTRUDERS > 2 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers); #if EXTRUDERS > 3 MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers); - #endif //EXTRUDERS > 3 - #endif //EXTRUDERS > 2 - #endif //EXTRUDERS > 1 + #if EXTRUDERS > 4 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &filament_size[4], 1.5, 3.25, calculate_volumetric_multipliers); + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 } END_MENU();