41
41
#include <Arduino.h>
42
42
#endif
43
43
44
+ // general macros
45
+ #if !defined(_BV )
46
+ #define _BV (x ) (1<<(x)) //!< _BV
47
+ #endif
48
+
44
49
#include "MyConfig.h"
45
50
#include "core/MySplashScreen.h"
46
51
#include "core/MySensorsCore.h"
47
52
48
- // OTA Debug, have to defined before HAL
53
+ // OTA Debug, has to be defined before HAL
49
54
#if defined(MY_OTA_LOG_SENDER_FEATURE ) || defined(MY_OTA_LOG_RECEIVER_FEATURE )
50
55
#include "core/MyOTALogging.h"
51
56
#endif
52
57
53
58
// HARDWARE
59
+ #include "hal/architecture/MyHw.h"
54
60
#if defined(ARDUINO_ARCH_ESP8266 )
55
- #include "hal/architecture/MyHwESP8266.cpp"
61
+ #include "hal/architecture/ESP8266/ MyHwESP8266.cpp"
56
62
#elif defined(ARDUINO_ARCH_AVR )
57
63
#include "drivers/AVR/DigitalWriteFast/digitalWriteFast.h"
58
- #include "hal/architecture/MyHwAVR.cpp"
64
+ #include "hal/architecture/AVR/ MyHwAVR.cpp"
59
65
#elif defined(ARDUINO_ARCH_SAMD )
60
66
#include "drivers/extEEPROM/extEEPROM.cpp"
61
- #include "hal/architecture/MyHwSAMD.cpp"
67
+ #include "hal/architecture/SAMD/ MyHwSAMD.cpp"
62
68
#elif defined(ARDUINO_ARCH_STM32F1 )
63
- #include "hal/architecture/MyHwSTM32F1.cpp"
69
+ #include "hal/architecture/STM32F1/ MyHwSTM32F1.cpp"
64
70
#elif defined(ARDUINO_ARCH_NRF5 ) || defined(ARDUINO_ARCH_NRF52 )
65
71
#include "drivers/NVM/VirtualPage.cpp"
66
72
#include "drivers/NVM/NVRAM.cpp"
67
- #include "hal/architecture/MyHwNRF5.cpp"
73
+ #include "hal/architecture/NRF5/ MyHwNRF5.cpp"
68
74
#elif defined(__arm__ ) && defined(TEENSYDUINO )
69
- #include "hal/architecture/MyHwTeensy3.cpp"
75
+ #include "hal/architecture/Teensy3/ MyHwTeensy3.cpp"
70
76
#elif defined(__linux__ )
71
- #include "hal/architecture/MyHwLinuxGeneric.cpp"
77
+ #include "hal/architecture/Linux/ MyHwLinuxGeneric.cpp"
72
78
#endif
73
79
74
80
// OTA Debug second part, depends on HAL
@@ -130,7 +136,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
130
136
131
137
// GATEWAY - TRANSPORT
132
138
#if defined(MY_CONTROLLER_IP_ADDRESS ) || defined(MY_CONTROLLER_URL_ADDRESS )
133
- #define MY_GATEWAY_CLIENT_MODE
139
+ #define MY_GATEWAY_CLIENT_MODE //!< gateway client mode
134
140
#endif
135
141
136
142
#if defined(MY_USE_UDP ) && !defined(MY_GATEWAY_CLIENT_MODE )
@@ -248,7 +254,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
248
254
249
255
// SANITY CHECK
250
256
#if defined(MY_REPEATER_FEATURE ) || defined(MY_GATEWAY_FEATURE )
251
- #define MY_TRANSPORT_SANITY_CHECK
257
+ #define MY_TRANSPORT_SANITY_CHECK //!< enable regular transport sanity checks
252
258
#endif
253
259
254
260
// TRANSPORT INCLUDES
@@ -268,7 +274,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
268
274
// RAM ROUTING TABLE
269
275
#if defined(MY_RAM_ROUTING_TABLE_FEATURE ) && defined(MY_REPEATER_FEATURE )
270
276
// activate feature based on architecture
271
- #if defined(ARDUINO_ARCH_ESP8266 ) || defined(ARDUINO_ARCH_SAMD ) || defined(ARDUINO_ARCH_NRF5 ) || defined(__linux__ )
277
+ #if defined(ARDUINO_ARCH_ESP8266 ) || defined(ARDUINO_ARCH_SAMD ) || defined(ARDUINO_ARCH_NRF5 ) || defined(ARDUINO_ARCH_STM32F1 ) || defined( TEENSYDUINO ) || defined( __linux__ )
272
278
#define MY_RAM_ROUTING_TABLE_ENABLED
273
279
#elif defined(ARDUINO_ARCH_AVR )
274
280
#if defined(__avr_atmega1280__ ) || defined(__avr_atmega1284__ ) || defined(__avr_atmega2560__ )
@@ -306,7 +312,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
306
312
#include "drivers/RF24/RF24.cpp"
307
313
#include "hal/transport/MyTransportRF24.cpp"
308
314
#elif defined(MY_RADIO_NRF5_ESB )
309
- #if !defined(ARDUINO_ARCH_NRF5 )
315
+ #if !defined(ARDUINO_ARCH_NRF5 )
310
316
#error No support for nRF5 radio on this platform
311
317
#endif
312
318
#if defined(MY_NRF5_ESB_ENABLE_ENCRYPTION )
@@ -382,16 +388,20 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
382
388
383
389
// HW mains
384
390
#if !defined(MY_CORE_ONLY )
385
- #if defined(ARDUINO_ARCH_ESP8266 )
386
- #include "hal/architecture/MyMainESP8266.cpp"
391
+ #if defined(ARDUINO_ARCH_AVR )
392
+ #include "hal/architecture/AVR/MyMainAVR.cpp"
393
+ #elif defined(ARDUINO_ARCH_SAMD )
394
+ #include "hal/architecture/SAMD/MyMainSAMD.cpp"
395
+ #elif defined(ARDUINO_ARCH_ESP8266 )
396
+ #include "hal/architecture/ESP8266/MyMainESP8266.cpp"
397
+ #elif defined(ARDUINO_ARCH_NRF5 )
398
+ #include "hal/architecture/NRF5/MyMainNRF5.cpp"
387
399
#elif defined(__linux__ )
388
- #include "hal/architecture/MyMainLinux.cpp"
400
+ #include "hal/architecture/Linux/ MyMainLinux.cpp"
389
401
#elif defined(ARDUINO_ARCH_STM32F1 )
390
- #include "hal/architecture/MyMainSTM32F1.cpp"
402
+ #include "hal/architecture/STM32F1/ MyMainSTM32F1.cpp"
391
403
#elif defined(TEENSYDUINO )
392
- #include "hal/architecture/MyMainTeensy3.cpp"
393
- #else
394
- #include "hal/architecture/MyMainDefault.cpp"
404
+ #include "hal/architecture/Teensy3/MyMainTeensy3.cpp"
395
405
#endif
396
406
#endif
397
407
0 commit comments