chiark / gitweb /
refresh
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2012 00:35:49 +0000 (01:35 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2012 00:35:49 +0000 (01:35 +0100)
meta
patches/m206-always-use-homing-homeing
patches/refresh-temp [deleted file]

diff --git a/meta b/meta
index 6dd2157054b60251edc5443bca5234d0230c5128..f4b328ce4033a283d7a3ba0316665164b96ac996 100644 (file)
--- a/meta
+++ b/meta
@@ -1,14 +1,13 @@
 Version: 1
-Previous: 74fbfddc9013ea57678b907b8abb0cbdc0097704
-Head: f45c7e6949f23d05a56476df70f443420ba3d47d
+Previous: faea6bd574437ac3e587fc95febe98343faa35a7
+Head: 25b5201aa44df9dbd7af82a8bb1b9c7f65865757
 Applied:
   marlin-pde-include-comment-for: a873541ef6b23100dc6dec15e6195e87cef6fce5
   add-to-marlin-gitignore: 71404eef293f1c93ba081a458120b45e5a48f566
   makefile-support-v-1: 0c35facc946fda47b18b3d28b7d9e832b6c41ae6
   makefile-avr-size: 3f15b7c7b863abfa2c6cb157a7f220ab9627d776
   motion-control-max-min: faccb358508d49d0bef35dc0521043f04508bcc3
-  m206-always-use-homing-homeing: a0babd4a775762ca1b483f01ea10d96df9c16124
-  refresh-temp: f45c7e6949f23d05a56476df70f443420ba3d47d
+  m206-always-use-homing-homeing: 25b5201aa44df9dbd7af82a8bb1b9c7f65865757
 Unapplied:
   eeprom-provide-smaller-code-fo: d351b9f64286d75dd4ebd4b09ed00ef31008364b
   homeaxis-function: 7ff6b3c2e6523f2ac8b030dde0fac52595257339
index da80de93510d5100a9512ff551495b4714524df0..11162d56c3541a1ab7fd46ba906f0c93b5ce9a90 100644 (file)
@@ -1,5 +1,5 @@
 Bottom: 681cec9bc49d48ceecfc6d5e9eff1c4f7f623fc6
-Top:    681cec9bc49d48ceecfc6d5e9eff1c4f7f623fc6
+Top:    eaaf908848a4a0cd0e69f559ed75c700974fc20f
 Author: Ian Jackson <ijackson@chiark.greenend.org.uk>
 Date:   2012-08-01 21:12:14 +0100
 
@@ -70,4 +70,114 @@ Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
 
 ---
 
-
+diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h
+index 75b57d0..b465d85 100644
+--- a/Marlin/Marlin.h
++++ b/Marlin/Marlin.h
+@@ -184,6 +184,8 @@ extern float homing_feedrate[];
+ extern bool axis_relative_modes[];
+ extern float current_position[NUM_AXIS] ;
+ extern float add_homeing[3];
++extern float min_pos[3];
++extern float max_pos[3];
+ extern unsigned char FanSpeed;
+ // Handling multiple extruders pins
+diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde
+index 5268a3d..c153298 100644
+--- a/Marlin/Marlin.pde
++++ b/Marlin/Marlin.pde
+@@ -143,6 +143,8 @@ volatile bool feedmultiplychanged=false;
+ volatile int extrudemultiply=100; //100->1 200->2
+ float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
+ float add_homeing[3]={0,0,0};
++float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
++float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
+ uint8_t active_extruder = 0;
+ unsigned char FanSpeed=0;
+@@ -543,6 +545,28 @@ bool code_seen(char code)
+   return (strchr_pointer != NULL);  //Return True if a character was found
+ }
++#define DEFINE_PGM_READ_ANY(type, reader)             \
++    static inline float pgm_read_any(const type *p)   \
++      { return pgm_read_##reader##_near(p); }
++
++DEFINE_PGM_READ_ANY(float,       float);
++
++#define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG)   \
++static const PROGMEM type array##_P[3] =              \
++    { X_##CONFIG, Y_##CONFIG, Z_##CONFIG };           \
++static inline type array(int axis)                    \
++    { return pgm_read_any(&array##_P[axis]); }
++
++XYZ_CONSTS_FROM_CONFIG(float, base_min_pos,    MIN_POS);
++XYZ_CONSTS_FROM_CONFIG(float, base_max_pos,    MAX_POS);
++XYZ_CONSTS_FROM_CONFIG(float, base_home_pos,   HOME_POS);
++
++static void axis_is_at_home(int axis) {
++  current_position[axis] = base_home_pos(axis) + add_homeing[axis];
++  min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
++  max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
++}
++
+ #define HOMEAXIS(LETTER) \
+   if ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))\
+     { \
+@@ -564,8 +588,8 @@ bool code_seen(char code)
+     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
+     st_synchronize();\
+     \
+-    current_position[LETTER##_AXIS] = LETTER##_HOME_POS;\
+-    destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\
++    axis_is_at_home(LETTER##_AXIS);                                   \
++    destination[LETTER##_AXIS] = current_position[LETTER##_AXIS]; \
+     feedrate = 0.0;\
+     endstops_hit_on_purpose();\
+   }
+@@ -678,8 +702,8 @@ void process_commands()
+         plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
+         st_synchronize();
+     
+-        current_position[X_AXIS] = X_HOME_POS;
+-        current_position[Y_AXIS] = Y_HOME_POS;
++        axis_is_at_home(X_AXIS);
++        axis_is_at_home(Y_AXIS);
+         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
+         destination[X_AXIS] = current_position[X_AXIS];
+         destination[Y_AXIS] = current_position[Y_AXIS];
+@@ -1544,15 +1568,15 @@ void get_arc_coordinates()
+ void clamp_to_software_endstops(float target[3])
+ {
+   if (min_software_endstops) {
+-    if (target[X_AXIS] < X_MIN_POS) target[X_AXIS] = X_MIN_POS;
+-    if (target[Y_AXIS] < Y_MIN_POS) target[Y_AXIS] = Y_MIN_POS;
+-    if (target[Z_AXIS] < Z_MIN_POS) target[Z_AXIS] = Z_MIN_POS;
++    if (target[X_AXIS] < min_pos[X_AXIS]) target[X_AXIS] = min_pos[X_AXIS];
++    if (target[Y_AXIS] < min_pos[Y_AXIS]) target[Y_AXIS] = min_pos[Y_AXIS];
++    if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS];
+   }
+   if (max_software_endstops) {
+-    if (target[X_AXIS] > X_MAX_POS) target[X_AXIS] = X_MAX_POS;
+-    if (target[Y_AXIS] > Y_MAX_POS) target[Y_AXIS] = Y_MAX_POS;
+-    if (target[Z_AXIS] > Z_MAX_POS) target[Z_AXIS] = Z_MAX_POS;
++    if (target[X_AXIS] > max_pos[X_AXIS]) target[X_AXIS] = max_pos[X_AXIS];
++    if (target[Y_AXIS] > max_pos[Y_AXIS]) target[Y_AXIS] = max_pos[Y_AXIS];
++    if (target[Z_AXIS] > max_pos[Z_AXIS]) target[Z_AXIS] = max_pos[Z_AXIS];
+   }
+ }
+diff --git a/README.md b/README.md
+index 86dd93d..fb2c189 100644
+--- a/README.md
++++ b/README.md
+@@ -152,6 +152,7 @@ Movement variables:
+ *   M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!\r
+ *   M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec\r
+ *   M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate\r
++*   M206 - set home offsets.  This sets the X,Y,Z coordinates of the endstops (and is added to the {X,Y,Z}_HOME_POS configuration options (and is also added to the coordinates, if any, provided to G82, as with earlier firmware)\r
+ *   M220 - set build speed mulitplying S:factor in percent ; aka "realtime tuneing in the gcode". So you can slow down if you have islands in one height-range, and speed up otherwise.\r
+ *   M221 - set the extrude multiplying S:factor in percent\r
+ *   M400 - Finish all buffered moves.
diff --git a/patches/refresh-temp b/patches/refresh-temp
deleted file mode 100644 (file)
index cf86237..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-Bottom: 681cec9bc49d48ceecfc6d5e9eff1c4f7f623fc6
-Top:    eaaf908848a4a0cd0e69f559ed75c700974fc20f
-Author: Ian Jackson <ijackson@chiark.greenend.org.uk>
-Date:   2012-08-11 01:35:49 +0100
-
-Refresh of m206-always-use-homing-homeing
-
----
-
-diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h
-index 75b57d0..b465d85 100644
---- a/Marlin/Marlin.h
-+++ b/Marlin/Marlin.h
-@@ -184,6 +184,8 @@ extern float homing_feedrate[];
- extern bool axis_relative_modes[];
- extern float current_position[NUM_AXIS] ;
- extern float add_homeing[3];
-+extern float min_pos[3];
-+extern float max_pos[3];
- extern unsigned char FanSpeed;
- // Handling multiple extruders pins
-diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde
-index 5268a3d..c153298 100644
---- a/Marlin/Marlin.pde
-+++ b/Marlin/Marlin.pde
-@@ -143,6 +143,8 @@ volatile bool feedmultiplychanged=false;
- volatile int extrudemultiply=100; //100->1 200->2
- float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
- float add_homeing[3]={0,0,0};
-+float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
-+float max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
- uint8_t active_extruder = 0;
- unsigned char FanSpeed=0;
-@@ -543,6 +545,28 @@ bool code_seen(char code)
-   return (strchr_pointer != NULL);  //Return True if a character was found
- }
-+#define DEFINE_PGM_READ_ANY(type, reader)             \
-+    static inline float pgm_read_any(const type *p)   \
-+      { return pgm_read_##reader##_near(p); }
-+
-+DEFINE_PGM_READ_ANY(float,       float);
-+
-+#define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG)   \
-+static const PROGMEM type array##_P[3] =              \
-+    { X_##CONFIG, Y_##CONFIG, Z_##CONFIG };           \
-+static inline type array(int axis)                    \
-+    { return pgm_read_any(&array##_P[axis]); }
-+
-+XYZ_CONSTS_FROM_CONFIG(float, base_min_pos,    MIN_POS);
-+XYZ_CONSTS_FROM_CONFIG(float, base_max_pos,    MAX_POS);
-+XYZ_CONSTS_FROM_CONFIG(float, base_home_pos,   HOME_POS);
-+
-+static void axis_is_at_home(int axis) {
-+  current_position[axis] = base_home_pos(axis) + add_homeing[axis];
-+  min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
-+  max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
-+}
-+
- #define HOMEAXIS(LETTER) \
-   if ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))\
-     { \
-@@ -564,8 +588,8 @@ bool code_seen(char code)
-     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
-     st_synchronize();\
-     \
--    current_position[LETTER##_AXIS] = LETTER##_HOME_POS;\
--    destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\
-+    axis_is_at_home(LETTER##_AXIS);                                   \
-+    destination[LETTER##_AXIS] = current_position[LETTER##_AXIS]; \
-     feedrate = 0.0;\
-     endstops_hit_on_purpose();\
-   }
-@@ -678,8 +702,8 @@ void process_commands()
-         plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
-         st_synchronize();
-     
--        current_position[X_AXIS] = X_HOME_POS;
--        current_position[Y_AXIS] = Y_HOME_POS;
-+        axis_is_at_home(X_AXIS);
-+        axis_is_at_home(Y_AXIS);
-         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
-         destination[X_AXIS] = current_position[X_AXIS];
-         destination[Y_AXIS] = current_position[Y_AXIS];
-@@ -1544,15 +1568,15 @@ void get_arc_coordinates()
- void clamp_to_software_endstops(float target[3])
- {
-   if (min_software_endstops) {
--    if (target[X_AXIS] < X_MIN_POS) target[X_AXIS] = X_MIN_POS;
--    if (target[Y_AXIS] < Y_MIN_POS) target[Y_AXIS] = Y_MIN_POS;
--    if (target[Z_AXIS] < Z_MIN_POS) target[Z_AXIS] = Z_MIN_POS;
-+    if (target[X_AXIS] < min_pos[X_AXIS]) target[X_AXIS] = min_pos[X_AXIS];
-+    if (target[Y_AXIS] < min_pos[Y_AXIS]) target[Y_AXIS] = min_pos[Y_AXIS];
-+    if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS];
-   }
-   if (max_software_endstops) {
--    if (target[X_AXIS] > X_MAX_POS) target[X_AXIS] = X_MAX_POS;
--    if (target[Y_AXIS] > Y_MAX_POS) target[Y_AXIS] = Y_MAX_POS;
--    if (target[Z_AXIS] > Z_MAX_POS) target[Z_AXIS] = Z_MAX_POS;
-+    if (target[X_AXIS] > max_pos[X_AXIS]) target[X_AXIS] = max_pos[X_AXIS];
-+    if (target[Y_AXIS] > max_pos[Y_AXIS]) target[Y_AXIS] = max_pos[Y_AXIS];
-+    if (target[Z_AXIS] > max_pos[Z_AXIS]) target[Z_AXIS] = max_pos[Z_AXIS];
-   }
- }
-diff --git a/README.md b/README.md
-index 86dd93d..fb2c189 100644
---- a/README.md
-+++ b/README.md
-@@ -152,6 +152,7 @@ Movement variables:
- *   M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!\r
- *   M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec\r
- *   M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate\r
-+*   M206 - set home offsets.  This sets the X,Y,Z coordinates of the endstops (and is added to the {X,Y,Z}_HOME_POS configuration options (and is also added to the coordinates, if any, provided to G82, as with earlier firmware)\r
- *   M220 - set build speed mulitplying S:factor in percent ; aka "realtime tuneing in the gcode". So you can slow down if you have islands in one height-range, and speed up otherwise.\r
- *   M221 - set the extrude multiplying S:factor in percent\r
- *   M400 - Finish all buffered moves.