diff --git a/lighthub/item.h b/lighthub/item.h index 5c52e58..36d43d7 100644 --- a/lighthub/item.h +++ b/lighthub/item.h @@ -129,9 +129,9 @@ class Item //void setVal(uint8_t n, int par); void setVal(long int par); //void copyPar (aJsonObject *itemV); - inline int On (){Ctrl(CMD_ON);}; - inline int Off(){Ctrl(CMD_OFF);}; - inline int Toggle(){Ctrl(CMD_TOGGLE);}; + inline int On (){return Ctrl(CMD_ON);}; + inline int Off(){return Ctrl(CMD_OFF);}; + inline int Toggle(){return Ctrl(CMD_TOGGLE);}; int Poll(); int SendStatus(short cmd, short n=0, int * Par=NULL, boolean deferred = false); diff --git a/lighthub/main.cpp b/lighthub/main.cpp index e720103..cd2130c 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -87,17 +87,6 @@ NRFFlashStorage EEPROM; #endif #ifdef ARDUINO_ARCH_STM32 -#include "HttpClient.h" -//#include -#include "UIPEthernet.h" -//#include "UIPUdp.h" -//#include -//#include - -#include "Dns.h" -//#include "utility/logging.h" -#include - EthernetClient ethClient; #endif @@ -964,6 +953,7 @@ int mqttConfigRequest(int arg_cnt, char **args) strncat(buf, "/req/conf", 25); debugSerial< //this needs to be first, or it all crashes and burns... -#include +#include #include #include #include @@ -45,14 +45,14 @@ #include #endif -#if defined(__SAM3X8E__) -#define wdt_res() watchdogReset() -#define wdt_en() -#define wdt_dis() +#ifdef ARDUINO_ARCH_STM32 +#include "HttpClient.h" +#include "UIPEthernet.h" +#include #endif -#if defined(ARDUINO_ARCH_STM32F1) -#define wdt_res() +#if defined(__SAM3X8E__) +#define wdt_res() watchdogReset() #define wdt_en() #define wdt_dis() #endif diff --git a/lighthub/options.h b/lighthub/options.h index 65d3084..ee542fb 100644 --- a/lighthub/options.h +++ b/lighthub/options.h @@ -4,6 +4,7 @@ #endif #define TXEnablePin 13 +#define ESP_EEPROM_SIZE 4096 #ifndef AVR_DMXOUT_PIN #define AVR_DMXOUT_PIN 3 diff --git a/platformio.ini b/platformio.ini index 6bb34d8..410b619 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,7 +25,7 @@ src_dir = lighthub ;build_dir = /tmp/pioenvs ;libdeps_dir = /tmp/piolibdeps -[env:nrf52840_dk] +[env:nrf52840] platform = nordicnrf52 board = nrf52840_dk ;upload_protocol = mbed @@ -33,6 +33,7 @@ board = nrf52840_dk framework = arduino build_flags = !bash check_custom_build_flags_nrf52840.sh lib_ignore = + ESP_EEPROM DmxSimple DMXSerial DmxDue @@ -45,6 +46,7 @@ lib_ignore = httpClient FastLED ESPDMX + ESP-Dmx DueFlashStorage PrintEx ;DHT sensor library @@ -56,7 +58,7 @@ lib_ignore = lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire - Ethernet2 + https://github.com/anklimov/Ethernet2 ESP8266HTTPClient https://github.com/anklimov/aJson https://github.com/anklimov/CmdArduino @@ -65,7 +67,6 @@ lib_deps = ; https://github.com/anklimov/Artnet.git ; FastLED Adafruit Unified Sensor -; DHT sensor library for ESPx DHT sensor library Streaming https://github.com/anklimov/NRFFlashStorage @@ -109,17 +110,16 @@ lib_ignore = DHT sensor library Wire UIPEthernet - ;WifiManager - ;HTTPClient - ;HttpClient + ESP_EEPROM lib_deps = https://github.com/ebenolson/WIFIMANAGER-ESP32.git https://github.com/zhouhan0126/WebServer-esp32.git - https://github.com/arduino-libraries/ArduinoHttpClient.git + ArduinoHttpClient https://github.com/anklimov/aJson https://github.com/anklimov/CmdArduino https://github.com/knolleary/pubsubclient.git Streaming + ;ESP_EEPROM https://github.com/anklimov/NRFFlashStorage [env:due] platform = atmelsam @@ -128,10 +128,12 @@ board = due build_flags = !bash check_custom_build_flags_due.sh lib_ignore = DHT sensor library for ESPx + ESP_EEPROM DMXSerial DmxSimple httpClient ESPDMX + ESP-Dmx WifiManager Ethernet3 NRFFlashStorage @@ -142,7 +144,7 @@ lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire https://github.com/anklimov/DmxDue - https://github.com/anklimov/ArduinoHttpClient + ArduinoHttpClient https://github.com/anklimov/aJson https://github.com/anklimov/CmdArduino https://github.com/anklimov/ModbusMaster @@ -174,6 +176,7 @@ lib_ignore = NRFFlashStorage WebServer UIPEthernet + ESP_EEPROM lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire @@ -187,7 +190,7 @@ lib_deps = https://github.com/knolleary/pubsubclient.git https://github.com/anklimov/Artnet.git FastLED - EEPROM + ;EEPROM Adafruit Unified Sensor DHT sensor library https://github.com/arcao/Syslog.git @@ -230,6 +233,7 @@ lib_deps = WifiManager https://github.com/arcao/Syslog.git Streaming + ESP_EEPROM [env:megaatmega2560-net] platform = atmelavr @@ -241,6 +245,7 @@ lib_ignore = DHT sensor library for ESPx DmxDue DueFlashStorage + ESPDMX ESP-Dmx WifiManager Ethernet3 @@ -248,6 +253,7 @@ lib_ignore = NRFFlashStorage WebServer UIPEthernet + ESP_EEPROM lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire @@ -273,10 +279,9 @@ board = due build_flags = !bash check_custom_build_flags_due-5500.sh lib_ignore = DHT sensor library for ESPx - https://github.com/anklimov/Ethernet + ESPDMX ESP-Dmx DMXSerial - ESPDMX WifiManager DmxSimple httpClient @@ -285,12 +290,13 @@ lib_ignore = NRFFlashStorage WebServer UIPEthernet + ESP_EEPROM lib_deps = https://github.com/sebnil/DueFlashStorage https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire https://github.com/anklimov/DmxDue - https://github.com/anklimov/ArduinoHttpClient + ArduinoHttpClient https://github.com/anklimov/aJson https://github.com/anklimov/CmdArduino https://github.com/anklimov/ModbusMaster @@ -315,6 +321,7 @@ lib_ignore = DHT sensor library for ESPx DmxDue DueFlashStorage + ESPDMX ESP-Dmx WifiManager Ethernet3 @@ -322,6 +329,7 @@ lib_ignore = NRFFlashStorage WebServer UIPEthernet + ESP_EEPROM lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire @@ -335,7 +343,7 @@ lib_deps = https://github.com/knolleary/pubsubclient.git https://github.com/anklimov/Artnet.git FastLED - EEPROM + ;EEPROM Adafruit Unified Sensor DHT sensor library Streaming @@ -352,11 +360,11 @@ lib_ignore = DHT sensor library for ESPx DmxDue DueFlashStorage + ESPDMX ESP-Dmx WifiManager FastLED Ethernet - https://github.com/anklimov/Ethernet DMXSerial DmxSimple httpClient @@ -367,6 +375,7 @@ lib_ignore = Ethernet3 NRFFlashStorage WebServer + ESP_EEPROM lib_deps = ; DallasTemperature @@ -378,4 +387,4 @@ lib_deps = DHT sensor library Streaming UIPEthernet - EEPROM + ;EEPROM