From f687625bfaf52dc07618082c4a0f5b0763ba1eec Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 7 Feb 2021 10:27:46 +0000 Subject: [PATCH] Config/example loading --- CommandStation-EX.ino | 1 + EthernetInterface.cpp | 3 +-- EthernetInterface.h | 7 ++++++- LCD_Implementation.h | 1 - WifiInterface.h | 1 - config.example.h | 5 ++--- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CommandStation-EX.ino b/CommandStation-EX.ino index 2b09021..4872375 100644 --- a/CommandStation-EX.ino +++ b/CommandStation-EX.ino @@ -19,6 +19,7 @@ #if __has_include ( "config.h") #include "config.h" #else + #warning config.h not found. Using defaults from config.example.h #include "config.example.h" #endif diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index ebc21c4..42d1bbb 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -18,8 +18,7 @@ * */ -#include "config.h" -#include "defines.h" // This should be changed to DCCEX.h when possible +#include "defines.h" #if ETHERNET_ON == true #include "EthernetInterface.h" #include "DIAG.h" diff --git a/EthernetInterface.h b/EthernetInterface.h index 23cc6cd..a7d4bb9 100644 --- a/EthernetInterface.h +++ b/EthernetInterface.h @@ -22,7 +22,12 @@ #ifndef EthernetInterface_h #define EthernetInterface_h - +#if __has_include ( "config.h") + #include "config.h" +#else + #warning config.h not found. Using defaults from config.example.h + #include "config.example.h" +#endif #include "DCCEXParser.h" #include #include diff --git a/LCD_Implementation.h b/LCD_Implementation.h index 45e0429..cb88a8b 100644 --- a/LCD_Implementation.h +++ b/LCD_Implementation.h @@ -27,7 +27,6 @@ #ifndef LCD_Implementation_h #define LCD_Implementation_h -#include "config.h" #include #include "LCDDisplay.h" diff --git a/WifiInterface.h b/WifiInterface.h index 191b56f..4070e75 100644 --- a/WifiInterface.h +++ b/WifiInterface.h @@ -20,7 +20,6 @@ #ifndef WifiInterface_h #define WifiInterface_h #include "FSH.h" -#include "config.h" #include "DCCEXParser.h" #include #include diff --git a/config.example.h b/config.example.h index b588e50..2f5bf79 100644 --- a/config.example.h +++ b/config.example.h @@ -1,10 +1,9 @@ /********************************************************************** -Config.h -COPYRIGHT (c) 2013-2016 Gregg E. Berman +config.h COPYRIGHT (c) 2020 Fred Decker -The configuration file for DCC++ EX Command Station +The configuration file for DCC-EX Command Station **********************************************************************/