From 81fda86ef7628b6eb2b0d1c6088e514a52940189 Mon Sep 17 00:00:00 2001 From: fx2 Date: Mon, 31 Oct 2022 09:32:17 +0100 Subject: [PATCH] adapt main-changes fro nokia5110 functions --- tools/esp8266/app.cpp | 22 ++++++++++++---------- tools/esp8266/platformio.ini | 8 ++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tools/esp8266/app.cpp b/tools/esp8266/app.cpp index 86de4b5f..9240d36b 100644 --- a/tools/esp8266/app.cpp +++ b/tools/esp8266/app.cpp @@ -11,6 +11,7 @@ #include "app.h" #include +#include //----------------------------------------------------------------------------- @@ -64,42 +65,43 @@ static unsigned char bmp_arrow[] U8X8_PROGMEM = { B01110000, B01110000, B00110000, B00111000, B00011000, B01111111, B00111111, B00011110, B00001110, B00000110, B00000000, B00000000, B00000000, B00000000 } ; -void DataScreen( app* main, time_t ts ) +void DataScreen( app* mApp, time_t ts ) { static int extra = 0; - String timeStr = main->getDateTimeStr(ts).substring(2,22); + String timeStr = mApp->getDateTimeStr(ts).substring(2,22); IPAddress ip = WiFi.localIP(); float totalYield = 0.000, totalYieldToday = 0.000, totalActual = 0.0; char fmtText[32]; int ucnt=0; - for (uint8_t id = 0; id < main->mSys->getNumInverters(); id++) + for (uint8_t id = 0; id < mApp->mSys->getNumInverters(); id++) { - Inverter<> *iv = main->mSys->getInverterByPos(id); + Inverter<> *iv = mApp->mSys->getInverterByPos(id); if (NULL != iv) { + record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug); uint8_t pos; uint8_t list[] = {FLD_PAC, FLD_YT, FLD_YD}; - if ( !iv->isAvailable(ts) ) + if ( !iv->isProducing(ts,rec) ) continue; ucnt++; for (uint8_t fld = 0; fld < 3; fld++) { - pos = (iv->getPosByChFld(CH0, list[fld])); + pos = iv->getPosByChFld(CH0, list[fld],rec); if(fld == 1){ - totalYield += iv->getValue(pos); + totalYield += iv->getValue(pos,rec); } if(fld == 2){ - totalYieldToday += iv->getValue(pos); + totalYieldToday += iv->getValue(pos,rec); } if(fld == 0){ - totalActual += iv->getValue(pos); + totalActual += iv->getValue(pos,rec); } } } @@ -202,7 +204,7 @@ void app::loop(void) { static int lcnt=0; if ( lcnt == 150000 ) { - DataScreen(this, mTimestamp); + DataScreen(this, mUtcTimestamp); lcnt=0; } lcnt++; diff --git a/tools/esp8266/platformio.ini b/tools/esp8266/platformio.ini index 226fa49b..f3a7bf2e 100644 --- a/tools/esp8266/platformio.ini +++ b/tools/esp8266/platformio.ini @@ -50,7 +50,7 @@ lib_deps = platform = espressif8266 board = esp12e board_build.f_cpu = 80000000L -build_flags = -D RELEASE +build_flags = -D RELEASE -DU8X8_NO_HW_I2C monitor_filters = ;default ; Remove typical terminal control codes from input time ; Add timestamp with milliseconds for each new line @@ -60,7 +60,7 @@ monitor_filters = platform = espressif8266 board = esp12e board_build.f_cpu = 80000000L -build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial +build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial -DU8X8_NO_HW_I2C build_type = debug monitor_filters = ;default ; Remove typical terminal control codes from input @@ -72,7 +72,7 @@ platform = espressif8266 board = esp8285 board_build.ldscript = eagle.flash.1m64.ld board_build.f_cpu = 80000000L -build_flags = -D RELEASE +build_flags = -D RELEASE -DU8X8_NO_HW_I2C monitor_filters = ;default ; Remove typical terminal control codes from input time ; Add timestamp with milliseconds for each new line @@ -83,7 +83,7 @@ platform = espressif8266 board = esp8285 board_build.ldscript = eagle.flash.1m64.ld board_build.f_cpu = 80000000L -build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial +build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial -DU8X8_NO_HW_I2C build_type = debug monitor_filters = ;default ; Remove typical terminal control codes from input