From 321e4843bad2bc833f0cb783621e94b06064bad7 Mon Sep 17 00:00:00 2001 From: livello Date: Thu, 18 Oct 2018 08:49:39 +0300 Subject: [PATCH] return WITH_PRINTEX_LIB and still has compilation problems --- .gitignore | 5 ++--- README.md | 2 ++ custom-build-flags/build_flags_template.sh | 1 + lighthub/main.cpp | 10 ++++++++-- lighthub/utils.h | 5 +++++ platformio.ini | 10 ++++++---- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index f1bf334..a194c49 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,9 @@ .gcc-flags.json CMakeListsPrivate.txt build_flags_due.sh -build_flags_due_cheb.sh -build_flags_due_riko.sh build_flags_esp32.sh build_flags_esp8266.sh build_flags_stm32.sh build_flags_due-5500.sh -build_flags_mega2560.sh \ No newline at end of file +build_flags_mega2560.sh +build_flags_controllino.sh \ No newline at end of file diff --git a/README.md b/README.md index d40954f..9404663 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ platformio device monitor -b 115200 * RESTART_LAN_ON_MQTT_ERRORS //reinit LAN if many mqtt errors occured * DEVICE_NAME short handy device name which is used instead of mac for download config http://{MY_CONFIG_SERVER}/{DEVICE_NAME}_config.json * SYSLOG_ENABLE enable UDP SYSLOG support feature(under DEVELOPMENT) that must be configured through config file +* WITH_PRINTEX_LIB use PrintEx library (develop experimental feature) @@ -180,5 +181,6 @@ platformio device monitor -b 115200 * RESTART_LAN_ON_MQTT_ERRORS disabled * DEVICE_NAME disabled * SYSLOG_ENABLE disabled +* WITH_PRINTEX_LIB diabled, using Streaming library If you've using Arduino IDE to compile & flash firmware, it will use Default options above and you will not able to configure additional compilers options except edit "options.h" file diff --git a/custom-build-flags/build_flags_template.sh b/custom-build-flags/build_flags_template.sh index 6032bbf..517a351 100644 --- a/custom-build-flags/build_flags_template.sh +++ b/custom-build-flags/build_flags_template.sh @@ -27,5 +27,6 @@ #export FLAGS="$FLAGS -DSYSLOG_ENABLE" #export FLAGS="$FLAGS -DDEVICE_NAME=MYDEVICE" #export FLAGS="$FLAGS -DDHT_COUNTER_DISABLE" +#export FLAGS="$FLAGS -DWITH_PRINTEX_LIB" export FLAGS="$FLAGS -DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short) echo $FLAGS diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 2b1dbd6..33e6ca7 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -69,8 +69,6 @@ PWM Out #include "options.h" #include "utils.h" - - #if defined(__SAM3X8E__) DueFlashStorage EEPROM; EthernetClient ethClient; @@ -204,13 +202,21 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) { void printIPAddress(IPAddress ipAddress) { for (byte i = 0; i < 4; i++) +#ifdef WITH_PRINTEX_LIB + (i < 3) ? debugSerial << (ipAddress[i]) << F(".") : debugSerial << (ipAddress[i])< #include "options.h" +#ifdef WITH_PRINTEX_LIB +#include "PrintEx.h" +using namespace ios; +#else #include "Streaming.h" +#endif void PrintBytes(uint8_t* addr, uint8_t count, bool newline); void SetBytes(uint8_t* addr, uint8_t count, char * out); diff --git a/platformio.ini b/platformio.ini index 7a4e33c..a4bf2cf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,14 +16,14 @@ env_default = ; esp8266 ; esp32 ; megaatmega2560-5500 -; due-5500 - controllino + due-5500 +; controllino ; stm32 ;build_dir = !sh pioenvs.sh ${platformio.env_default} ;libdeps_dir = !sh piolibdeps.sh ${platformio.env_default} -;build_dir = /tmp/pioenvs -;libdeps_dir = /tmp/piolibdeps +build_dir = /tmp/pioenvs +libdeps_dir = /tmp/piolibdeps [env:esp32] platform = espressif32 @@ -203,6 +203,7 @@ lib_deps = DHT sensor library https://github.com/arcao/Syslog.git Streaming + https://github.com/livello/PrintEx#is-select-redecl [env:controllino] platform = atmelavr @@ -228,3 +229,4 @@ lib_deps = Adafruit Unified Sensor DHT sensor library Streaming + https://github.com/livello/PrintEx#is-select-redecl