From cc003c43f0a6dc0074e032c8f76c57acf9765231 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Fri, 27 Apr 2018 21:38:50 +0200 Subject: [PATCH] removed var currentMillis --- src/globals.h | 1 - src/main.cpp | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/globals.h b/src/globals.h index 7035c7d2..6d8f393b 100644 --- a/src/globals.h +++ b/src/globals.h @@ -46,7 +46,6 @@ typedef struct { extern configData_t cfg; extern uint8_t mydata[]; extern uint64_t uptimecounter; -extern unsigned long currentMillis ; extern osjob_t sendjob; extern char display_lora[], display_lmic[]; extern int countermode, screensaver, adrmode, lorasf, txpower, rlim; diff --git a/src/main.cpp b/src/main.cpp index 8aff95ee..1e937e9c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,8 +41,7 @@ Refer to LICENSE.txt file in repository for more details. configData_t cfg; // struct holds current device configuration osjob_t sendjob, initjob; // LMIC jobs uint64_t uptimecounter = 0; // timer global for uptime counter -unsigned long currentMillis = millis(); // timer global for state machine -unsigned long previousDisplaymillis = currentMillis; // Display refresh for state machine +unsigned long previousDisplaymillis = millis(); // Display refresh for state machine uint8_t DisplayState = 0; // globals for state machine uint16_t macs_total = 0, macs_wifi = 0, macs_ble = 0; // MAC counters globals for display uint8_t channel = 0; // wifi channel rotation counter global for display @@ -335,7 +334,7 @@ uint64_t uptime() { void updateDisplay() { // timed display refresh according to refresh cycle setting - if (currentMillis - previousDisplaymillis >= DISPLAYREFRESH_MS) { + if (millis() - previousDisplaymillis >= DISPLAYREFRESH_MS) { refreshDisplay(); previousDisplaymillis += DISPLAYREFRESH_MS; } @@ -579,7 +578,6 @@ void loop() { // simple state machine for controlling display, LED, button, etc. uptimecounter = uptime() / 1000; // counts uptime in seconds (64bit) - currentMillis = millis(); // timebase for state machine in milliseconds (32bit) #if (HAS_LED != NOT_A_PIN) || defined (HAS_RGB_LED) led_loop();