From 65ccea9a5eb5436b976807c6393e64caddb79e35 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 8 Aug 2012 17:31:10 +0100 Subject: [PATCH] uncommit --- meta | 7 +- patches/eeprom-provide-smaller-code-fo | 105 ++++++++++++++++ patches/fixed-soft-limits-when-the-ori | 160 +++++++++++++++++++++++++ patches/m206-always-use-homing-homeing | 133 ++++++++++++++++++++ patches/m206-save-values-in-eeprom | 69 +++++++++++ patches/makefile-support-v-1 | 124 +++++++++++++++++++ 6 files changed, 597 insertions(+), 1 deletion(-) create mode 100644 patches/eeprom-provide-smaller-code-fo create mode 100644 patches/fixed-soft-limits-when-the-ori create mode 100644 patches/m206-always-use-homing-homeing create mode 100644 patches/m206-save-values-in-eeprom create mode 100644 patches/makefile-support-v-1 diff --git a/meta b/meta index 28bb209..ca21d7f 100644 --- a/meta +++ b/meta @@ -1,6 +1,11 @@ Version: 1 -Previous: None +Previous: e20e2b0ba06d4eaeca31a40157f21c9ecd3486f0 Head: a7ff3675bdb6149f684e0e3a15c1a594ea2db815 Applied: + fixed-soft-limits-when-the-ori: 538189cc19182f28209912efd353081f18aa76e7 + makefile-support-v-1: 59de9f09a248a5af04203378018ff95f86ff092d + m206-always-use-homing-homeing: 704568f265fbb370658a153f8240239dd776f5cc + eeprom-provide-smaller-code-fo: 544900812e955cd117d08b5871408ad6ed14f7fd + m206-save-values-in-eeprom: a7ff3675bdb6149f684e0e3a15c1a594ea2db815 Unapplied: Hidden: diff --git a/patches/eeprom-provide-smaller-code-fo b/patches/eeprom-provide-smaller-code-fo new file mode 100644 index 0000000..083f7d8 --- /dev/null +++ b/patches/eeprom-provide-smaller-code-fo @@ -0,0 +1,105 @@ +Bottom: 1b669c311107d1dd3a4b83e5e099e5155e4f27a4 +Top: 5fa92f577560a8def7ed5e4eb27c03563022c045 +Author: Ian Jackson +Date: 2012-08-04 16:13:25 +0100 + +eeprom: provide smaller code for SERIAL_ECHOPAIR_DOUBLE + +SERIAL_ECHOPAIR implies, eventually, two calls to MYSERIAL.print. One +of these has FORCE_INLINE for a per-character loop, and both involve +constructing a method call rather than a simple function call. + +Produce better and smaller code by providing SERIAL_ECHOPAIR_DOUBLE +which is a typechecking syntactic wrapper around a new function +serial_echopair_double. This saves XXXX bytes of program memory. + +It would arguably be nice to do this in general for each of the calls +to SERIAL_ECHOPAIR in EEPROM_printSettings. But actually I think a +better approach would be a table-driving settings printer, so we'll +have this incremental improvement for now. + +Signed-off-by: Ian Jackson + + +--- + +diff --git a/Marlin/EEPROMwrite.h b/Marlin/EEPROMwrite.h +index 96e2ec9..96791c7 100644 +--- a/Marlin/EEPROMwrite.h ++++ b/Marlin/EEPROMwrite.h +@@ -75,25 +75,34 @@ inline void EEPROM_StoreSettings() + } + + ++static void serial_echopair_double(const PROGMEM char *s, double v) { ++ serialprintPGM(s); ++ SERIAL_ECHO(v); ++} ++ ++#define SERIAL_ECHOPAIR_DOUBLE(s,v) \ ++ ((void)(&(v) == &acceleration), /* type check */ \ ++ serial_echopair_double(PSTR(s),(v))) ++ + inline void EEPROM_printSettings() + { // if def=true, the default values will be used + #ifdef EEPROM_SETTINGS + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM("Steps per unit:"); + SERIAL_ECHO_START; +- SERIAL_ECHOPAIR(" M92 X",axis_steps_per_unit[0]); +- SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[1]); +- SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[2]); +- SERIAL_ECHOPAIR(" E",axis_steps_per_unit[3]); ++ SERIAL_ECHOPAIR_DOUBLE(" M92 X",axis_steps_per_unit[0]); ++ SERIAL_ECHOPAIR_DOUBLE(" Y",axis_steps_per_unit[1]); ++ SERIAL_ECHOPAIR_DOUBLE(" Z",axis_steps_per_unit[2]); ++ SERIAL_ECHOPAIR_DOUBLE(" E",axis_steps_per_unit[3]); + SERIAL_ECHOLN(""); + + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):"); + SERIAL_ECHO_START; +- SERIAL_ECHOPAIR(" M203 X",max_feedrate[0]); +- SERIAL_ECHOPAIR(" Y",max_feedrate[1] ); +- SERIAL_ECHOPAIR(" Z", max_feedrate[2] ); +- SERIAL_ECHOPAIR(" E", max_feedrate[3]); ++ SERIAL_ECHOPAIR_DOUBLE(" M203 X",max_feedrate[0]); ++ SERIAL_ECHOPAIR_DOUBLE(" Y",max_feedrate[1] ); ++ SERIAL_ECHOPAIR_DOUBLE(" Z", max_feedrate[2] ); ++ SERIAL_ECHOPAIR_DOUBLE(" E", max_feedrate[3]); + SERIAL_ECHOLN(""); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):"); +@@ -106,24 +115,24 @@ inline void EEPROM_printSettings() + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration"); + SERIAL_ECHO_START; +- SERIAL_ECHOPAIR(" M204 S",acceleration ); +- SERIAL_ECHOPAIR(" T" ,retract_acceleration); ++ SERIAL_ECHOPAIR_DOUBLE(" M204 S",acceleration ); ++ SERIAL_ECHOPAIR_DOUBLE(" T" ,retract_acceleration); + SERIAL_ECHOLN(""); + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum xY jerk (mm/s), Z=maximum Z jerk (mm/s)"); + SERIAL_ECHO_START; +- SERIAL_ECHOPAIR(" M205 S",minimumfeedrate ); +- SERIAL_ECHOPAIR(" T" ,mintravelfeedrate ); ++ SERIAL_ECHOPAIR_DOUBLE(" M205 S",minimumfeedrate ); ++ SERIAL_ECHOPAIR_DOUBLE(" T" ,mintravelfeedrate ); + SERIAL_ECHOPAIR(" B" ,minsegmenttime ); +- SERIAL_ECHOPAIR(" X" ,max_xy_jerk ); +- SERIAL_ECHOPAIR(" Z" ,max_z_jerk); +- SERIAL_ECHOPAIR(" E" ,max_e_jerk); ++ SERIAL_ECHOPAIR_DOUBLE(" X" ,max_xy_jerk ); ++ SERIAL_ECHOPAIR_DOUBLE(" Z" ,max_z_jerk); ++ SERIAL_ECHOPAIR_DOUBLE(" E" ,max_e_jerk); + SERIAL_ECHOLN(""); + #ifdef PIDTEMP + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM("PID settings:"); + SERIAL_ECHO_START; +- SERIAL_ECHOPAIR(" M301 P",Kp); ++ SERIAL_ECHOPAIR_DOUBLE(" M301 P",Kp); + SERIAL_ECHOPAIR(" I" ,Ki/PID_dT); + SERIAL_ECHOPAIR(" D" ,Kd*PID_dT); + SERIAL_ECHOLN(""); diff --git a/patches/fixed-soft-limits-when-the-ori b/patches/fixed-soft-limits-when-the-ori new file mode 100644 index 0000000..ccbfc0a --- /dev/null +++ b/patches/fixed-soft-limits-when-the-ori @@ -0,0 +1,160 @@ +Bottom: e5f5e950c684ca0c28d54e21dc2f0d29cd3c1c95 +Top: c655a797e3b5192e7f839c7c53285901284a2b4b +Author: Chris Palmer +Date: 2012-06-02 13:17:47 +0100 + +Fixed soft limits when the origin is in the middle. +HOME_POS is now always where the endstop is and can be outside the limits. +The limits are now defined by MIN_POS and MAX_POS rather than HOME_POS and MAX_LENGTH. +The Z is axis now homed first if direction is away from the bed. + +Saguinololu limit pins change from MIN to MAX according to the homing direction. + + +--- + +diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h +index 2da2478..1248029 100644 +--- a/Marlin/Configuration.h ++++ b/Marlin/Configuration.h +@@ -187,9 +187,17 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th + + #define min_software_endstops true //If true, axis won't move to coordinates less than HOME_POS. + #define max_software_endstops true //If true, axis won't move to coordinates greater than the defined lengths below. +-#define X_MAX_LENGTH 205 +-#define Y_MAX_LENGTH 205 +-#define Z_MAX_LENGTH 200 ++// Travel limits after homing ++#define X_MAX_POS 205 ++#define X_MIN_POS 0 ++#define Y_MAX_POS 205 ++#define Y_MIN_POS 0 ++#define Z_MAX_POS 200 ++#define Z_MIN_POS 0 ++ ++#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS) ++#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS) ++#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS) + + // The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0 + #define X_HOME_POS 0 +diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde +index 2bba422..73f1f41 100644 +--- a/Marlin/Marlin.pde ++++ b/Marlin/Marlin.pde +@@ -562,7 +562,7 @@ 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_DIR == -1) ? LETTER##_HOME_POS : LETTER##_MAX_LENGTH;\ ++ current_position[LETTER##_AXIS] = LETTER##_HOME_POS;\ + destination[LETTER##_AXIS] = current_position[LETTER##_AXIS];\ + feedrate = 0.0;\ + endstops_hit_on_purpose();\ +@@ -656,6 +656,13 @@ void process_commands() + } + feedrate = 0.0; + home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))); ++ ++ #if Z_HOME_DIR > 0 // If homing away from BED do Z first ++ if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) { ++ HOMEAXIS(Z); ++ } ++ #endif ++ + #ifdef QUICK_HOME + if((home_all_axis)||( code_seen(axis_codes[X_AXIS]) && code_seen(axis_codes[Y_AXIS])) ) //first diagonal move + { +@@ -669,8 +676,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_DIR == -1) ? X_HOME_POS : X_MAX_LENGTH; +- current_position[Y_AXIS] = (Y_HOME_DIR == -1) ? Y_HOME_POS : Y_MAX_LENGTH; ++ current_position[X_AXIS] = X_HOME_POS; ++ current_position[Y_AXIS] = Y_HOME_POS; + 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]; +@@ -687,12 +694,14 @@ void process_commands() + } + + if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) { +- HOMEAXIS(Y); ++ HOMEAXIS(Y); + } + ++ #if Z_HOME_DIR < 0 // If homing towards BED do Z last + if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) { + HOMEAXIS(Z); + } ++ #endif + + if(code_seen(axis_codes[X_AXIS])) + { +@@ -1533,15 +1542,15 @@ void get_arc_coordinates() + void prepare_move() + { + if (min_software_endstops) { +- if (destination[X_AXIS] < X_HOME_POS) destination[X_AXIS] = X_HOME_POS; +- if (destination[Y_AXIS] < Y_HOME_POS) destination[Y_AXIS] = Y_HOME_POS; +- if (destination[Z_AXIS] < Z_HOME_POS) destination[Z_AXIS] = Z_HOME_POS; ++ if (destination[X_AXIS] < X_MIN_POS) destination[X_AXIS] = X_MIN_POS; ++ if (destination[Y_AXIS] < Y_MIN_POS) destination[Y_AXIS] = Y_MIN_POS; ++ if (destination[Z_AXIS] < Z_MIN_POS) destination[Z_AXIS] = Z_MIN_POS; + } + + if (max_software_endstops) { +- if (destination[X_AXIS] > X_MAX_LENGTH) destination[X_AXIS] = X_MAX_LENGTH; +- if (destination[Y_AXIS] > Y_MAX_LENGTH) destination[Y_AXIS] = Y_MAX_LENGTH; +- if (destination[Z_AXIS] > Z_MAX_LENGTH) destination[Z_AXIS] = Z_MAX_LENGTH; ++ if (destination[X_AXIS] > X_MAX_POS) destination[X_AXIS] = X_MAX_POS; ++ if (destination[Y_AXIS] > Y_MAX_POS) destination[Y_AXIS] = Y_MAX_POS; ++ if (destination[Z_AXIS] > Z_MAX_POS) destination[Z_AXIS] = Z_MAX_POS; + } + previous_millis_cmd = millis(); + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder); +diff --git a/Marlin/pins.h b/Marlin/pins.h +index c4d5659..419ddb6 100644 +--- a/Marlin/pins.h ++++ b/Marlin/pins.h +@@ -572,18 +572,33 @@ + + #define X_STEP_PIN 15 + #define X_DIR_PIN 21 +-#define X_MIN_PIN 18 +-#define X_MAX_PIN -1 ++#if X_HOME_DIR < 0 ++# define X_MIN_PIN 18 ++# define X_MAX_PIN -1 ++#else ++# define X_MIN_PIN -1 ++# define X_MAX_PIN 18 ++#endif + + #define Y_STEP_PIN 22 + #define Y_DIR_PIN 23 +-#define Y_MIN_PIN 19 +-#define Y_MAX_PIN -1 ++#if Y_HOME_DIR < 0 ++# define Y_MIN_PIN 19 ++# define Y_MAX_PIN -1 ++#else ++# define Y_MIN_PIN -1 ++# define Y_MAX_PIN 19 ++#endif + + #define Z_STEP_PIN 3 + #define Z_DIR_PIN 2 +-#define Z_MIN_PIN 20 +-#define Z_MAX_PIN -1 ++#if Z_HOME_DIR < 0 ++# define Z_MIN_PIN 20 ++# define Z_MAX_PIN -1 ++#else ++# define Z_MIN_PIN -1 ++# define Z_MAX_PIN 20 ++#endif + + #define E0_STEP_PIN 1 + #define E0_DIR_PIN 0 diff --git a/patches/m206-always-use-homing-homeing b/patches/m206-always-use-homing-homeing new file mode 100644 index 0000000..6ff4b46 --- /dev/null +++ b/patches/m206-always-use-homing-homeing @@ -0,0 +1,133 @@ +Bottom: 2863265553f0918e2af709f6fb8a01097102cf69 +Top: 1b669c311107d1dd3a4b83e5e099e5155e4f27a4 +Author: Ian Jackson +Date: 2012-08-01 21:12:14 +0100 + +M206: always use homing ("homeing") offsets + +Previously the parameters set in M206 would only be used if a G82 +command was sent with specific axis home values. This limits its +usefulness. + +Really, we should have a way to adjust the XYZ homing of a machine in +the eeprom. So as the first stage of this, make M206 affect every +home command. The values set using M206 are now added to the +configuration variables [XYZ]_HOME_POS. + +This is achieved by replacing all uses of [XYZ]_HOME_POS in the code +by [XYZ]_HOME_POS_A which is a macro which includes the adjustment. + +fixes #200 (in ErikZalm/Marlin). + +Signed-off-by: Ian Jackson + +minimums too + +FIXME FIXME FIXME + + +--- + +diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h +index 4123634..c8115af 100644 +--- a/Marlin/Marlin.h ++++ b/Marlin/Marlin.h +@@ -183,6 +183,7 @@ 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 unsigned char FanSpeed; + + // Handling multiple extruders pins +diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde +index 73f1f41..9f8e98c 100644 +--- a/Marlin/Marlin.pde ++++ b/Marlin/Marlin.pde +@@ -141,6 +141,7 @@ 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 }; + uint8_t active_extruder = 0; + unsigned char FanSpeed=0; + +@@ -541,6 +542,14 @@ 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 }; ++ ++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))\ + { \ +@@ -562,8 +571,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();\ + } +@@ -676,8 +685,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]; +@@ -1542,9 +1551,9 @@ void get_arc_coordinates() + void prepare_move() + { + if (min_software_endstops) { +- if (destination[X_AXIS] < X_MIN_POS) destination[X_AXIS] = X_MIN_POS; +- if (destination[Y_AXIS] < Y_MIN_POS) destination[Y_AXIS] = Y_MIN_POS; +- if (destination[Z_AXIS] < Z_MIN_POS) destination[Z_AXIS] = Z_MIN_POS; ++ if (destination[X_AXIS] < min_pos[0]) destination[X_AXIS] = min_pos[0]; ++ if (destination[Y_AXIS] < min_pos[1]) destination[Y_AXIS] = min_pos[1]; ++ if (destination[Z_AXIS] < min_pos[2]) destination[Z_AXIS] = min_pos[2]; + } + + if (max_software_endstops) { +diff --git a/Marlin/motion_control.cpp b/Marlin/motion_control.cpp +index f11d8c8..450924a 100644 +--- a/Marlin/motion_control.cpp ++++ b/Marlin/motion_control.cpp +@@ -126,9 +126,9 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8 + arc_target[E_AXIS] += extruder_per_segment; + + if (min_software_endstops) { +- if (arc_target[X_AXIS] < X_HOME_POS) arc_target[X_AXIS] = X_HOME_POS; +- if (arc_target[Y_AXIS] < Y_HOME_POS) arc_target[Y_AXIS] = Y_HOME_POS; +- if (arc_target[Z_AXIS] < Z_HOME_POS) arc_target[Z_AXIS] = Z_HOME_POS; ++ if (arc_target[X_AXIS] < min_pos[0]) arc_target[X_AXIS] = min_pos[0]; ++ if (arc_target[Y_AXIS] < min_pos[1]) arc_target[Y_AXIS] = min_pos[1]; ++ if (arc_target[Z_AXIS] < min_pos[2]) arc_target[Z_AXIS] = min_pos[2]; + } + + if (max_software_endstops) { +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!! + * M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec + * 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 ++* 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) + * 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. + * M221 - set the extrude multiplying S:factor in percent + * M400 - Finish all buffered moves. diff --git a/patches/m206-save-values-in-eeprom b/patches/m206-save-values-in-eeprom new file mode 100644 index 0000000..44a9072 --- /dev/null +++ b/patches/m206-save-values-in-eeprom @@ -0,0 +1,69 @@ +Bottom: 5fa92f577560a8def7ed5e4eb27c03563022c045 +Top: ddd160b1afdf3c41ea68ceeb8d9d125c06186447 +Author: Ian Jackson +Date: 2012-08-01 21:18:08 +0100 + +M206: save values in eeprom + +Really, we should have a way to adjust the XYZ homing of a machine in +the eeprom. So as the second stage of this, make the M206 home offset +parameters subject to the M500/M501/M502/M503 eeprom commands. + +Bump the eeprom version to "V06". + +Signed-off-by: Ian Jackson + + +--- + +diff --git a/Marlin/EEPROMwrite.h b/Marlin/EEPROMwrite.h +index 96791c7..baacc8d 100644 +--- a/Marlin/EEPROMwrite.h ++++ b/Marlin/EEPROMwrite.h +@@ -38,7 +38,7 @@ template int EEPROM_readAnything(int &ee, T& value) + // the default values are used whenever there is a change to the data, to prevent + // wrong data being written to the variables. + // ALSO: always make sure the variables in the Store and retrieve sections are in the same order. +-#define EEPROM_VERSION "V05" ++#define EEPROM_VERSION "V06" + + inline void EEPROM_StoreSettings() + { +@@ -57,6 +57,7 @@ inline void EEPROM_StoreSettings() + EEPROM_writeAnything(i,max_xy_jerk); + EEPROM_writeAnything(i,max_z_jerk); + EEPROM_writeAnything(i,max_e_jerk); ++ EEPROM_writeAnything(i,add_homeing); + #ifdef PIDTEMP + EEPROM_writeAnything(i,Kp); + EEPROM_writeAnything(i,Ki); +@@ -128,6 +129,13 @@ inline void EEPROM_printSettings() + SERIAL_ECHOPAIR_DOUBLE(" Z" ,max_z_jerk); + SERIAL_ECHOPAIR_DOUBLE(" E" ,max_e_jerk); + SERIAL_ECHOLN(""); ++ SERIAL_ECHO_START; ++ SERIAL_ECHOLNPGM("Home offset (mm):"); ++ SERIAL_ECHO_START; ++ SERIAL_ECHOPAIR_DOUBLE(" M206 X",add_homeing[0] ); ++ SERIAL_ECHOPAIR_DOUBLE(" Y" ,add_homeing[1] ); ++ SERIAL_ECHOPAIR_DOUBLE(" Z" ,add_homeing[2] ); ++ SERIAL_ECHOLN(""); + #ifdef PIDTEMP + SERIAL_ECHO_START; + SERIAL_ECHOLNPGM("PID settings:"); +@@ -162,6 +170,7 @@ inline void EEPROM_RetrieveSettings(bool def=false) + EEPROM_readAnything(i,max_xy_jerk); + EEPROM_readAnything(i,max_z_jerk); + EEPROM_readAnything(i,max_e_jerk); ++ EEPROM_readAnything(i,add_homeing); + #ifndef PIDTEMP + float Kp,Ki,Kd; + #endif +@@ -192,6 +201,7 @@ inline void EEPROM_RetrieveSettings(bool def=false) + max_xy_jerk=DEFAULT_XYJERK; + max_z_jerk=DEFAULT_ZJERK; + max_e_jerk=DEFAULT_EJERK; ++ add_homeing[0] = add_homeing[1] = add_homeing[2] = 0; + SERIAL_ECHO_START; + SERIAL_ECHOLN("Using Default settings:"); + } diff --git a/patches/makefile-support-v-1 b/patches/makefile-support-v-1 new file mode 100644 index 0000000..7d0e426 --- /dev/null +++ b/patches/makefile-support-v-1 @@ -0,0 +1,124 @@ +Bottom: c655a797e3b5192e7f839c7c53285901284a2b4b +Top: 2863265553f0918e2af709f6fb8a01097102cf69 +Author: Ian Jackson +Date: 2012-08-01 21:31:38 +0100 + +Makefile: support V=1 + +Often it can be useful to see the actual commands being run by make. +Other projects (eg, the Linux kernel) support this with a "V=1" make +parameter. Do the same here. + +Signed-off-by: Ian Jackson + + +--- + +diff --git a/Marlin/Makefile b/Marlin/Makefile +index fe77a2a..a85111d 100644 +--- a/Marlin/Makefile ++++ b/Marlin/Makefile +@@ -170,6 +170,14 @@ ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) + ALL_CXXFLAGS = -mmcu=$(MCU) $(CXXFLAGS) + ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS) + ++# set V=1 (eg, "make V=1") to print the full commands etc. ++ifneq ($V,1) ++ Pecho=@echo ++ P=@ ++else ++ Pecho=@: ++ P= ++endif + + # Default target. + all: sizeafter +@@ -178,7 +186,7 @@ build: applet elf hex + + # Creates the object directory + applet: +- @mkdir -p applet ++ $P mkdir -p applet + + # the .cpp for Marlin depends on the .pde + #applet/$(TARGET).cpp: $(TARGET).pde +@@ -189,10 +197,10 @@ applet/%.cpp: %.pde $(MAKEFILE) + # Here is the "preprocessing". + # It creates a .cpp file based with the same name as the .pde file. + # On top of the new .cpp file comes the WProgram.h header. +- @echo " WR $@" +- @echo '#include "WProgram.h"' > $@ +- @echo '#include "$<"' >>$@ +- @echo '#include "$(ARDUINO)/main.cpp"' >> $@ ++ $(Pecho) " WR $@" ++ $P echo '#include "WProgram.h"' > $@ ++ $P echo '#include "$<"' >>$@ ++ $P echo '#include "$(ARDUINO)/main.cpp"' >> $@ + + elf: applet/$(TARGET).elf + hex: applet/$(TARGET).hex +@@ -215,10 +223,10 @@ endif + HEXSIZE = $(SIZE) --target=$(FORMAT) applet/$(TARGET).hex + ELFSIZE = $(SIZE) applet/$(TARGET).elf + sizebefore: +- @if [ -f applet/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi ++ $P if [ -f applet/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi + + sizeafter: build +- @if [ -f applet/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi ++ $P if [ -f applet/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi + + + # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +@@ -241,8 +249,8 @@ extcoff: $(TARGET).elf + .PRECIOUS: .o + + .elf.hex: +- @echo " COPY $@" +- @$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ ++ $(Pecho) " COPY $@" ++ $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ + + .elf.eep: + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ +@@ -258,29 +266,29 @@ extcoff: $(TARGET).elf + + # Link: create ELF output file from library. + applet/$(TARGET).elf: applet/$(TARGET).cpp applet/core.a Configuration.h +- @echo " CXX $@" +- @$(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS) ++ $(Pecho) " CXX $@" ++ $P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS) + + applet/core.a: $(OBJ) +- @for i in $(OBJ); do echo " AR $$i"; $(AR) rcs applet/core.a $$i; done ++ $P for i in $(OBJ); do echo " AR $$i"; $(AR) rcs applet/core.a $$i; done + + applet/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) +- @echo " CC $@" +- @$(CC) -MMD -c $(ALL_CFLAGS) $< -o $@ ++ $(Pecho) " CC $@" ++ $P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@ + + applet/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE) +- @echo " CXX $@" +- @$(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ ++ $(Pecho) " CXX $@" ++ $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ + + + # Target: clean project. + clean: +- @echo " RM applet/*" +- @$(REMOVE) applet/$(TARGET).hex applet/$(TARGET).eep applet/$(TARGET).cof applet/$(TARGET).elf \ ++ $(Pecho) " RM applet/*" ++ $P $(REMOVE) applet/$(TARGET).hex applet/$(TARGET).eep applet/$(TARGET).cof applet/$(TARGET).elf \ + applet/$(TARGET).map applet/$(TARGET).sym applet/$(TARGET).lss applet/$(TARGET).cpp applet/core.a \ + $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d) +- @echo " RMDIR applet/" +- @rm -rf applet ++ $(Pecho) " RMDIR applet/" ++ $P rm -rf applet + + + .PHONY: all build elf hex eep lss sym program coff extcoff clean depend applet_files sizebefore sizeafter -- 2.30.2