only count seconds_since_reset when logging is enabled

This commit is contained in:
theFeiter 2022-07-11 12:15:55 +02:00
parent f29e7ce916
commit 48d2a6f012
2 changed files with 2 additions and 5 deletions

View File

@ -145,7 +145,7 @@ void loop() {
timeClient.update(); //update internal clock if possible
#endif
#ifndef USE_WIFI
#if defined (USE_SD_LOG) || defined (USE_FS_LOG)
unsigned long current_millis = millis();
if(current_millis-last_millis >= 1000){
seconds_since_reset+=(current_millis-last_millis)/1000;

View File

@ -88,12 +88,9 @@ uint8_t LoRa2[] = {mac_prefix[3], mac_prefix[4], LORA2_PEER};
//uint8_t LoRaAddress[] = {0x42, 0x00};
#endif
#ifndef USE_WIFI
#if defined (USE_SD_LOG) || defined (USE_FS_LOG)
unsigned long last_millis = 0;
unsigned long seconds_since_reset = 0;
#endif
#if defined (USE_SD_LOG) || defined (USE_FS_LOG)
char logBuffer[512];
uint16_t logBufferPos = 0; // datatype depends on size of sdBuffer
#endif