diff --git a/MySensors.h b/MySensors.h index edd81fe..41c1439 100644 --- a/MySensors.h +++ b/MySensors.h @@ -1,4 +1,4 @@ -/* +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each @@ -84,17 +84,17 @@ // HARDWARE #if defined(ARDUINO_ARCH_ESP8266) -#include "core/MyHwESP8266.cpp" +#include "hal/architecture/MyHwESP8266.cpp" #elif defined(ARDUINO_ARCH_AVR) #include "drivers/AVR/DigitalWriteFast/digitalWriteFast.h" -#include "core/MyHwAVR.cpp" +#include "hal/architecture/MyHwAVR.cpp" #elif defined(ARDUINO_ARCH_SAMD) #include "drivers/extEEPROM/extEEPROM.cpp" -#include "core/MyHwSAMD.cpp" +#include "hal/architecture/MyHwSAMD.cpp" #elif defined(ARDUINO_ARCH_STM32F1) -#include "core/MyHwSTM32F1.cpp" +#include "hal/architecture/MyHwSTM32F1.cpp" #elif defined(__linux__) -#include "core/MyHwLinuxGeneric.cpp" +#include "hal/architecture/MyHwLinuxGeneric.cpp" #endif // LEDS @@ -398,13 +398,13 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs // HW mains #if !defined(MY_CORE_ONLY) #if defined(ARDUINO_ARCH_ESP8266) -#include "core/MyMainESP8266.cpp" +#include "hal/architecture/MyMainESP8266.cpp" #elif defined(__linux__) -#include "core/MyMainLinux.cpp" +#include "hal/architecture/MyMainLinux.cpp" #elif defined(ARDUINO_ARCH_STM32F1) -#include "core/MyMainSTM32F1.cpp" +#include "hal/architecture/MyMainSTM32F1.cpp" #else -#include "core/MyMainDefault.cpp" +#include "hal/architecture/MyMainDefault.cpp" #endif #endif diff --git a/core/MyHw.h b/hal/architecture/MyHw.h similarity index 99% rename from core/MyHw.h rename to hal/architecture/MyHw.h index a747b61..91bcaf6 100644 --- a/core/MyHw.h +++ b/hal/architecture/MyHw.h @@ -1,4 +1,4 @@ -/* +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each diff --git a/core/MyHwAVR.cpp b/hal/architecture/MyHwAVR.cpp similarity index 94% rename from core/MyHwAVR.cpp rename to hal/architecture/MyHwAVR.cpp index fd65a47..5079a71 100644 --- a/core/MyHwAVR.cpp +++ b/hal/architecture/MyHwAVR.cpp @@ -31,11 +31,11 @@ bool hwInit(void) #define INVALID_INTERRUPT_NUM (0xFFu) volatile uint8_t _wokeUpByInterrupt = - INVALID_INTERRUPT_NUM; // Interrupt number that woke the mcu. + INVALID_INTERRUPT_NUM; // Interrupt number that woke the mcu. volatile uint8_t _wakeUp1Interrupt = - INVALID_INTERRUPT_NUM; // Interrupt number for wakeUp1-callback. + INVALID_INTERRUPT_NUM; // Interrupt number for wakeUp1-callback. volatile uint8_t _wakeUp2Interrupt = - INVALID_INTERRUPT_NUM; // Interrupt number for wakeUp2-callback. + INVALID_INTERRUPT_NUM; // Interrupt number for wakeUp2-callback. void wakeUp1() { @@ -45,8 +45,7 @@ void wakeUp1() sleep_disable(); detachInterrupt(_wakeUp1Interrupt); // First interrupt occurred will be reported only - if (INVALID_INTERRUPT_NUM == _wokeUpByInterrupt) - { + if (INVALID_INTERRUPT_NUM == _wokeUpByInterrupt) { _wokeUpByInterrupt = _wakeUp1Interrupt; } } @@ -55,8 +54,7 @@ void wakeUp2() sleep_disable(); detachInterrupt(_wakeUp2Interrupt); // First interrupt occurred will be reported only - if (INVALID_INTERRUPT_NUM == _wokeUpByInterrupt) - { + if (INVALID_INTERRUPT_NUM == _wokeUpByInterrupt) { _wokeUpByInterrupt = _wakeUp2Interrupt; } } @@ -128,7 +126,7 @@ void hwInternalSleep(unsigned long ms) ms += 15u; while (!interruptWakeUp() && ms >= 16) { - for (uint8_t period = 9u; ;--period) { + for (uint8_t period = 9u; ; --period) { const uint16_t comparatorMS = 1 << (period + 4); if ( ms >= comparatorMS) { hwPowerDown(period); // 8192ms => 9, 16ms => 0 @@ -151,7 +149,7 @@ int8_t hwSleep(uint8_t interrupt, uint8_t mode, unsigned long ms) } int8_t hwSleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2, uint8_t mode2, - unsigned long ms) + unsigned long ms) { // ATMega328P supports following modes to wake from sleep: LOW, CHANGE, RISING, FALLING // Datasheet states only LOW can be used with INT0/1 to wake from sleep, which is incorrect. @@ -193,7 +191,7 @@ int8_t hwSleep(uint8_t interrupt1, uint8_t mode1, uint8_t interrupt2, uint8_t mo } // Return what woke the mcu. - // Default: no interrupt triggered, timer wake up + // Default: no interrupt triggered, timer wake up int8_t ret = MY_WAKE_UP_BY_TIMER; if (interruptWakeUp()) { ret = static_cast(_wokeUpByInterrupt); @@ -274,7 +272,7 @@ void hwDebugPrint(const char *fmt, ... ) #ifdef MY_GATEWAY_FEATURE // prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE) snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;%lu "), - C_INTERNAL, I_LOG_MESSAGE, hwMillis()); + C_INTERNAL, I_LOG_MESSAGE, hwMillis()); MY_SERIALDEVICE.print(fmtBuffer); #else // prepend timestamp diff --git a/core/MyHwAVR.h b/hal/architecture/MyHwAVR.h similarity index 99% rename from core/MyHwAVR.h rename to hal/architecture/MyHwAVR.h index f1f4685..183db74 100644 --- a/core/MyHwAVR.h +++ b/hal/architecture/MyHwAVR.h @@ -1,4 +1,4 @@ -/** +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each diff --git a/core/MyHwESP8266.cpp b/hal/architecture/MyHwESP8266.cpp similarity index 100% rename from core/MyHwESP8266.cpp rename to hal/architecture/MyHwESP8266.cpp diff --git a/core/MyHwESP8266.h b/hal/architecture/MyHwESP8266.h similarity index 99% rename from core/MyHwESP8266.h rename to hal/architecture/MyHwESP8266.h index f83dcc6..a713bba 100644 --- a/core/MyHwESP8266.h +++ b/hal/architecture/MyHwESP8266.h @@ -1,4 +1,4 @@ -/** +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each diff --git a/core/MyHwLinuxGeneric.cpp b/hal/architecture/MyHwLinuxGeneric.cpp similarity index 100% rename from core/MyHwLinuxGeneric.cpp rename to hal/architecture/MyHwLinuxGeneric.cpp diff --git a/core/MyHwLinuxGeneric.h b/hal/architecture/MyHwLinuxGeneric.h similarity index 99% rename from core/MyHwLinuxGeneric.h rename to hal/architecture/MyHwLinuxGeneric.h index d7f914c..5074ae8 100644 --- a/core/MyHwLinuxGeneric.h +++ b/hal/architecture/MyHwLinuxGeneric.h @@ -1,4 +1,4 @@ -/** +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each diff --git a/core/MyHwSAMD.cpp b/hal/architecture/MyHwSAMD.cpp similarity index 100% rename from core/MyHwSAMD.cpp rename to hal/architecture/MyHwSAMD.cpp diff --git a/core/MyHwSAMD.h b/hal/architecture/MyHwSAMD.h similarity index 99% rename from core/MyHwSAMD.h rename to hal/architecture/MyHwSAMD.h index 0e67e64..5af36d6 100644 --- a/core/MyHwSAMD.h +++ b/hal/architecture/MyHwSAMD.h @@ -1,4 +1,4 @@ -/** +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each diff --git a/core/MyHwSTM32F1.cpp b/hal/architecture/MyHwSTM32F1.cpp similarity index 100% rename from core/MyHwSTM32F1.cpp rename to hal/architecture/MyHwSTM32F1.cpp diff --git a/core/MyHwSTM32F1.h b/hal/architecture/MyHwSTM32F1.h similarity index 99% rename from core/MyHwSTM32F1.h rename to hal/architecture/MyHwSTM32F1.h index 43d0f77..3478741 100644 --- a/core/MyHwSTM32F1.h +++ b/hal/architecture/MyHwSTM32F1.h @@ -1,4 +1,4 @@ -/** +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each diff --git a/core/MyMainDefault.cpp b/hal/architecture/MyMainDefault.cpp similarity index 99% rename from core/MyMainDefault.cpp rename to hal/architecture/MyMainDefault.cpp index d15df62..419aec2 100644 --- a/core/MyMainDefault.cpp +++ b/hal/architecture/MyMainDefault.cpp @@ -1,4 +1,4 @@ -/** +/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each diff --git a/core/MyMainESP8266.cpp b/hal/architecture/MyMainESP8266.cpp similarity index 100% rename from core/MyMainESP8266.cpp rename to hal/architecture/MyMainESP8266.cpp diff --git a/core/MyMainLinux.cpp b/hal/architecture/MyMainLinux.cpp similarity index 100% rename from core/MyMainLinux.cpp rename to hal/architecture/MyMainLinux.cpp diff --git a/core/MyMainSTM32F1.cpp b/hal/architecture/MyMainSTM32F1.cpp similarity index 100% rename from core/MyMainSTM32F1.cpp rename to hal/architecture/MyMainSTM32F1.cpp