1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 12:51:24 +01:00

defines/configig include tidy

now just 2 places where config is included...
1) in defines.h
2) At the start of the .ino so it can be made obvious to the user what is happening.
This commit is contained in:
Asbelos 2021-08-23 11:55:42 +01:00
parent ca55834051
commit 50a9e08d1f
4 changed files with 10 additions and 20 deletions

View File

@ -17,12 +17,6 @@
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>.
*
*/
#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 "defines.h"
#if ETHERNET_ON == true
#include "EthernetInterface.h"

View File

@ -22,12 +22,8 @@
#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 "defines.h")
#include "DCCEXParser.h"
#include <Arduino.h>
#include <avr/pgmspace.h>

View File

@ -19,12 +19,9 @@
#ifndef LCDDisplay_h
#define LCDDisplay_h
#include <Arduino.h>
#include "defines.h"
#include "DisplayInterface.h"
#if __has_include ( "config.h")
#include "config.h"
#endif
// Allow maximum message length to be overridden from config.h
#if !defined(MAX_MSG_SIZE)
#define MAX_MSG_SIZE 20

View File

@ -22,10 +22,13 @@
#define DEFINES_H
// defines.h relies on macros defined in config.h
#if __has_include ( "config.h")
#include "config.h"
#else
#include "config.example.h"
// but it may have already been included (for cosmetic convenence) by the .ino
#ifndef MOTOR_SHIELD_TYPE
#if __has_include ( "config.h")
#include "config.h"
#else
#include "config.example.h"
#endif
#endif
////////////////////////////////////////////////////////////////////////////////