I am absolutely not disagreeing.... but I don't get any error?
If I don't put #include "GlobalVars.h" at the top of my header files, then yes... I get a compile error.
This is my GlobalVars.h
#define dmxSEL3 4 // DMX Solder pad number of universes selection inputs
#define dmxSEL4 5
#define dmxSEL5 6
#define magpen 32 // Magnetic pen sensor (top of enclosure)
#define heartbeatLED 38
namespace teensydmx = ::qindesign::teensydmx;
teensydmx::Sender dmxTx1{Serial1};
teensydmx::Sender dmxTx2{Serial2};
teensydmx::Sender dmxTx3{Serial3};
teensydmx::Sender dmxTx4{Serial4};
teensydmx::Sender dmxTx5{Serial5};
#pragma once // Only compile this code once (same as an include guard)
unsigned long currentMillis;
unsigned long heartbeatMillis; // Heartbeat LED timer
unsigned long screenMillis; // Timer for deboucing the touchscreen
unsigned long getdmxMillis; // Timer for obtaining the DMX values to send out
unsigned long testMillis; // Timer for test mode outputs
unsigned long flashMillis; // Timer for flashing text/graphics
unsigned long loops = 0; // Counts the main loop speed
unsigned long lastMillis;
unsigned long heartbeatpulse = 2000; // Speed of the heartbeat in ms
unsigned long detailupdate = 500; // Update time in ms of the DMX details pages
unsigned long dmxupdate = 100; // Update time in ms to get the DMX data to send
bool dmxEN1_2 = true; // Default DMX channels 1 & 2
bool dmxEN3 = false; // Optional DMX channel 3
bool dmxEN4 = false; // Optional DMX channel 4
bool dmxEN5 = false; // Optional DMX channel 5
byte dmxUNI = 2; // How many DMX Universes are active (Default is 2)
byte temp_edited_ch; // Temp storage of the channel being edited in SETUP
byte dmxuni_1TYP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output type of Universe 1 channels.
byte dmxuni_2TYP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output type of Universe 2 channels.
byte dmxuni_3TYP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output type of Universe 3 channels.
byte dmxuni_4TYP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output type of Universe 4 channels.
byte dmxuni_5TYP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output type of Universe 5 channels.
int dmxuni_1ADD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output addresses of DMX Universe 1 ,channels 1-10 What address each channel uses 1-511
int dmxuni_2ADD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output addresses of DMX Universe 2 ,channels 1-10
int dmxuni_3ADD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output addresses of DMX Universe 3 ,channels 1-10
int dmxuni_4ADD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output addresses of DMX Universe 4 ,channels 1-10
int dmxuni_5ADD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Defined output addresses of DMX Universe 5 ,channels 1-10
byte dmxuni_1VAL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Output ON values of DMX Universe 1 ,channels 1-10 DMX value to be sent to the target address 0-255
byte dmxuni_2VAL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Output ON values of DMX Universe 2 ,channels 1-10
byte dmxuni_3VAL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Output ON values of DMX Universe 3 ,channels 1-10
byte dmxuni_4VAL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Output ON values of DMX Universe 4 ,channels 1-10
byte dmxuni_5VAL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Output ON values of DMX Universe 5 ,channels 1-10
int dmxuni_1RUP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp up time in seconds/minutes of Universe 1, channels 1-10 RAMP UP value
int dmxuni_2RUP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp up time in seconds/minutes of Universe 2, channels 1-10
int dmxuni_3RUP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp up time in seconds/minutes of Universe 3, channels 1-10
int dmxuni_4RUP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp up time in seconds/minutes of Universe 4, channels 1-10
int dmxuni_5RUP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp up time in seconds/minutes of Universe 5, channels 1-10
int dmxuni_1HLD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Hold time in seconds/minutes of Universe 1, channels 1-10 Hold time
int dmxuni_2HLD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Hold time in seconds/minutes of Universe 2, channels 1-10
int dmxuni_3HLD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Hold time in seconds/minutes of Universe 3, channels 1-10
int dmxuni_4HLD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Hold time in seconds/minutes of Universe 4, channels 1-10
int dmxuni_5HLD[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Hold time in seconds/minutes of Universe 5, channels 1-10
int dmxuni_1RDN[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp down time in seconds/minutes of Universe 1, channels 1-10 RAMP DOWN value
int dmxuni_2RDN[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp down time in seconds/minutes of Universe 2, channels 1-10
int dmxuni_3RDN[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp down time in seconds/minutes of Universe 3, channels 1-10
int dmxuni_4RDN[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp down time in seconds/minutes of Universe 4, channels 1-10
int dmxuni_5RDN[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Ramp down time in seconds/minutes of Universe 5, channels 1-10
bool dmxuni_1TGL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Toggled output state of the 10x channels of DMX Universe 1 Toggle state 0-1
bool dmxuni_2TGL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Toggled output state of the 10x channels of DMX Universe 2
bool dmxuni_3TGL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Toggled output state of the 10x channels of DMX Universe 3
bool dmxuni_4TGL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Toggled output state of the 10x channels of DMX Universe 4
bool dmxuni_5TGL[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Toggled output state of the 10x channels of DMX Universe 5
byte dmxuni_1TXF[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Initial transmission flag of the 10x channels of DMX Universe 1 Transmission flag 0-1
byte dmxuni_2TXF[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Initial transmission flag of the 10x channels of DMX Universe 2
byte dmxuni_3TXF[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Initial transmission flag of the 10x channels of DMX Universe 3
byte dmxuni_4TXF[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Initial transmission flag of the 10x channels of DMX Universe 4
byte dmxuni_5TXF[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Initial transmission flag of the 10x channels of DMX Universe 5
int dmxuni_1TMP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // DMX value count for the 10 channels of Universe 1 DMX counting values (for counting up to and back from a target)
int dmxuni_2TMP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // DMX value count for the 10 channels of Universe 2
int dmxuni_3TMP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // DMX value count for the 10 channels of Universe 3
int dmxuni_4TMP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // DMX value count for the 10 channels of Universe 4
int dmxuni_5TMP[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // DMX value count for the 10 channels of Universe 5
int dmxuni_1HCT[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Temp counter for the hold function Universe 1 Temp counter for the hold fucntion
int dmxuni_2HCT[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Temp counter for the hold function Universe 2
int dmxuni_3HCT[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Temp counter for the hold function Universe 3
int dmxuni_4HCT[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Temp counter for the hold functionof Universe 4
int dmxuni_5HCT[10] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Temp counter for the hold functionof Universe 5
bool firstupdate1; // If true, it forces a first update of the DMX values on the details screen
bool firstupdate2;
bool firstupdate3;
bool firstupdate4;
bool firstupdate5;
bool magpenstate = false; // Magnetic sensor
bool runmode = false; // True if running
bool setupmode = false; // True if in setup mode
bool testmode = false; // True if in test mode
bool settings = false; // True if in settings mode
byte ScreenData; // Required value from screen
byte ScreenDump; // Unused data
byte Page; // What page we are on
byte oldpage; // Remember the previous page
byte siggraphic = 0; // Counter for the radio signal graphic
bool touchSTOP; // Flag to prevent repeat operation of touchscreen events
int testmenu; // Test menu selection
int testaddress;
byte testuniverse = 1;
byte testrangelowByte; // Variables to determine value of the SoftDMXaddress
byte testrangehighByte;
int testrange = 255; // Default setting for the test range
byte timer;
byte keypadrequest; // Above 0 when a keypad value is requested
int keypadnumber; // The number retrieved from the keypad
int keypad100; // Digits converted from keypad
int keypad10;
int keypad1;
byte entereddigits; // How many digits have been entered
int keypadvalue; // The final value to be sent, deduced from the keypad
int keypadaddress; // The final address to be sent, deduced from the keypad
byte setupUniverse; // Which Universe we are setting up
byte setupOption = 1; // What setup option we are viewing
byte setupDMXonvalue; // Setup ON value (0-255)
int setupDMXaadress; // Setup address required
int setupRAMPup; // Setup ramp up time
int setupHOLDtime; // Setup hold up time
int setupRAMPdown; // Setup ramp down time
byte selectstage = 0; // What stage of the setup process we are at
bool button1set = false; // Flags to ensure all data has been entered in the setup menu
bool button2set = false;
bool button3set = false;
bool button4set = false;
byte tempval; // tempval used for debugging
byte settingsstage = 0; // What stage the settings process is at
byte resetcount = 0; // Counter for the factory reset progress bar
bool screenstate = true; // Whether the screen is on or off (Magpen)
bool maglockoutstate = false; // Whether the module is locked out
bool magpenboot = false; // Whether the system awaits a magnetic pen input to allow booting
bool maglockout = false; // Whether screen lockout with the mag key is active
bool magscreenpower = false; // Whether the screen power is controlled with the mag key
bool magfulltest = false; // Whether the mag pen provides a full test
bool menuexit = false; // Used to leave menus
byte DMXchanneltype; // Used when sending the DMX data
byte randomDMX[9] {1, 2, 3, 4, 5, 6, 7, 8, 9}; // Random generator for the random DMX functions
const int chipSelectINT = BUILTIN_SDCARD; // Onboard Teensy 4.1 SD card CS/SS
const int chipSelectEXT = 2; // External SD card CS/SS
const int extSDsw = 3; // External SD card switch (Low = card inserted)
File sdFile; // SD card data
char sdData[100]; // Lines of text within the SD card data
byte Size_of_SD_array; // The length of the sd text array, including empty spaces
bool uploadvalid; // Whether the uploaded SD file is valid
byte sdTEMPsearch; // Temp search variable for uploading from SD card
byte uploadTEMPdata; // The uploaded temp data
#define DEBUG 1 // Serial debug routine for critical functions
#if DEBUG==1 // Setting this to anything but 1 will send all non-critical serial prints to the debug screen (which slows the routine)
#define outputDebug(x); Serial.print(x);
#define outputDebugLine(x); Serial.println(x);
#else
#define outputDebug(x);
#define outputDebugLine(x);
#endif