Skip to content

Commit fbbfed8

Browse files
Merge pull request #96 from OpenAstroTech/local-configs-cleanup
Small code cleanup to improve readability
2 parents e962c3e + eb435fc commit fbbfed8

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

Software/Arduino code/OpenAstroTracker/Configuration.hpp

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,12 @@
2727
* These files won't be tracked by Git and thus will remain after branch changes or code updates.
2828
**/
2929

30-
#if defined(ESP32) // ESP32
31-
#define LOCAL_CONFIG "Configuration_local_esp32.hpp"
32-
#if !__has_include(LOCAL_CONFIG)
33-
#undef LOCAL_CONFIG
34-
#define LOCAL_CONFIG "Configuration_local.hpp"
35-
#endif
36-
#elif defined(__AVR_ATmega2560__) // Arduino Mega
37-
#define LOCAL_CONFIG "Configuration_local_mega.hpp"
38-
#if !__has_include(LOCAL_CONFIG)
39-
#undef LOCAL_CONFIG
40-
#define LOCAL_CONFIG "Configuration_local.hpp"
41-
#endif
42-
#else // Other board?
43-
#define LOCAL_CONFIG "Configuration_local.hpp"
44-
#endif
45-
46-
// Uncomment these two lines to override the automatic local config with yours.
47-
// #undef LOCAL_CONFIG
48-
// #define LOCAL_CONFIG "Configuration_local_foo.hpp"
49-
50-
#if __has_include(LOCAL_CONFIG)
51-
#include LOCAL_CONFIG
30+
#if defined(ESP32) && __has_include("Configuration_local_esp32.hpp") // ESP32
31+
#include "Configuration_local_esp32.hpp"
32+
#elif defined(__AVR_ATmega2560__) && __has_include("Configuration_local_mega.hpp") // Mega2560
33+
#include "Configuration_local_mega.hpp"
34+
#elif __has_include("Configuration_local.hpp") // Custom config
35+
#include "Configuration_local.hpp"
5236
#endif
5337

5438
// Set to 1 for the northern hemisphere, 0 otherwise

0 commit comments

Comments
 (0)