From 0aad6804106ad3717d8e679d8ce90f35466ac34e Mon Sep 17 00:00:00 2001 From: Lubos Petrovic Date: Mon, 28 Dec 2020 13:12:46 +0100 Subject: [PATCH] main loop counter --- Board320_240.cpp | 4 +++- LiveData.cpp | 1 + LiveData.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Board320_240.cpp b/Board320_240.cpp index 6a3a145..690b2be 100644 --- a/Board320_240.cpp +++ b/Board320_240.cpp @@ -1285,7 +1285,7 @@ void Board320_240::redrawScreen() { // SDCARD recording /*liveData->params.sdcardRecording*/ - if (liveData->settings.sdcardEnabled == 1) { + if (liveData->settings.sdcardEnabled == 1 && (liveData->params.mainLoopCounter & 1) == 1) { spr.fillCircle((displayScreen == SCREEN_SPEED || displayScreenAutoMode == SCREEN_SPEED) ? 140 : 310, 10, 4, TFT_BLACK); spr.fillCircle((displayScreen == SCREEN_SPEED || displayScreenAutoMode == SCREEN_SPEED) ? 140 : 310, 10, 3, (liveData->params.sdcardInit == 1) ? @@ -1353,6 +1353,8 @@ void Board320_240::loadTestData() { */ void Board320_240::mainLoop() { + liveData->params.mainLoopCounter++; + /////////////////////////////////////////////////////////////////////// // Handle buttons // MIDDLE - menu select diff --git a/LiveData.cpp b/LiveData.cpp index 172709a..3eee77e 100644 --- a/LiveData.cpp +++ b/LiveData.cpp @@ -15,6 +15,7 @@ void debug(String msg, uint8_t debugLevel) { */ void LiveData::initParams() { + params.mainLoopCounter = 0; // SIM params.lastDataSent = 0; params.sim800l_enabled = false; diff --git a/LiveData.h b/LiveData.h index dfb801f..53fbaa4 100644 --- a/LiveData.h +++ b/LiveData.h @@ -45,6 +45,7 @@ typedef struct { // System time_t currentTime; time_t chargingStartTime; + uint32_t mainLoopCounter; // SIM time_t lastDataSent; bool sim800l_enabled;