From 28b1c37dea8934bf4cc796b109daf2ee22adcbda Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 15 Mar 2015 21:35:33 +0100 Subject: [PATCH 1/4] Fix for #1612 --- Marlin/temperature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 9a30726639..ed5593057c 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -535,17 +535,17 @@ inline void _temp_error(int e, const char *msg1, const char *msg2) { void max_temp_error(uint8_t e) { disable_heater(); - _temp_error(e, MSG_MAXTEMP_EXTRUDER_OFF, MSG_ERR_MAXTEMP); + _temp_error(e, PSTR(MSG_MAXTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MAXTEMP)); } void min_temp_error(uint8_t e) { disable_heater(); - _temp_error(e, MSG_MINTEMP_EXTRUDER_OFF, MSG_ERR_MINTEMP); + _temp_error(e, PSTR(MSG_MINTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MINTEMP)); } void bed_max_temp_error(void) { #if HAS_HEATER_BED WRITE_HEATER_BED(0); #endif - _temp_error(-1, MSG_MAXTEMP_BED_OFF, MSG_ERR_MAXTEMP_BED); + _temp_error(-1, PSTR(MSG_MAXTEMP_BED_OFF), PSTR(MSG_ERR_MAXTEMP_BED)); } float get_pid_output(int e) { From f0dcea7e140ba11b1494a627138d494905a9c50a Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sun, 15 Mar 2015 22:52:50 +0100 Subject: [PATCH 2/4] Fix #1611 Warning: suggest parentheses around comparison in operand of & pretty much helped. --- Marlin/Marlin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 286a8d5aed..c056dd6ad5 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -33,7 +33,7 @@ #endif #define BIT(b) (1<<(b)) -#define TEST(n,b) ((n)&BIT(b)!=0) +#define TEST(n,b) (((n)&BIT(b))!=0) // Arduino < 1.0.0 does not define this, so we need to do it ourselves #ifndef analogInputToDigitalPin From a686c9878fe2babab4269120adff41d3705eb1b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Mar 2015 15:49:36 -0700 Subject: [PATCH 3/4] Move TOPO_ORIGIN define to Configuration.h - Addressing issue #1608 --- Marlin/Configuration.h | 5 +++++ Marlin/Marlin_main.cpp | 6 ------ Marlin/configurator/config/Configuration.h | 5 +++++ Marlin/example_configurations/Felix/Configuration.h | 5 +++++ Marlin/example_configurations/Felix/Configuration_DUAL.h | 5 +++++ Marlin/example_configurations/Hephestos/Configuration.h | 5 +++++ Marlin/example_configurations/K8200/Configuration.h | 5 +++++ Marlin/example_configurations/SCARA/Configuration.h | 5 +++++ Marlin/example_configurations/WITBOX/Configuration.h | 5 +++++ Marlin/example_configurations/makibox/Configuration.h | 5 +++++ Marlin/example_configurations/tvrrug/Round2/Configuration.h | 5 +++++ 11 files changed, 50 insertions(+), 6 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index a2c43bd3d1..9f6d0497a4 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -398,6 +398,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e7298c43cb..855b264bc7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1854,12 +1854,6 @@ inline void gcode_G28() { * Usage: "G29 E" or "G29 e" * */ - - // Use one of these defines to specify the origin - // for a topographical map to be printed for your bed. - enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; - #define TOPO_ORIGIN OriginFrontLeft - inline void gcode_G29() { // Prevent user from running a G29 without first homing in X and Y diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index ddfbe01749..89bfe5c18f 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -438,6 +438,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index a337050580..12a82f5899 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -384,6 +384,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Note: this feature occupies 10'206 byte #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // set the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index aad5963eb9..9b1f10263e 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -384,6 +384,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Note: this feature occupies 10'206 byte #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // set the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index a5d3c8eb5a..b2bddb1dc7 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -408,6 +408,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 1aee050c73..fc7fccfbaa 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -413,6 +413,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 6655171947..7568b6074d 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -437,6 +437,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 2e99c82273..bfcf1e7792 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -407,6 +407,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 1f64893281..3bb627bcc7 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -405,6 +405,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index ee326c182f..b7d128de8f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -407,6 +407,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #ifdef AUTO_BED_LEVELING_GRID + // Use one of these defines to specify the origin + // for a topographical map to be printed for your bed. + enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight }; + #define TOPO_ORIGIN OriginFrontLeft + // The edges of the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 From cb676cdf39d3631dd1366e85221bda6c1f1f5f1b Mon Sep 17 00:00:00 2001 From: alexborro Date: Mon, 16 Mar 2015 16:31:25 -0300 Subject: [PATCH 4/4] Fix CoreXY homing bug introduced by PR #1606 The Check Endstop logic must be: if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS))) if (TEST(out_bits, X_HEAD)) not if (TEST(out_bits, X_HEAD) && (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS)))) Same applies for Y axis. --- Marlin/stepper.cpp | 75 +++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index eb904bb2d6..780712ba7e 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -413,48 +413,49 @@ ISR(TIMER1_COMPA_vect) { #else // Head direction in -X axis for CoreXY bots. // If DeltaX == -DeltaY, the movement is only in Y axis - if (TEST(out_bits, X_HEAD) && (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS)))) + if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS))) + if (TEST(out_bits, X_HEAD)) #endif - { // -direction - #ifdef DUAL_X_CARRIAGE - // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder - if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1)) - #endif - { - #if defined(X_MIN_PIN) && X_MIN_PIN >= 0 - UPDATE_ENDSTOP(x, X, min, MIN); + { // -direction + #ifdef DUAL_X_CARRIAGE + // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder + if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1)) + #endif + { + #if defined(X_MIN_PIN) && X_MIN_PIN >= 0 + UPDATE_ENDSTOP(x, X, min, MIN); + #endif + } + } + else { // +direction + #ifdef DUAL_X_CARRIAGE + // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder + if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1)) #endif + { + #if defined(X_MAX_PIN) && X_MAX_PIN >= 0 + UPDATE_ENDSTOP(x, X, max, MAX); + #endif + } } - } - else { // +direction - #ifdef DUAL_X_CARRIAGE - // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder - if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1)) - #endif - { - #if defined(X_MAX_PIN) && X_MAX_PIN >= 0 - UPDATE_ENDSTOP(x, X, max, MAX); + #ifndef COREXY + if (TEST(out_bits, Y_AXIS)) // -direction + #else + // Head direction in -Y axis for CoreXY bots. + // If DeltaX == DeltaY, the movement is only in X axis + if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) != TEST(out_bits, Y_AXIS))) + if (TEST(out_bits, Y_HEAD)) + #endif + { // -direction + #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0 + UPDATE_ENDSTOP(y, Y, min, MIN); + #endif + } + else { // +direction + #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 + UPDATE_ENDSTOP(y, Y, max, MAX); #endif } - } - - #ifndef COREXY - if (TEST(out_bits, Y_AXIS)) // -direction - #else - // Head direction in -Y axis for CoreXY bots. - // If DeltaX == DeltaY, the movement is only in X axis - if (TEST(out_bits, Y_HEAD) && (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) != TEST(out_bits, Y_AXIS)))) - #endif - { // -direction - #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0 - UPDATE_ENDSTOP(y, Y, min, MIN); - #endif - } - else { // +direction - #if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 - UPDATE_ENDSTOP(y, Y, max, MAX); - #endif - } } if (TEST(out_bits, Z_AXIS)) { // -direction