From 9432898b039fe6e27487a1cb283b25aea3fcdcd5 Mon Sep 17 00:00:00 2001 From: livello Date: Wed, 10 Oct 2018 14:24:18 +0300 Subject: [PATCH] printex streaming --- lighthub/main.cpp | 32 ++++++++++++++++++++------------ lighthub/options.h | 4 +++- platformio.ini | 1 + 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 101c198..0ebdc85 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -67,8 +67,13 @@ PWM Out #include "Arduino.h" #include "main.h" #include "options.h" -//#include "Streaming.h" +#ifdef WITH_STREAMING_LIB +#include "Streaming.h" +#else #include "PrintEx.h" +using namespace ios; +#endif + #if defined(__SAM3X8E__) DueFlashStorage EEPROM; @@ -79,7 +84,7 @@ EthernetClient ethClient; EthernetClient ethClient; #endif -#ifdef ESP8266 +#ifdef ARDUINO_ARCH_ESP8266 #include #include WiFiClient ethClient; @@ -169,7 +174,7 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) { for (int i = 0; i < length; i++) debugSerial<<((char) payload[i]); - debugSerial< THERMO_OVERHEAT_CELSIUS) mqttClient.publish("/alarm/ovrht", thermoItem->name); - debugSerial << ios::endl << thermoItem->name << F("Set:") << thermoSetting << F(" Cur:") << curTemp + debugSerial << endl << thermoItem->name << F("Set:") << thermoSetting << F(" Cur:") << curTemp << F(" cmd:") << thermoStateCommand; pinMode(thermoPin, OUTPUT); if (thermoDisabledOrDisconnected(thermoExtensionArray, thermoStateCommand)) { diff --git a/lighthub/options.h b/lighthub/options.h index 00a9fcc..b991274 100644 --- a/lighthub/options.h +++ b/lighthub/options.h @@ -112,9 +112,11 @@ #define dmxin DmxDue1 #endif -#if defined(ESP8266) +#if defined(ARDUINO_ARCH_ESP8266) #undef _dmxin #undef _modbus +#define WITH_STREAMING_LIB + #ifndef DMX_DISABLE #define _espdmx #endif diff --git a/platformio.ini b/platformio.ini index afbcc20..01596bd 100644 --- a/platformio.ini +++ b/platformio.ini @@ -146,6 +146,7 @@ lib_deps = WifiManager https://github.com/arcao/Syslog.git https://github.com/livello/PrintEx.git#is-select-redecl + Streaming [env:megaatmega2560-net] platform = atmelavr