chiark / gitweb /
refresh (create temporary patch)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 8 Aug 2012 17:43:42 +0000 (18:43 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 8 Aug 2012 17:43:42 +0000 (18:43 +0100)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index 1e85e2d3a1f53f536452684d33ab75386eace274..52f371040ff4f80d4c57347611a7a7369c00a059 100644 (file)
--- a/meta
+++ b/meta
@@ -1,6 +1,6 @@
 Version: 1
-Previous: 22caf5df40e713f201d7e4c2f9ef1b8038349c58
-Head: ed5d519a9d476ee627f959b4c116f415b23bf153
+Previous: 5b052bd520ea81e62c96ec06f4315fbcca360102
+Head: c48c9ac1fedb72bfe6916813b1ba76576e8d144d
 Applied:
   marlin-pde-include-comment-for: 121f976406e6921f5b511f6dc4882985cf4b4133
   makefile-support-v-1: a546c894dc9079e57c928c9630409b34d9ea1a84
@@ -8,6 +8,7 @@ Applied:
   eeprom-provide-smaller-code-fo: 7a1844e866df485839e1e91436b63590a548a907
   m206-save-values-in-eeprom: d7399516ec458632baae2f7e610345ad856e3f43
   homeaxis-function: ed5d519a9d476ee627f959b4c116f415b23bf153
+  refresh-temp: c48c9ac1fedb72bfe6916813b1ba76576e8d144d
 Unapplied:
   add-to-marlin-gitignore: 6fa8cc5b58fc2b674ea925f00550aca95110c67c
 Hidden:
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..c751a55
--- /dev/null
@@ -0,0 +1,96 @@
+Bottom: 8e7c9dfe8f9c1b267a41ef831eba608dc172e6a5
+Top:    451054c63dfecb31617488c7273ffe5e83319126
+Author: Ian Jackson <ijackson@chiark.greenend.org.uk>
+Date:   2012-08-08 18:43:41 +0100
+
+Refresh of homeaxis-function
+
+---
+
+diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde
+index 1dec2b8..50abc18 100644
+--- a/Marlin/Marlin.pde
++++ b/Marlin/Marlin.pde
+@@ -551,40 +551,55 @@ bool code_seen(char code)
+   return (strchr_pointer != NULL);  //Return True if a character was found
+ }
+-static const float base_min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
+-static const float base_home_pos[3] = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS };
++#define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \
++static const type array[3] = { X_##CONFIG, Y_##CONFIG, Z_##CONFIG };
++
++XYZ_CONSTS_FROM_CONFIG(float, base_min_pos,    MIN_POS);
++XYZ_CONSTS_FROM_CONFIG(float, base_home_pos,   HOME_POS);
++XYZ_CONSTS_FROM_CONFIG(float, max_length,      MAX_LENGTH);
++XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
++XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
+ 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];
+ }
+-#define HOMEAXIS(LETTER) \
+-  if ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))\
+-    { \
+-    current_position[LETTER##_AXIS] = 0; \
+-    plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); \
+-    destination[LETTER##_AXIS] = 1.5 * LETTER##_MAX_LENGTH * LETTER##_HOME_DIR; \
+-    feedrate = homing_feedrate[LETTER##_AXIS]; \
+-    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] = 0;\
+-    plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);\
+-    destination[LETTER##_AXIS] = -LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\
+-    plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
+-    st_synchronize();\
+-    \
+-    destination[LETTER##_AXIS] = 2*LETTER##_HOME_RETRACT_MM * LETTER##_HOME_DIR;\
+-    feedrate = homing_feedrate[LETTER##_AXIS]/2 ;  \
+-    plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); \
+-    st_synchronize();\
+-    \
+-    axis_is_at_home(LETTER##_AXIS);                                   \
+-    destination[LETTER##_AXIS] = current_position[LETTER##_AXIS]; \
+-    feedrate = 0.0;\
+-    endstops_hit_on_purpose();\
++static void homeaxis(int axis) {
++#define HOMEAXIS_DO_BIT(LETTER) \
++  ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1) ? 1 << LETTER##_AXIS : 0)
++
++  static const unsigned char doaxis =
++    HOMEAXIS_DO_BIT(X) | 
++    HOMEAXIS_DO_BIT(Y) |
++    HOMEAXIS_DO_BIT(Z);
++
++  if (doaxis & (1<<axis)) {
++    current_position[axis] = 0;
++    plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
++    destination[axis] = 1.5 * max_length[axis] * home_dir[axis];
++    feedrate = homing_feedrate[axis];
++    plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
++    st_synchronize();
++   
++    current_position[axis] = 0;
++    plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
++    destination[axis] = -home_retract_mm[axis] * home_dir[axis];
++    plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
++    st_synchronize();
++   
++    destination[axis] = 2*home_retract_mm[axis] * home_dir[axis];
++    feedrate = homing_feedrate[axis]/2 ; 
++    plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
++    st_synchronize();
++   
++    axis_is_at_home(axis);                                    
++    destination[axis] = current_position[axis];
++    feedrate = 0.0;
++    endstops_hit_on_purpose();
+   }
++}
++#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
+ void process_commands()
+ {