Reshuffle arch files (#974)
This commit is contained in:
+29
-19
@@ -41,34 +41,40 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// general macros
|
||||||
|
#if !defined(_BV)
|
||||||
|
#define _BV(x) (1<<(x)) //!< _BV
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "MyConfig.h"
|
#include "MyConfig.h"
|
||||||
#include "core/MySplashScreen.h"
|
#include "core/MySplashScreen.h"
|
||||||
#include "core/MySensorsCore.h"
|
#include "core/MySensorsCore.h"
|
||||||
|
|
||||||
// OTA Debug, have to defined before HAL
|
// OTA Debug, has to be defined before HAL
|
||||||
#if defined(MY_OTA_LOG_SENDER_FEATURE) || defined(MY_OTA_LOG_RECEIVER_FEATURE)
|
#if defined(MY_OTA_LOG_SENDER_FEATURE) || defined(MY_OTA_LOG_RECEIVER_FEATURE)
|
||||||
#include "core/MyOTALogging.h"
|
#include "core/MyOTALogging.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// HARDWARE
|
// HARDWARE
|
||||||
|
#include "hal/architecture/MyHw.h"
|
||||||
#if defined(ARDUINO_ARCH_ESP8266)
|
#if defined(ARDUINO_ARCH_ESP8266)
|
||||||
#include "hal/architecture/MyHwESP8266.cpp"
|
#include "hal/architecture/ESP8266/MyHwESP8266.cpp"
|
||||||
#elif defined(ARDUINO_ARCH_AVR)
|
#elif defined(ARDUINO_ARCH_AVR)
|
||||||
#include "drivers/AVR/DigitalWriteFast/digitalWriteFast.h"
|
#include "drivers/AVR/DigitalWriteFast/digitalWriteFast.h"
|
||||||
#include "hal/architecture/MyHwAVR.cpp"
|
#include "hal/architecture/AVR/MyHwAVR.cpp"
|
||||||
#elif defined(ARDUINO_ARCH_SAMD)
|
#elif defined(ARDUINO_ARCH_SAMD)
|
||||||
#include "drivers/extEEPROM/extEEPROM.cpp"
|
#include "drivers/extEEPROM/extEEPROM.cpp"
|
||||||
#include "hal/architecture/MyHwSAMD.cpp"
|
#include "hal/architecture/SAMD/MyHwSAMD.cpp"
|
||||||
#elif defined(ARDUINO_ARCH_STM32F1)
|
#elif defined(ARDUINO_ARCH_STM32F1)
|
||||||
#include "hal/architecture/MyHwSTM32F1.cpp"
|
#include "hal/architecture/STM32F1/MyHwSTM32F1.cpp"
|
||||||
#elif defined(ARDUINO_ARCH_NRF5) || defined(ARDUINO_ARCH_NRF52)
|
#elif defined(ARDUINO_ARCH_NRF5) || defined(ARDUINO_ARCH_NRF52)
|
||||||
#include "drivers/NVM/VirtualPage.cpp"
|
#include "drivers/NVM/VirtualPage.cpp"
|
||||||
#include "drivers/NVM/NVRAM.cpp"
|
#include "drivers/NVM/NVRAM.cpp"
|
||||||
#include "hal/architecture/MyHwNRF5.cpp"
|
#include "hal/architecture/NRF5/MyHwNRF5.cpp"
|
||||||
#elif defined(__arm__) && defined(TEENSYDUINO)
|
#elif defined(__arm__) && defined(TEENSYDUINO)
|
||||||
#include "hal/architecture/MyHwTeensy3.cpp"
|
#include "hal/architecture/Teensy3/MyHwTeensy3.cpp"
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
#include "hal/architecture/MyHwLinuxGeneric.cpp"
|
#include "hal/architecture/Linux/MyHwLinuxGeneric.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// OTA Debug second part, depends on HAL
|
// OTA Debug second part, depends on HAL
|
||||||
@@ -130,7 +136,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
|
|||||||
|
|
||||||
// GATEWAY - TRANSPORT
|
// GATEWAY - TRANSPORT
|
||||||
#if defined(MY_CONTROLLER_IP_ADDRESS) || defined(MY_CONTROLLER_URL_ADDRESS)
|
#if defined(MY_CONTROLLER_IP_ADDRESS) || defined(MY_CONTROLLER_URL_ADDRESS)
|
||||||
#define MY_GATEWAY_CLIENT_MODE
|
#define MY_GATEWAY_CLIENT_MODE //!< gateway client mode
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MY_USE_UDP) && !defined(MY_GATEWAY_CLIENT_MODE)
|
#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
|
|||||||
|
|
||||||
// SANITY CHECK
|
// SANITY CHECK
|
||||||
#if defined(MY_REPEATER_FEATURE) || defined(MY_GATEWAY_FEATURE)
|
#if defined(MY_REPEATER_FEATURE) || defined(MY_GATEWAY_FEATURE)
|
||||||
#define MY_TRANSPORT_SANITY_CHECK
|
#define MY_TRANSPORT_SANITY_CHECK //!< enable regular transport sanity checks
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TRANSPORT INCLUDES
|
// TRANSPORT INCLUDES
|
||||||
@@ -268,7 +274,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
|
|||||||
// RAM ROUTING TABLE
|
// RAM ROUTING TABLE
|
||||||
#if defined(MY_RAM_ROUTING_TABLE_FEATURE) && defined(MY_REPEATER_FEATURE)
|
#if defined(MY_RAM_ROUTING_TABLE_FEATURE) && defined(MY_REPEATER_FEATURE)
|
||||||
// activate feature based on architecture
|
// activate feature based on architecture
|
||||||
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_NRF5) || defined(__linux__)
|
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_NRF5) || defined(ARDUINO_ARCH_STM32F1) || defined(TEENSYDUINO) || defined(__linux__)
|
||||||
#define MY_RAM_ROUTING_TABLE_ENABLED
|
#define MY_RAM_ROUTING_TABLE_ENABLED
|
||||||
#elif defined(ARDUINO_ARCH_AVR)
|
#elif defined(ARDUINO_ARCH_AVR)
|
||||||
#if defined(__avr_atmega1280__) || defined(__avr_atmega1284__) || defined(__avr_atmega2560__)
|
#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
|
|||||||
#include "drivers/RF24/RF24.cpp"
|
#include "drivers/RF24/RF24.cpp"
|
||||||
#include "hal/transport/MyTransportRF24.cpp"
|
#include "hal/transport/MyTransportRF24.cpp"
|
||||||
#elif defined(MY_RADIO_NRF5_ESB)
|
#elif defined(MY_RADIO_NRF5_ESB)
|
||||||
#if !defined(ARDUINO_ARCH_NRF5)
|
#if !defined(ARDUINO_ARCH_NRF5)
|
||||||
#error No support for nRF5 radio on this platform
|
#error No support for nRF5 radio on this platform
|
||||||
#endif
|
#endif
|
||||||
#if defined(MY_NRF5_ESB_ENABLE_ENCRYPTION)
|
#if defined(MY_NRF5_ESB_ENABLE_ENCRYPTION)
|
||||||
@@ -382,16 +388,20 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
|
|||||||
|
|
||||||
// HW mains
|
// HW mains
|
||||||
#if !defined(MY_CORE_ONLY)
|
#if !defined(MY_CORE_ONLY)
|
||||||
#if defined(ARDUINO_ARCH_ESP8266)
|
#if defined(ARDUINO_ARCH_AVR)
|
||||||
#include "hal/architecture/MyMainESP8266.cpp"
|
#include "hal/architecture/AVR/MyMainAVR.cpp"
|
||||||
|
#elif defined(ARDUINO_ARCH_SAMD)
|
||||||
|
#include "hal/architecture/SAMD/MyMainSAMD.cpp"
|
||||||
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
#include "hal/architecture/ESP8266/MyMainESP8266.cpp"
|
||||||
|
#elif defined(ARDUINO_ARCH_NRF5)
|
||||||
|
#include "hal/architecture/NRF5/MyMainNRF5.cpp"
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
#include "hal/architecture/MyMainLinux.cpp"
|
#include "hal/architecture/Linux/MyMainLinux.cpp"
|
||||||
#elif defined(ARDUINO_ARCH_STM32F1)
|
#elif defined(ARDUINO_ARCH_STM32F1)
|
||||||
#include "hal/architecture/MyMainSTM32F1.cpp"
|
#include "hal/architecture/STM32F1/MyMainSTM32F1.cpp"
|
||||||
#elif defined(TEENSYDUINO)
|
#elif defined(TEENSYDUINO)
|
||||||
#include "hal/architecture/MyMainTeensy3.cpp"
|
#include "hal/architecture/Teensy3/MyMainTeensy3.cpp"
|
||||||
#else
|
|
||||||
#include "hal/architecture/MyMainDefault.cpp"
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "Radio.h"
|
#include "Radio.h"
|
||||||
#include "Radio_ESB.h"
|
#include "Radio_ESB.h"
|
||||||
#include "hal/architecture/MyHwNRF5.h"
|
#include "hal/architecture/NRF5/MyHwNRF5.h"
|
||||||
#include "drivers/CircularBuffer/CircularBuffer.h"
|
#include "drivers/CircularBuffer/CircularBuffer.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|||||||
@@ -105,10 +105,6 @@ _SPI;
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if !defined(_BV)
|
|
||||||
#define _BV(x) (1<<(x)) //!< _BV()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__arm__) || defined(__linux__)
|
#if defined(__arm__) || defined(__linux__)
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
* between your home built sensors/actuators and HA controller of choice.
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
#ifndef MyHwAVR_h
|
#ifndef MyHwAVR_h
|
||||||
#define MyHwAVR_h
|
#define MyHwAVR_h
|
||||||
|
|
||||||
#include "MyHw.h"
|
|
||||||
#include <avr/eeprom.h>
|
#include <avr/eeprom.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
#include <avr/sleep.h>
|
#include <avr/sleep.h>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||||
|
* network topology allowing messages to be routed to nodes.
|
||||||
|
*
|
||||||
|
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||||
|
* Copyright (C) 2013-2017 Sensnology AB
|
||||||
|
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
|
||||||
|
*
|
||||||
|
* Documentation: http://www.mysensors.org
|
||||||
|
* Support Forum: http://forum.mysensors.org
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* version 2 as published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Initialize library and handle sketch functions like we want to
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
#if defined(USBCON)
|
||||||
|
USBDevice.attach();
|
||||||
|
#endif
|
||||||
|
_begin(); // Startup MySensors library
|
||||||
|
for(;;) {
|
||||||
|
_process(); // Process incoming data
|
||||||
|
if (loop) {
|
||||||
|
loop(); // Call sketch loop
|
||||||
|
}
|
||||||
|
if (serialEventRun) {
|
||||||
|
serialEventRun();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
* between your home built sensors/actuators and HA controller of choice.
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
@@ -19,8 +19,6 @@
|
|||||||
#ifndef MyHwESP8266_h
|
#ifndef MyHwESP8266_h
|
||||||
#define MyHwESP8266_h
|
#define MyHwESP8266_h
|
||||||
|
|
||||||
#include "MyHw.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "MyHw.h"
|
|
||||||
#include "SerialPort.h"
|
#include "SerialPort.h"
|
||||||
#include "SerialSimulator.h"
|
#include "SerialSimulator.h"
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
* between your home built sensors/actuators and HA controller of choice.
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
@@ -22,8 +22,6 @@
|
|||||||
#ifndef MyHwNRF5_h
|
#ifndef MyHwNRF5_h
|
||||||
#define MyHwNRF5_h
|
#define MyHwNRF5_h
|
||||||
|
|
||||||
#include "MyHw.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||||
|
* network topology allowing messages to be routed to nodes.
|
||||||
|
*
|
||||||
|
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||||
|
* Copyright (C) 2013-2017 Sensnology AB
|
||||||
|
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
|
||||||
|
*
|
||||||
|
* Documentation: http://www.mysensors.org
|
||||||
|
* Support Forum: http://forum.mysensors.org
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* version 2 as published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Initialize library and handle sketch functions like we want to
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
#if defined(USBCON)
|
||||||
|
USBDevice.attach();
|
||||||
|
#endif
|
||||||
|
_begin(); // Startup MySensors library
|
||||||
|
for(;;) {
|
||||||
|
_process(); // Process incoming data
|
||||||
|
if (loop) {
|
||||||
|
loop(); // Call sketch loop
|
||||||
|
}
|
||||||
|
if (serialEventRun) {
|
||||||
|
serialEventRun();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
* between your home built sensors/actuators and HA controller of choice.
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
@@ -19,8 +19,6 @@
|
|||||||
#ifndef MyHwSAMD_h
|
#ifndef MyHwSAMD_h
|
||||||
#define MyHwSAMD_h
|
#define MyHwSAMD_h
|
||||||
|
|
||||||
#include "MyHw.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
* between your home built sensors/actuators and HA controller of choice.
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
@@ -25,14 +25,11 @@ int main(void)
|
|||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
#if defined(USBCON)
|
#if defined(USBCON)
|
||||||
#if defined(ARDUINO_ARCH_SAMD)
|
|
||||||
__libc_init_array();
|
__libc_init_array();
|
||||||
USBDevice.init();
|
USBDevice.init();
|
||||||
#endif
|
|
||||||
USBDevice.attach();
|
USBDevice.attach();
|
||||||
#endif
|
#endif
|
||||||
_begin(); // Startup MySensors library
|
_begin(); // Startup MySensors library
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
_process(); // Process incoming data
|
_process(); // Process incoming data
|
||||||
if (loop) {
|
if (loop) {
|
||||||
@@ -20,8 +20,6 @@
|
|||||||
#ifndef MyHwSTM32F1_h
|
#ifndef MyHwSTM32F1_h
|
||||||
#define MyHwSTM32F1_h
|
#define MyHwSTM32F1_h
|
||||||
|
|
||||||
#include "MyHw.h"
|
|
||||||
|
|
||||||
#include <libmaple/iwdg.h>
|
#include <libmaple/iwdg.h>
|
||||||
#include <itoa.h>
|
#include <itoa.h>
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||||
* between your home built sensors/actuators and HA controller of choice.
|
* between your home built sensors/actuators and HA controller of choice.
|
||||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||||
@@ -28,7 +28,6 @@
|
|||||||
#ifndef MyHwTeensy3_h
|
#ifndef MyHwTeensy3_h
|
||||||
#define MyHwTeensy3_h
|
#define MyHwTeensy3_h
|
||||||
|
|
||||||
#include "MyHw.h"
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user