From f291e33acdece0129bceffc7bc0c38603325b1dd Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sun, 12 Jun 2016 19:24:34 +0200 Subject: [PATCH] Attic: tar up 'eeconfig'. --- attic/{eeconfig/README => eeconfig-README} | 0 attic/eeconfig.tar.gz | Bin 0 -> 6046 bytes ...work-on-EEPROM-configuration-storage.patch | 344 ------------------ attic/eeconfig/0002-documentation.patch | 84 ----- ...ound-eeconfig-stuff-make-it-optional.patch | 318 ---------------- ...e-cleanup-missed-a-section-in-temp.c.patch | 39 -- 6 files changed, 785 deletions(-) rename attic/{eeconfig/README => eeconfig-README} (100%) create mode 100644 attic/eeconfig.tar.gz delete mode 100644 attic/eeconfig/0001-preliminary-work-on-EEPROM-configuration-storage.patch delete mode 100644 attic/eeconfig/0002-documentation.patch delete mode 100644 attic/eeconfig/0003-wrap-an-ifdef-around-eeconfig-stuff-make-it-optional.patch delete mode 100644 attic/eeconfig/0004-merge-cleanup-missed-a-section-in-temp.c.patch diff --git a/attic/eeconfig/README b/attic/eeconfig-README similarity index 100% rename from attic/eeconfig/README rename to attic/eeconfig-README diff --git a/attic/eeconfig.tar.gz b/attic/eeconfig.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..28f29669a49b34843c451aae4f7a901d06c937aa GIT binary patch literal 6046 zcmV;P7h&ihiwFRVnq5}_1MEC&bK5wQ`6~U2-t5&xjzpOcJ?$hrPAn&`8znBwsd2Ki zr{V*&xRFR7N!gJvx!-=>07#J(sn{7OGrJd7Dl&maqXBfI8;x!0C%zsd7J)BAeg(7IY*f1qk=zoS2Z?l+_n6m+JpTAC{~? zEsAm(vbneLd^21r*FpF}34CQVIyrqaRs`5GG-D47qc{l73)a3gWBZHqLJQpMbt=|h z*R_sZe^u}H4CE8tz~2X;evb+Gf4=@lVX%O1w>#|h+^%CeJ*Ved4zrj!=-67vGA+&0 z?ZLpdI|hSs;KPJng4PFB-Q)j2$JMM8nmrhM_RM5+1Vgwdap<|O=d@=_KW5?27Yo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)SC`3ce$<>7acf&t(=xvv9LI$^Hti0_$xLAa9f) zeXBrvZ?N&&;8QDC=GHr(A2DCDv8lavp$|=)cqUs_PP5@mTtIM zhMpn^+<)42e#X?M%ly(B2mRE5-v#cfav20Oa_|hyZv10G5>ZY5)KL literal 0 HcmV?d00001 diff --git a/attic/eeconfig/0001-preliminary-work-on-EEPROM-configuration-storage.patch b/attic/eeconfig/0001-preliminary-work-on-EEPROM-configuration-storage.patch deleted file mode 100644 index 63e6fca..0000000 --- a/attic/eeconfig/0001-preliminary-work-on-EEPROM-configuration-storage.patch +++ /dev/null @@ -1,344 +0,0 @@ -From 555966f5dbd6d6fbdebea84c14bab1b2c88cc43e Mon Sep 17 00:00:00 2001 -From: Michael Moon -Date: Mon, 28 Mar 2011 00:28:01 +1100 -Subject: preliminary work on EEPROM configuration storage - ---- - eeconfig.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ - eeconfig.h | 45 +++++++++++++++++++++++++++++++++++++ - gcode_parse.c | 2 +- - gcode_parse.h | 4 ++-- - gcode_process.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - mendel.c | 4 ++++ - serial.c | 16 +++++++------ - temp.c | 8 ++++++- - 8 files changed, 192 insertions(+), 11 deletions(-) - create mode 100644 eeconfig.c - create mode 100644 eeconfig.h - -diff --git a/eeconfig.c b/eeconfig.c -new file mode 100644 -index 0000000..931866e ---- /dev/null -+++ b/eeconfig.c -@@ -0,0 +1,54 @@ -+#include "eeconfig.h" -+ -+#include -+ -+#include "crc.h" -+#include "config.h" -+#include "clock.h" -+ -+/// in-memory configuration data structure -+eeconfig_struct eeconfig; -+ -+/// in-eeprom configuration data structure -+eeconfig_struct EEMEM EE_config; -+ -+void eeconfig_init() { -+ uint16_t mycrc; -+ eeprom_read_block(&eeconfig, &EE_config, sizeof(eeconfig_struct)); -+ mycrc = crc_block(&eeconfig, sizeof(eeconfig_struct) - sizeof(uint16_t)); -+ if (mycrc != eeconfig.crc) { -+ // set sane defaults -+ eeconfig.steps_per_mm_x = STEPS_PER_MM_X; -+ eeconfig.steps_per_mm_y = STEPS_PER_MM_Y; -+ eeconfig.steps_per_mm_z = STEPS_PER_MM_Z; -+ eeconfig.steps_per_mm_e = STEPS_PER_MM_E; -+ -+ eeconfig.size_x = X_MAX; -+ eeconfig.size_y = Y_MAX; -+ eeconfig.size_z = Z_MAX; -+ -+ eeconfig.max_speed_x = MAXIMUM_FEEDRATE_X; -+ eeconfig.max_speed_y = MAXIMUM_FEEDRATE_Y; -+ eeconfig.max_speed_z = MAXIMUM_FEEDRATE_Z; -+ eeconfig.max_speed_e = MAXIMUM_FEEDRATE_E; -+ -+ eeconfig.max_temp_e = 1000; -+ eeconfig.max_temp_b = 480; -+ eeconfig.max_temp_r = 240; -+ -+ eeconfig.min_endstop_pos_z = Z_MIN; -+ -+ eeconfig.temp_hysteresis = TEMP_HYSTERESIS; -+ eeconfig.temp_residency = TEMP_RESIDENCY_TIME; -+ -+ eeconfig.baud = BAUD; -+ } -+} -+ -+void eeconfig_save() { -+ eeconfig.crc = crc_block(&eeconfig, sizeof(eeconfig_struct) - sizeof(uint16_t)); -+ eeprom_write_block(&eeconfig, &EE_config, sizeof(eeconfig_struct)); -+ do { -+ clock_poll(); -+ } while (eeprom_is_ready() == 0); -+} -diff --git a/eeconfig.h b/eeconfig.h -new file mode 100644 -index 0000000..2b489c0 ---- /dev/null -+++ b/eeconfig.h -@@ -0,0 +1,45 @@ -+#ifndef _EECONFIG_H -+#define _EECONFIG_H -+ -+#include -+ -+typedef struct { -+ uint32_t steps_per_mm_x; -+ uint32_t steps_per_mm_y; -+ uint32_t steps_per_mm_z; -+ uint32_t steps_per_mm_e; -+ -+ uint32_t size_x; -+ uint32_t size_y; -+ uint32_t size_z; -+ -+ uint32_t max_speed_x; -+ uint32_t max_speed_y; -+ uint32_t max_speed_z; -+ uint32_t max_speed_e; -+ -+ uint16_t max_temp_e; -+ uint16_t max_temp_b; -+ uint16_t max_temp_r; -+ -+ uint32_t min_endstop_pos_z; -+ -+ uint16_t temp_hysteresis; -+ uint16_t temp_residency; -+ -+ uint32_t baud; -+ -+ struct { -+ uint16_t adc_value; -+ uint16_t temperature; -+ } temptable[20]; -+ -+ uint16_t crc; -+} eeconfig_struct; -+ -+extern eeconfig_struct eeconfig; -+ -+void eeconfig_init(void); -+void eeconfig_save(void); -+ -+#endif /* _EECONFIG_H */ -diff --git a/gcode_parse.c b/gcode_parse.c -index 0668513..817fe85 100644 ---- a/gcode_parse.c -+++ b/gcode_parse.c -@@ -118,7 +118,7 @@ void gcode_parse_char(uint8_t c) { - case 'M': - next_target.M = read_digit.mantissa; - if (DEBUG_ECHO && (debug_flags & DEBUG_ECHO)) -- serwrite_uint8(next_target.M); -+ serwrite_uint16(next_target.M); - break; - case 'X': - if (next_target.option_inches) -diff --git a/gcode_parse.h b/gcode_parse.h -index d15716d..216a375 100644 ---- a/gcode_parse.h -+++ b/gcode_parse.h -@@ -44,11 +44,11 @@ typedef struct { - }; - - uint8_t G; ///< G command number -- uint8_t M; ///< M command number -+ uint16_t M; ///< M command number - TARGET target; ///< target position: X, Y, Z, E and F - - int32_t S; ///< S word (various uses) -- uint16_t P; ///< P word (various uses) -+ int32_t P; ///< P word (various uses) - - uint8_t T; ///< T word (tool index) - -diff --git a/gcode_process.c b/gcode_process.c -index 4cb7a41..e97fff6 100644 ---- a/gcode_process.c -+++ b/gcode_process.c -@@ -26,6 +26,7 @@ - #include "clock.h" - #include "config_wrapper.h" - #include "home.h" -+#include "eeconfig.h" - - /// the current tool - uint8_t tool; -@@ -736,15 +737,84 @@ void process_gcode_command() { - - #ifdef DEBUG - case 240: -+ case 340: - //? --- M240: echo off --- - //? Disable echo. - //? This command is only available in DEBUG builds. -+ // EEPROM Configuration as per http://reprap.org/wiki/M-codes_for_EEPROM_config -+ // M244 - set baudrate -+ case 244: -+ if (next_target.seen_S) -+ if (next_target.S >= 1200 && next_target.S <= 1000000) -+ eeconfig.baud = next_target.S; -+ break; -+ // M245 - Write temp table value, S(index), X(adc reading) Y(temperature) -+ /// TODO: check values for sanity -+ case 245: -+ if (next_target.seen_S && next_target.seen_X && next_target.seen_Y) { -+ eeconfig.temptable[next_target.S].adc_value = next_target.target.X; -+ eeconfig.temptable[next_target.S].temperature = next_target.target.Y; -+ } -+ break; -+ // M246 - choose thermistor profile -+ // M247 - set heater PWM, see M135 above -+ // M248 - PID stuff- see M130-M133 above -+ // M249 - temp residency time - wait for all temps to be within target for this long before continuing M109 and friends -+ case 249: -+ if (next_target.seen_P) -+ eeconfig.temp_residency = next_target.P; -+ break; -+ // M250 - Z min endstop position - non-zero to avoid head crashing into bed during homing -+ case 250: -+ if (next_target.seen_Z) -+ eeconfig.min_endstop_pos_z = next_target.target.Z; -+ break; -+ // M251 - set max bed temp (failsafe) -+ case 251: -+ break; -+ // M252 - set max extruder temp (failsafe) -+ // M253 - max speeds -+ case 253: -+ if (next_target.seen_X) -+ eeconfig.max_speed_x = next_target.target.X; -+ if (next_target.seen_Y) -+ eeconfig.max_speed_y = next_target.target.Y; -+ if (next_target.seen_Z) -+ eeconfig.max_speed_z = next_target.target.Z; -+ if (next_target.seen_E) -+ eeconfig.max_speed_e = next_target.target.E; -+ break; -+ // M254 - set build volume -+ case 254: -+ if (next_target.seen_X) -+ eeconfig.size_x = next_target.target.X; -+ if (next_target.seen_Y) -+ eeconfig.size_y = next_target.target.Y; -+ if (next_target.seen_Z) -+ eeconfig.size_z = next_target.target.Z; -+ break; -+ // M255 - set steps per mm -+ case 255: -+ if (next_target.seen_X) -+ eeconfig.steps_per_mm_x = next_target.target.X; -+ if (next_target.seen_Y) -+ eeconfig.steps_per_mm_y = next_target.target.Y; -+ if (next_target.seen_Z) -+ eeconfig.steps_per_mm_z = next_target.target.Z; -+ if (next_target.seen_E) -+ eeconfig.steps_per_mm_e = next_target.target.E; -+ break; -+ -+ -+ // DEBUG -+ #ifdef DEBUG - debug_flags &= ~DEBUG_ECHO; - serial_writestr_P(PSTR("Echo off")); - // newline is sent from gcode_parse after we return - break; - - case 241: -+ case 341: - //? --- M241: echo on --- - //? Enable echo. - //? This command is only available in DEBUG builds. -diff --git a/mendel.c b/mendel.c -index dd9a99c..3f3266c 100644 ---- a/mendel.c -+++ b/mendel.c -@@ -48,6 +48,7 @@ - #include "arduino.h" - #include "clock.h" - #include "intercom.h" -+#include "eeconfig.h" - #include "simulator.h" - - #ifdef SIMINFO -@@ -194,6 +195,9 @@ void io_init(void) { - - /// Startup code, run when we come out of reset - void init(void) { -+ // read config from eeprom -+ eeconfig_init(); -+ - // set up watchdog - wd_init(); - -diff --git a/serial.c b/serial.c -index a7a0bd4..df0f873 100644 ---- a/serial.c -+++ b/serial.c -@@ -14,6 +14,7 @@ - #include "memory_barrier.h" - - #include "arduino.h" -+#include "eeconfig.h" - - /// size of TX and RX buffers. MUST be a \f$2^n\f$ value - #define BUFSIZE 64 -@@ -84,13 +85,14 @@ volatile uint8_t flowflags = FLOWFLAG_SEND_XON; - /// set up baud generator and interrupts, clear buffers - void serial_init() - { --#if BAUD > 38401 -- UCSR0A = MASK(U2X0); -- UBRR0 = (((F_CPU / 8) / BAUD) - 0.5); --#else -- UCSR0A = 0; -- UBRR0 = (((F_CPU / 16) / BAUD) - 0.5); --#endif -+ if (eeconfig.baud > 38401) { -+ UCSR0A = MASK(U2X0); -+ UBRR0 = ((F_CPU / 8) / eeconfig.baud) - 1; -+ } -+ else { -+ UCSR0A = 0; -+ UBRR0 = ((F_CPU / 16) / eeconfig.baud) - 1; -+ } - - UCSR0B = MASK(RXEN0) | MASK(TXEN0); - UCSR0C = MASK(UCSZ01) | MASK(UCSZ00); -diff --git a/temp.c b/temp.c -index dd4253c..be7f702 100644 ---- a/temp.c -+++ b/temp.c -@@ -17,6 +17,7 @@ - #include "debug.h" - #ifndef EXTRUDER - #include "sersendf.h" -+ #include "eeconfig.h" - #endif - #include "heater.h" - #ifdef TEMP_INTERCOM -@@ -331,9 +332,14 @@ uint8_t temp_achieved() { - uint8_t all_ok = 255; - - for (i = 0; i < NUM_TEMP_SENSORS; i++) { -+ #ifndef EXTRUDER - if (temp_sensors_runtime[i].target_temp > 0 && -- temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100)) -+ temp_sensors_runtime[i].temp_residency < eeconfig.temp_residency*100) - all_ok = 0; -+ #else -+ if (temp_sensors_runtime[i].temp_residency < TEMP_RESIDENCY_TIME*100) -+ all_ok = 0; -+ #endif - } - return all_ok; - } --- -2.1.0 - diff --git a/attic/eeconfig/0002-documentation.patch b/attic/eeconfig/0002-documentation.patch deleted file mode 100644 index cb13036..0000000 --- a/attic/eeconfig/0002-documentation.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 36497dde3047fb7a08a29b473fa2408c61f9e7bb Mon Sep 17 00:00:00 2001 -From: Michael Moon -Date: Mon, 28 Mar 2011 20:57:30 +1100 -Subject: documentation - ---- - eeconfig.h | 44 ++++++++++++++++++++++++-------------------- - 1 file changed, 24 insertions(+), 20 deletions(-) - -diff --git a/eeconfig.h b/eeconfig.h -index 2b489c0..e9a8a70 100644 ---- a/eeconfig.h -+++ b/eeconfig.h -@@ -3,43 +3,47 @@ - - #include - -+/// this doubles as both an in-eeprom and in-memory storage struct for configuration settings - typedef struct { -- uint32_t steps_per_mm_x; -- uint32_t steps_per_mm_y; -- uint32_t steps_per_mm_z; -- uint32_t steps_per_mm_e; -+ uint32_t steps_per_mm_x; ///< steps per mm. critically important for accurate prints -+ uint32_t steps_per_mm_y; ///< steps per mm. critically important for accurate prints -+ uint32_t steps_per_mm_z; ///< steps per mm. critically important for accurate prints -+ uint32_t steps_per_mm_e; ///< steps per mm. critically important for accurate prints - -- uint32_t size_x; -- uint32_t size_y; -- uint32_t size_z; -+ uint32_t size_x; ///< build volume. don't allow axes to move outside an area of this size -+ uint32_t size_y; ///< build volume. don't allow axes to move outside an area of this size -+ uint32_t size_z; ///< build volume. don't allow axes to move outside an area of this size - -- uint32_t max_speed_x; -- uint32_t max_speed_y; -- uint32_t max_speed_z; -- uint32_t max_speed_e; -+ uint32_t max_speed_x; ///< axis speed limit. Any move which requires this axis to go above this speed will have its specified speed reduced, preserving geometry. -+ uint32_t max_speed_y; ///< axis speed limit. Any move which requires this axis to go above this speed will have its specified speed reduced, preserving geometry. -+ uint32_t max_speed_z; ///< axis speed limit. Any move which requires this axis to go above this speed will have its specified speed reduced, preserving geometry. -+ uint32_t max_speed_e; ///< axis speed limit. Any move which requires this axis to go above this speed will have its specified speed reduced, preserving geometry. - -- uint16_t max_temp_e; -- uint16_t max_temp_b; -- uint16_t max_temp_r; -+ uint16_t max_temp_e; ///< do not allow temperature to go above this amount even if host software requests it, assume host software has gone crazy. -+ uint16_t max_temp_b; ///< do not allow temperature to go above this amount even if host software requests it, assume host software has gone crazy. -+ uint16_t max_temp_r; ///< do not allow temperature to go above this amount even if host software requests it, assume host software has gone crazy. - -- uint32_t min_endstop_pos_z; -+ uint32_t min_endstop_pos_z; ///< this is the Z position where the endstop is encountered. This helps prevent the head crashing into the bed while homing. To use, set this value to 3mm or so, then adjust your Z endstop flag so that it trips when your extruder nozzle is 3mm from your bed. - -- uint16_t temp_hysteresis; -- uint16_t temp_residency; -+ uint16_t temp_hysteresis; ///< temperature has to be within target +/- this amount for M109 and friends to continue -+ uint16_t temp_residency; ///< temperature has to be near target for this long for M109 and friends to continue - -- uint32_t baud; -+ uint32_t baud; ///< serial baud rate to communicate at. If changed, does not take effect until reset. \warning if a bad value is progammed, the only way to recover is to re-flash your eeprom from the host. - - struct { - uint16_t adc_value; - uint16_t temperature; -- } temptable[20]; -+ } temptable[20]; ///< the temperature lookup table for linear interpolation of ADC readings -> temperatures - -- uint16_t crc; -+ uint16_t crc; ///< data integrity check. If crc doesn't match data, use defaults instead. - } eeconfig_struct; - - extern eeconfig_struct eeconfig; - -+/// read settings from eeprom - void eeconfig_init(void); -+ -+/// save current settings to eeprom - void eeconfig_save(void); - - #endif /* _EECONFIG_H */ --- -2.1.0 - diff --git a/attic/eeconfig/0003-wrap-an-ifdef-around-eeconfig-stuff-make-it-optional.patch b/attic/eeconfig/0003-wrap-an-ifdef-around-eeconfig-stuff-make-it-optional.patch deleted file mode 100644 index a2d5cca..0000000 --- a/attic/eeconfig/0003-wrap-an-ifdef-around-eeconfig-stuff-make-it-optional.patch +++ /dev/null @@ -1,318 +0,0 @@ -From 186d4c39770c36051232dcc8fb35d8e10841875b Mon Sep 17 00:00:00 2001 -From: Michael Moon -Date: Mon, 28 Mar 2011 21:31:58 +1100 -Subject: wrap an ifdef around eeconfig stuff, make it optional and disabled by - default - ---- - config.default.h | 22 +++++++++++++++------- - config.gen3.h | 18 ++++++++++++++---- - config.gen6.h | 16 ++++++++++++---- - config.ramps-v1.2.h | 22 +++++++++++++++------- - eeconfig.c | 4 ++++ - gcode_process.c | 3 ++- - mendel.c | 2 ++ - serial.c | 11 +++++++++++ - temp.c | 38 +++++++++++++++++++++++++++----------- - 9 files changed, 102 insertions(+), 34 deletions(-) - -diff --git a/config.default.h b/config.default.h -index c15969b..62cb3e2 100644 ---- a/config.default.h -+++ b/config.default.h -@@ -515,20 +515,28 @@ DEFINE_HEATER(bed, PB4, 1) - */ - // #define DEBUG - -+/** \def EECONFIG -+ EECONFIG -+ allows runtime reconfiguration of critical variables -+ -+ See http://reprap.org/wiki/M-codes_for_EEPROM_config -+*/ -+// #define EECONFIG -+ - /** \def BANG_BANG --BANG_BANG --drops PID loop from heater control, reduces code size significantly (1300 bytes!) --may allow DEBUG on '168 -+ BANG_BANG -+ drops PID loop from heater control, reduces code size significantly (1300 bytes!) -+ may allow DEBUG on '168 - */ - // #define BANG_BANG - /** \def BANG_BANG_ON --BANG_BANG_ON --PWM value for 'on' -+ BANG_BANG_ON -+ PWM value for 'on' - */ - // #define BANG_BANG_ON 200 - /** \def BANG_BANG_OFF --BANG_BANG_OFF --PWM value for 'off' -+ BANG_BANG_OFF -+ PWM value for 'off' - */ - // #define BANG_BANG_OFF 45 - -diff --git a/config.gen3.h b/config.gen3.h -index bcbbd75..05f7996 100644 ---- a/config.gen3.h -+++ b/config.gen3.h -@@ -519,19 +519,29 @@ DEFINE_TEMP_SENSOR(bed, TT_INTERCOM, AIO1, 0) - */ - // #define DEBUG - -+/** \def EECONFIG -+EECONFIG -+allows runtime reconfiguration of critical variables -+ -+See http://reprap.org/wiki/M-codes_for_EEPROM_config -+*/ -+// #define EECONFIG -+ - /** \def BANG_BANG - BANG_BANG - drops PID loop from heater control, reduces code size significantly (1300 bytes!) - may allow DEBUG on '168 --*//** \def BANG_BANG_ON -+*/ -+// #define BANG_BANG -+/** \def BANG_BANG_ON - BANG_BANG_ON - PWM value for 'on' --*//** \def BANG_BANG_OFF -+*/ -+// #define BANG_BANG_ON 200 -+/** \def BANG_BANG_OFF - BANG_BANG_OFF - PWM value for 'off' - */ --// #define BANG_BANG --// #define BANG_BANG_ON 200 - // #define BANG_BANG_OFF 45 - - /** -diff --git a/config.gen6.h b/config.gen6.h -index 7b810e4..96b2e7c 100644 ---- a/config.gen6.h -+++ b/config.gen6.h -@@ -503,6 +503,14 @@ DEFINE_HEATER(extruder, PD6, 1) - */ - // #define DEBUG - -+/** \def EECONFIG -+ EECONFIG -+ allows runtime reconfiguration of critical variables -+ -+ See http://reprap.org/wiki/M-codes_for_EEPROM_config -+*/ -+// #define EECONFIG -+ - /** \def BANG_BANG - BANG_BANG - drops PID loop from heater control, reduces code size significantly (1300 bytes!) -@@ -510,13 +518,13 @@ DEFINE_HEATER(extruder, PD6, 1) - */ - // #define BANG_BANG - /** \def BANG_BANG_ON --BANG_BANG_ON --PWM value for 'on' -+ BANG_BANG_ON -+ PWM value for 'on' - */ - // #define BANG_BANG_ON 200 - /** \def BANG_BANG_OFF --BANG_BANG_OFF --PWM value for 'off' -+ BANG_BANG_OFF -+ PWM value for 'off' - */ - // #define BANG_BANG_OFF 45 - -diff --git a/config.ramps-v1.2.h b/config.ramps-v1.2.h -index bcb9af8..2486cd7 100644 ---- a/config.ramps-v1.2.h -+++ b/config.ramps-v1.2.h -@@ -512,20 +512,28 @@ DEFINE_HEATER(fan, PH6, 1) - */ - // #define DEBUG - -+/** \def EECONFIG -+ EECONFIG -+ allows runtime reconfiguration of critical variables -+ -+ See http://reprap.org/wiki/M-codes_for_EEPROM_config -+*/ -+// #define EECONFIG -+ - /** \def BANG_BANG --BANG_BANG --drops PID loop from heater control, reduces code size significantly (1300 bytes!) --may allow DEBUG on '168 -+ BANG_BANG -+ drops PID loop from heater control, reduces code size significantly (1300 bytes!) -+ may allow DEBUG on '168 - */ - // #define BANG_BANG - /** \def BANG_BANG_ON --BANG_BANG_ON --PWM value for 'on' -+ BANG_BANG_ON -+ PWM value for 'on' - */ - // #define BANG_BANG_ON 200 - /** \def BANG_BANG_OFF --BANG_BANG_OFF --PWM value for 'off' -+ BANG_BANG_OFF -+ PWM value for 'off' - */ - // #define BANG_BANG_OFF 45 - -diff --git a/eeconfig.c b/eeconfig.c -index 931866e..105f36d 100644 ---- a/eeconfig.c -+++ b/eeconfig.c -@@ -13,6 +13,7 @@ eeconfig_struct eeconfig; - eeconfig_struct EEMEM EE_config; - - void eeconfig_init() { -+ #ifdef EECONFIG - uint16_t mycrc; - eeprom_read_block(&eeconfig, &EE_config, sizeof(eeconfig_struct)); - mycrc = crc_block(&eeconfig, sizeof(eeconfig_struct) - sizeof(uint16_t)); -@@ -43,12 +44,15 @@ void eeconfig_init() { - - eeconfig.baud = BAUD; - } -+ #endif /* EECONFIG */ - } - - void eeconfig_save() { -+ #ifdef EECONFIG - eeconfig.crc = crc_block(&eeconfig, sizeof(eeconfig_struct) - sizeof(uint16_t)); - eeprom_write_block(&eeconfig, &EE_config, sizeof(eeconfig_struct)); - do { - clock_poll(); - } while (eeprom_is_ready() == 0); -+ #endif /* EECONFIG */ - } -diff --git a/gcode_process.c b/gcode_process.c -index e97fff6..310eed4 100644 ---- a/gcode_process.c -+++ b/gcode_process.c -@@ -741,6 +741,7 @@ void process_gcode_command() { - //? --- M240: echo off --- - //? Disable echo. - //? This command is only available in DEBUG builds. -+ #ifdef EECONFIG - // EEPROM Configuration as per http://reprap.org/wiki/M-codes_for_EEPROM_config - // M244 - set baudrate - case 244: -@@ -804,7 +805,7 @@ void process_gcode_command() { - if (next_target.seen_E) - eeconfig.steps_per_mm_e = next_target.target.E; - break; -- -+ #endif /* EECONFIG */ - - // DEBUG - #ifdef DEBUG -diff --git a/mendel.c b/mendel.c -index 3f3266c..3b55883 100644 ---- a/mendel.c -+++ b/mendel.c -@@ -195,8 +195,10 @@ void io_init(void) { - - /// Startup code, run when we come out of reset - void init(void) { -+ #ifdef EECONFIG - // read config from eeprom - eeconfig_init(); -+ #endif - - // set up watchdog - wd_init(); -diff --git a/serial.c b/serial.c -index df0f873..3050c3a 100644 ---- a/serial.c -+++ b/serial.c -@@ -85,6 +85,7 @@ volatile uint8_t flowflags = FLOWFLAG_SEND_XON; - /// set up baud generator and interrupts, clear buffers - void serial_init() - { -+ #ifdef EECONFIG - if (eeconfig.baud > 38401) { - UCSR0A = MASK(U2X0); - UBRR0 = ((F_CPU / 8) / eeconfig.baud) - 1; -@@ -93,6 +94,16 @@ void serial_init() - UCSR0A = 0; - UBRR0 = ((F_CPU / 16) / eeconfig.baud) - 1; - } -+ #else -+ if (BAUD > 38401) { -+ UCSR0A = MASK(U2X0); -+ UBRR0 = ((F_CPU / 8) / BAUD) - 1; -+ } -+ else { -+ UCSR0A = 0; -+ UBRR0 = ((F_CPU / 16) / BAUD) - 1; -+ } -+ #endif - - UCSR0B = MASK(RXEN0) | MASK(TXEN0); - UCSR0C = MASK(UCSZ01) | MASK(UCSZ00); -diff --git a/temp.c b/temp.c -index be7f702..2acaac4 100644 ---- a/temp.c -+++ b/temp.c -@@ -296,17 +296,33 @@ void temp_sensor_tick() { - (EWMA_SCALE-EWMA_ALPHA) * temp_sensors_runtime[i].last_read_temp - ) / EWMA_SCALE); - } -- if (labs((int16_t)(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp)) < (TEMP_HYSTERESIS*4)) { -- if (temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*120)) -- temp_sensors_runtime[i].temp_residency++; -- } -- else { -- // Deal with flakey sensors which occasionally report a wrong value -- // by setting residency back, but not entirely to zero. -- if (temp_sensors_runtime[i].temp_residency > 10) -- temp_sensors_runtime[i].temp_residency -= 10; -- else -- temp_sensors_runtime[i].temp_residency = 0; -+ #ifdef EECONFIG -+ if (labs((int16_t)(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp)) < (eeconfig.temp_hysteresis * 4)) { -+ if (temp_sensors_runtime[i].temp_residency < eeconfig.temp_residency) -+ temp_sensors_runtime[i].temp_residency++; -+ } -+ else { -+ // Deal with flakey sensors which occasionally report a wrong value -+ // by setting residency back, but not entirely to zero. -+ if (temp_sensors_runtime[i].temp_residency > 10) -+ temp_sensors_runtime[i].temp_residency -= 10; -+ else -+ temp_sensors_runtime[i].temp_residency = 0; -+ } -+ #else -+ if (labs((int16_t)(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp)) < (TEMP_HYSTERESIS*4)) { -+ if (temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100)) -+ temp_sensors_runtime[i].temp_residency++; -+ } -+ else { -+ // Deal with flakey sensors which occasionally report a wrong value -+ // by setting residency back, but not entirely to zero. -+ if (temp_sensors_runtime[i].temp_residency > 10) -+ temp_sensors_runtime[i].temp_residency -= 10; -+ else -+ temp_sensors_runtime[i].temp_residency = 0; -+ } -+ #endif - } - - if (temp_sensors[i].heater < NUM_HEATERS) { --- -2.1.0 - diff --git a/attic/eeconfig/0004-merge-cleanup-missed-a-section-in-temp.c.patch b/attic/eeconfig/0004-merge-cleanup-missed-a-section-in-temp.c.patch deleted file mode 100644 index 0529595..0000000 --- a/attic/eeconfig/0004-merge-cleanup-missed-a-section-in-temp.c.patch +++ /dev/null @@ -1,39 +0,0 @@ -From cc4737093ddf2dc16780ad701c2de0835423a87c Mon Sep 17 00:00:00 2001 -From: Michael Moon -Date: Sat, 4 Jun 2011 03:15:28 +1000 -Subject: merge cleanup, missed a section in temp.c - -Conflicts: - - temp.c ---- - temp.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/temp.c b/temp.c -index 2acaac4..2e39fdc 100644 ---- a/temp.c -+++ b/temp.c -@@ -297,7 +297,7 @@ void temp_sensor_tick() { - ) / EWMA_SCALE); - } - #ifdef EECONFIG -- if (labs((int16_t)(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp)) < (eeconfig.temp_hysteresis * 4)) { -+ if (labs(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp) < eeconfig.temp_hysteresis) { - if (temp_sensors_runtime[i].temp_residency < eeconfig.temp_residency) - temp_sensors_runtime[i].temp_residency++; - } -@@ -310,8 +310,8 @@ void temp_sensor_tick() { - temp_sensors_runtime[i].temp_residency = 0; - } - #else -- if (labs((int16_t)(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp)) < (TEMP_HYSTERESIS*4)) { -- if (temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100)) -+ if (labs(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp) < (TEMP_HYSTERESIS * 4)) { -+ if (temp_sensors_runtime[i].temp_residency < TEMP_RESIDENCY_TIME*100) - temp_sensors_runtime[i].temp_residency++; - } - else { --- -2.1.0 -