From ab2c3558214264135aeab7006487e0fd52686d0d Mon Sep 17 00:00:00 2001 From: Phil Hord Date: Mon, 5 Dec 2016 12:20:53 -0800 Subject: [PATCH] Factor out some boilerplate code from configs Configs are always included via a config_wrapper.h now, and configs always must include this safety-definition for a missing DEFINE_HEATER. Let's simplify the configs by moving it to a common location. --- config/board.3drag.h | 4 ---- config/board.cnc-shield-v3.h | 4 ---- config/board.gen3.h | 4 ---- config/board.gen6.h | 4 ---- config/board.gen7-arm.h | 4 ---- config/board.gen7-v1.1-v1.3.h | 4 ---- config/board.gen7-v1.4.h | 4 ---- config/board.melzi.h | 4 ---- config/board.nanoheart-v1.0.h | 4 ---- config/board.pcbscriber.h | 4 ---- config/board.ramps-v1.2.h | 4 ---- config/board.ramps-v1.3.h | 4 ---- config/board.rumba.h | 4 ---- config/board.sanguinololu-v1.1.h | 4 ---- config/board.sanguinololu-v1.2.h | 4 ---- config/board.sanguish.h | 4 ---- config/board.sinaptec-at328-02.h | 4 ---- config/board.teensy++-v2.0.h | 4 ---- config/board.teensy-v2.0.h | 4 ---- config/board.tronxy.h | 4 ---- config_wrapper.h | 4 ++++ configtool/board.generic.h | 4 ---- testcases/board.regtest-no-endstops.h | 4 ---- testcases/config.h.Profiling | 4 ---- 24 files changed, 4 insertions(+), 92 deletions(-) diff --git a/config/board.3drag.h b/config/board.3drag.h index 0deb584..79cf83d 100644 --- a/config/board.3drag.h +++ b/config/board.3drag.h @@ -194,10 +194,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.cnc-shield-v3.h b/config/board.cnc-shield-v3.h index 078dea2..c275a73 100644 --- a/config/board.cnc-shield-v3.h +++ b/config/board.cnc-shield-v3.h @@ -196,10 +196,6 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO3, THERMISTOR_EXTRUDER) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.gen3.h b/config/board.gen3.h index 6764a97..8a60432 100644 --- a/config/board.gen3.h +++ b/config/board.gen3.h @@ -190,10 +190,6 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.gen6.h b/config/board.gen6.h index dcc9103..0e8a5e4 100644 --- a/config/board.gen6.h +++ b/config/board.gen6.h @@ -191,10 +191,6 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.gen7-arm.h b/config/board.gen7-arm.h index 2c4da4e..44c48db 100644 --- a/config/board.gen7-arm.h +++ b/config/board.gen7-arm.h @@ -194,10 +194,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, PIO1_0,THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.gen7-v1.1-v1.3.h b/config/board.gen7-v1.1-v1.3.h index 8187c52..c68bdef 100644 --- a/config/board.gen7-v1.1-v1.3.h +++ b/config/board.gen7-v1.1-v1.3.h @@ -198,10 +198,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.gen7-v1.4.h b/config/board.gen7-v1.4.h index ab3e385..3b5d1ac 100644 --- a/config/board.gen7-v1.4.h +++ b/config/board.gen7-v1.4.h @@ -199,10 +199,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.melzi.h b/config/board.melzi.h index e12a710..61e6f8c 100644 --- a/config/board.melzi.h +++ b/config/board.melzi.h @@ -197,10 +197,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.nanoheart-v1.0.h b/config/board.nanoheart-v1.0.h index 2070cf8..b4a4a5a 100644 --- a/config/board.nanoheart-v1.0.h +++ b/config/board.nanoheart-v1.0.h @@ -197,10 +197,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO7, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.pcbscriber.h b/config/board.pcbscriber.h index 875af5b..ebfc35f 100644 --- a/config/board.pcbscriber.h +++ b/config/board.pcbscriber.h @@ -194,10 +194,6 @@ * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.ramps-v1.2.h b/config/board.ramps-v1.2.h index d0d6322..7d87083 100644 --- a/config/board.ramps-v1.2.h +++ b/config/board.ramps-v1.2.h @@ -195,10 +195,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.ramps-v1.3.h b/config/board.ramps-v1.3.h index 9f2c329..eacadf1 100644 --- a/config/board.ramps-v1.3.h +++ b/config/board.ramps-v1.3.h @@ -196,10 +196,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.rumba.h b/config/board.rumba.h index 433985d..458b569 100644 --- a/config/board.rumba.h +++ b/config/board.rumba.h @@ -197,10 +197,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.sanguinololu-v1.1.h b/config/board.sanguinololu-v1.1.h index fd5b8a2..7200168 100644 --- a/config/board.sanguinololu-v1.1.h +++ b/config/board.sanguinololu-v1.1.h @@ -197,10 +197,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.sanguinololu-v1.2.h b/config/board.sanguinololu-v1.2.h index 20d0317..f6278fc 100644 --- a/config/board.sanguinololu-v1.2.h +++ b/config/board.sanguinololu-v1.2.h @@ -197,10 +197,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.sanguish.h b/config/board.sanguish.h index 7c25c59..c8af81e 100644 --- a/config/board.sanguish.h +++ b/config/board.sanguish.h @@ -197,10 +197,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.sinaptec-at328-02.h b/config/board.sinaptec-at328-02.h index f646e1d..af66a0e 100644 --- a/config/board.sinaptec-at328-02.h +++ b/config/board.sinaptec-at328-02.h @@ -197,10 +197,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.teensy++-v2.0.h b/config/board.teensy++-v2.0.h index c5d217f..609c86c 100644 --- a/config/board.teensy++-v2.0.h +++ b/config/board.teensy++-v2.0.h @@ -194,10 +194,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.teensy-v2.0.h b/config/board.teensy-v2.0.h index 2e718e2..1391be9 100644 --- a/config/board.teensy-v2.0.h +++ b/config/board.teensy-v2.0.h @@ -194,10 +194,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config/board.tronxy.h b/config/board.tronxy.h index f672d10..cfb9648 100644 --- a/config/board.tronxy.h +++ b/config/board.tronxy.h @@ -195,10 +195,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/config_wrapper.h b/config_wrapper.h index ba27e78..f52193e 100644 --- a/config_wrapper.h +++ b/config_wrapper.h @@ -7,6 +7,10 @@ */ #include "arduino.h" +#ifndef DEFINE_HEATER + #define DEFINE_HEATER(...) +#endif + /** This wrapper config header is used to allow makefiles and test scripts to replace or augment the user's 'config.h' file in a controlled manner. A diff --git a/configtool/board.generic.h b/configtool/board.generic.h index 9400995..5177e2e 100644 --- a/configtool/board.generic.h +++ b/configtool/board.generic.h @@ -188,10 +188,6 @@ * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out. diff --git a/testcases/board.regtest-no-endstops.h b/testcases/board.regtest-no-endstops.h index 6c175fc..986ad3c 100644 --- a/testcases/board.regtest-no-endstops.h +++ b/testcases/board.regtest-no-endstops.h @@ -63,10 +63,6 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO1, THERMISTOR_EXTRUDER) DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED) -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - DEFINE_HEATER(extruder, DIO4, 0, 1, 100) DEFINE_HEATER(bed, DIO3, 0, 1, 100) diff --git a/testcases/config.h.Profiling b/testcases/config.h.Profiling index df4f4f2..eb26769 100644 --- a/testcases/config.h.Profiling +++ b/testcases/config.h.Profiling @@ -531,10 +531,6 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_EXTRUDER) * * \***************************************************************************/ -#ifndef DEFINE_HEATER - #define DEFINE_HEATER(...) -#endif - /** \def HEATER_PIN Heater pins a user should be able to choose from in configtool. All commented out.