fix timestamp in SD logging
This commit is contained in:
parent
42aa481c70
commit
d35a5c6708
@ -244,17 +244,19 @@ void sdcardWriteData(uint16_t noWifi, uint16_t noBle,
|
||||
if (!useSDCard)
|
||||
return;
|
||||
|
||||
char tempBuffer[20 + 1];
|
||||
char timeBuffer[20 + 1];
|
||||
time_t t = time(NULL);
|
||||
struct tm tt;
|
||||
gmtime_r(&t, &tt); // make UTC timestamp
|
||||
strftime(timeBuffer, sizeof(timeBuffer), "%FT%TZ", &tt);
|
||||
|
||||
#if (HAS_SDS011)
|
||||
sdsStatus_t sds;
|
||||
#endif
|
||||
|
||||
ESP_LOGI(TAG, "writing data to SD-card");
|
||||
fprintf(data_file, "%FT%TZ", &tt);
|
||||
|
||||
fprintf(data_file, "%s", timeBuffer);
|
||||
fprintf(data_file, ",%d,%d", noWifi, noBle);
|
||||
#if (defined BAT_MEASURE_ADC || defined HAS_PMU)
|
||||
fprintf(data_file, ",%d", voltage);
|
||||
|
Loading…
Reference in New Issue
Block a user