From 3c1a4aac2bbe6f77b2e779520f848685c1c57cc1 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Thu, 22 Dec 2011 12:38:50 +0100 Subject: [PATCH] header file simplification --- Marlin/EEPROMwrite.h | 1 - Marlin/Marlin.h | 8 +++++++- Marlin/Marlin.pde | 7 ++++--- Marlin/cardreader.pde | 3 +-- Marlin/motion_control.cpp | 1 - Marlin/planner.cpp | 7 +------ Marlin/planner.h | 3 +-- Marlin/stepper.cpp | 4 +--- Marlin/temperature.cpp | 5 +---- Marlin/temperature.h | 1 - Marlin/ultralcd.h | 5 ++--- Marlin/ultralcd.pde | 4 +--- Marlin/watchdog.h | 2 +- 13 files changed, 20 insertions(+), 31 deletions(-) diff --git a/Marlin/EEPROMwrite.h b/Marlin/EEPROMwrite.h index 8680a5fdc..5714dacfe 100644 --- a/Marlin/EEPROMwrite.h +++ b/Marlin/EEPROMwrite.h @@ -5,7 +5,6 @@ #include "planner.h" #include "temperature.h" -#include template int EEPROM_writeAnything(int &ee, const T& value) { diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index f8ded924e..0773f11c1 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -6,15 +6,21 @@ #define HardwareSerial_h // trick to disable the standard HWserial #include #include +#include +#include + + #if ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif +#include + #include "fastio.h" -#include #include "Configuration.h" +#include "pins.h" #include "MarlinSerial.h" #define FORCE_INLINE __attribute__((always_inline)) inline diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index c20ac49b6..bf9a1bc48 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -25,7 +25,8 @@ http://reprap.org/pipermail/reprap-dev/2011-May/003323.html */ -#include + +#include "Marlin.h" #include #include @@ -33,7 +34,7 @@ #include "fastio.h" #include "Configuration.h" #include "pins.h" -#include "Marlin.h" + #include "ultralcd.h" #include "planner.h" #include "stepper.h" @@ -41,7 +42,7 @@ #include "motion_control.h" #include "cardreader.h" #include "watchdog.h" -#include + diff --git a/Marlin/cardreader.pde b/Marlin/cardreader.pde index a5044f8d3..89f4b2f93 100644 --- a/Marlin/cardreader.pde +++ b/Marlin/cardreader.pde @@ -1,8 +1,7 @@ #include "cardreader.h" -//#include #ifdef SDSUPPORT -#include "Configuration.h" +#include "Marlin.h" CardReader::CardReader() { diff --git a/Marlin/motion_control.cpp b/Marlin/motion_control.cpp index 8ecc1a044..ab403e981 100644 --- a/Marlin/motion_control.cpp +++ b/Marlin/motion_control.cpp @@ -19,7 +19,6 @@ along with Grbl. If not, see . */ -#include "Configuration.h" #include "Marlin.h" #include "stepper.h" #include "planner.h" diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 1d66dad03..f3007af53 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -52,14 +52,9 @@ */ -//#include -//#include -//#include -#include "Configuration.h" -#include "pins.h" + #include "Marlin.h" -#include "fastio.h" #include "planner.h" #include "stepper.h" #include "temperature.h" diff --git a/Marlin/planner.h b/Marlin/planner.h index 82f53413e..02e299fa8 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -23,8 +23,7 @@ #ifndef planner_h #define planner_h -#include -#include "Configuration.h" + #include "Marlin.h" // This struct is used when buffering the setup for each linear movement "nominal" values are as specified in diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index cffa25f2a..6985da00b 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -23,11 +23,9 @@ #include "stepper.h" -#include "Configuration.h" -#include "pins.h" + #include "Marlin.h" #include "planner.h" -#include "fastio.h" #include "temperature.h" #include "ultralcd.h" diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index e6c352fdf..371c6e589 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -27,11 +27,8 @@ http://reprap.org/pipermail/reprap-dev/2011-May/003323.html */ -#include -#include "fastio.h" -#include "Configuration.h" -#include "pins.h" + #include "Marlin.h" #include "ultralcd.h" #include "temperature.h" diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 8e1deac8f..80e68f78b 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -22,7 +22,6 @@ #define temperature_h #include "Marlin.h" -#include "fastio.h" #include "planner.h" #ifdef PID_ADD_EXTRUSION_RATE #include "stepper.h" diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 93fa4895d..716ddb90c 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -1,9 +1,8 @@ #ifndef __ULTRALCDH #define __ULTRALCDH -#include "Configuration.h" #include "Marlin.h" #ifdef ULTRA_LCD - + #include void lcd_status(); void lcd_init(); void lcd_status(const char* message); @@ -15,7 +14,7 @@ #define STATUSTIMEOUT 15000 - #include + extern LiquidCrystal lcd; diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 35c0c4091..5be09ac4a 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -1,6 +1,6 @@ #include "ultralcd.h" #ifdef ULTRA_LCD - +#include //=========================================================================== //=============================imported variables============================ //=========================================================================== @@ -27,7 +27,6 @@ static char messagetext[LCD_WIDTH]=""; //return for string conversion routines static char conv[8]; -#include LiquidCrystal lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7 static unsigned long previous_millis_lcd=0; @@ -42,7 +41,6 @@ static long previous_millis_buttons=0; static MainMenu menu; -#include void lcdProgMemprint(const char *str) { diff --git a/Marlin/watchdog.h b/Marlin/watchdog.h index 1d4148827..ff6af60af 100644 --- a/Marlin/watchdog.h +++ b/Marlin/watchdog.h @@ -1,6 +1,6 @@ #ifndef __WATCHDOGH #define __WATCHDOGH -#include "Configuration.h" +#include "Marlin.h" #ifdef USE_WATCHDOG // intialise watch dog with a 1 sec interrupt time