only count seconds_since_reset when logging is enabled

pull/56/head
theFeiter 2 years ago
parent f29e7ce916
commit 48d2a6f012

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

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

Loading…
Cancel
Save