From 3823a3f848efc637f9a9103a55442751104be1ac Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 9 Aug 2012 19:09:36 +0100 Subject: [PATCH] refresh --- meta | 7 ++- patches/homeaxis-function | 93 +++++++++++++++++++++++++++++++++++- patches/refresh-temp | 99 --------------------------------------- 3 files changed, 94 insertions(+), 105 deletions(-) delete mode 100644 patches/refresh-temp diff --git a/meta b/meta index 5589884..6189ac2 100644 --- a/meta +++ b/meta @@ -1,6 +1,6 @@ Version: 1 -Previous: 371e4589468a6fe9c8aba7de678834a1419c940d -Head: 1fe642a78f65e038fdbe18d1bcac2d5eb40a9a97 +Previous: 3aa8274e5756e54ab0606926adf5ed807af4e499 +Head: 5a7c15269ea9d129642cfd4122704001d3603e04 Applied: marlin-pde-include-comment-for: 121f976406e6921f5b511f6dc4882985cf4b4133 add-to-marlin-gitignore: 6a0fad50983c4fb5b60173ae96a6eb96ae9d4976 @@ -10,8 +10,7 @@ Applied: m206-always-use-homing-homeing: b5a83e7c60fcd37ea70396d521924b6c62555feb eeprom-provide-smaller-code-fo: 734e4f2645cecfee83e7ac0cb12ffe2a393f5f91 m206-save-values-in-eeprom: edd3bb378915a4d3e17e3425db249807c73cc223 - homeaxis-function: 2b3d05b5970c73c0e075fceacfc1650acf0213ab - refresh-temp: 1fe642a78f65e038fdbe18d1bcac2d5eb40a9a97 + homeaxis-function: 5a7c15269ea9d129642cfd4122704001d3603e04 Unapplied: enable-eeprom-settings: d8e404a6e1984efdaa7ede947fed09a0bcf9051c Hidden: diff --git a/patches/homeaxis-function b/patches/homeaxis-function index 508bf82..7b112e1 100644 --- a/patches/homeaxis-function +++ b/patches/homeaxis-function @@ -1,5 +1,5 @@ Bottom: 52539e835a54ac0f6858a1c830cc03875bec4769 -Top: 52539e835a54ac0f6858a1c830cc03875bec4769 +Top: f693fc0a7b28acd01a23db82f7889d14d5516822 Author: Ian Jackson Date: 2012-08-08 18:30:34 +0100 @@ -14,4 +14,93 @@ Signed-off-by: Ian Jackson --- - +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< -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<