From fb7f6ae043a4dbe84c357bddebc382a31a300397 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 9 Aug 2012 19:09:35 +0100 Subject: [PATCH] refresh (create temporary patch) --- meta | 5 ++- patches/refresh-temp | 99 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 patches/refresh-temp diff --git a/meta b/meta index 3145f0d..5589884 100644 --- a/meta +++ b/meta @@ -1,6 +1,6 @@ Version: 1 -Previous: f0b77d1b0d27b29e6c1f0f154d446e060866310b -Head: 2b3d05b5970c73c0e075fceacfc1650acf0213ab +Previous: 371e4589468a6fe9c8aba7de678834a1419c940d +Head: 1fe642a78f65e038fdbe18d1bcac2d5eb40a9a97 Applied: marlin-pde-include-comment-for: 121f976406e6921f5b511f6dc4882985cf4b4133 add-to-marlin-gitignore: 6a0fad50983c4fb5b60173ae96a6eb96ae9d4976 @@ -11,6 +11,7 @@ Applied: eeprom-provide-smaller-code-fo: 734e4f2645cecfee83e7ac0cb12ffe2a393f5f91 m206-save-values-in-eeprom: edd3bb378915a4d3e17e3425db249807c73cc223 homeaxis-function: 2b3d05b5970c73c0e075fceacfc1650acf0213ab + refresh-temp: 1fe642a78f65e038fdbe18d1bcac2d5eb40a9a97 Unapplied: enable-eeprom-settings: d8e404a6e1984efdaa7ede947fed09a0bcf9051c Hidden: diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 0000000..cb50bd9 --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,99 @@ +Bottom: 52539e835a54ac0f6858a1c830cc03875bec4769 +Top: f693fc0a7b28acd01a23db82f7889d14d5516822 +Author: Ian Jackson +Date: 2012-08-09 19:09:35 +0100 + +Refresh of homeaxis-function + +--- + +diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde +index 9bcbf21..7b24e3b 100644 +--- a/Marlin/Marlin.pde ++++ b/Marlin/Marlin.pde +@@ -552,9 +552,15 @@ bool code_seen(char code) + return (strchr_pointer != NULL); //Return True if a character was found + } + +-static const PROGMEM float base_min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS }; +-static const PROGMEM float base_max_pos[3] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS }; +-static const PROGMEM float base_home_pos[3] = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS }; ++#define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \ ++static const PROGMEM 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_max_pos, MAX_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]; +@@ -564,32 +570,41 @@ static void axis_is_at_home(int axis) { + else 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))\ +- { \ +- 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<