Skip to content

Commit a4e772c

Browse files
committed
Remove readCurrentSession() which can be seen obsolte if running from a single partition
1 parent 8106312 commit a4e772c

File tree

3 files changed

+0
-90
lines changed

3 files changed

+0
-90
lines changed

eloc610LowPowerPartition/src/ElocConfig.cpp

-83
Original file line numberDiff line numberDiff line change
@@ -465,86 +465,3 @@ void readConfig() {
465465
ESP_LOGI(TAG, "Sample Rate is > 32khz Forcing NO_APLL ");
466466
}
467467
}
468-
469-
void readCurrentSession() {
470-
char line[128] = "";
471-
char *position;
472-
473-
FILE *f = fopen("/spiffs/currentsession.txt", "r");
474-
if (f == NULL) {
475-
// gSessionFolder="";
476-
ESP_LOGI(TAG, "Failed to open file for reading");
477-
// return;
478-
} else {
479-
480-
// char *test=line;
481-
482-
while (!feof(f)) {
483-
fgets(line, sizeof(line), f);
484-
// ESP_LOGI(TAG, "%s", line);
485-
// char *test2;
486-
// int start,finish;
487-
position = strstr(line, "Session ID");
488-
if (position != NULL) {
489-
position = strstr(line, "_"); // need to ad one memory location
490-
//
491-
// the long epoch will be in the first 10 digits. int microseconds the last 3
492-
493-
gStartupTime = atoll(position + 1);
494-
495-
char epoch[10] = "";
496-
epoch[0] = *(position + 1);
497-
epoch[1] = *(position + 2);
498-
epoch[2] = *(position + 3);
499-
epoch[3] = *(position + 4);
500-
epoch[4] = *(position + 5);
501-
epoch[5] = *(position + 6);
502-
epoch[6] = *(position + 7);
503-
epoch[7] = *(position + 8);
504-
epoch[8] = *(position + 9);
505-
epoch[9] = *(position + 10);
506-
507-
char ms[3] = "";
508-
ms[0] = *(position + 11);
509-
ms[1] = *(position + 12);
510-
ms[2] = *(position + 13);
511-
512-
// ESP_LOGI(TAG, "epoch %s", epoch);
513-
// ESP_LOGI(TAG, "ms %s", ms);
514-
515-
setTime(atol(epoch), atoi(ms));
516-
ESP_LOGI(TAG, "startup time %lld", gStartupTime);
517-
// ESP_LOGI(TAG, "testing atol %ld", atol("1676317685250"));
518-
// ESP_LOGI(TAG, "testing atoll %lld", atoll("1676317685250"));
519-
position = strstr(line, ": ");
520-
ESP_LOGI(TAG, "session FOLDER 1 %s", position + 3);
521-
strncat(gSessionFolder, position + 3, 63);
522-
gSessionFolder[strcspn(gSessionFolder, "\n")] = '\0';
523-
ESP_LOGI(TAG, "gSessionFolder %s", gSessionFolder);
524-
}
525-
position = strstr(line, "Sample Rate:");
526-
if (position != NULL) {
527-
position = strstr(line, ": "); // need to ad one memory location
528-
gSampleRate = atoi(position + 3);
529-
// gSampleRate=4000;
530-
ESP_LOGI(TAG, "sample rate %u", gSampleRate);
531-
}
532-
533-
position = strstr(line, "Mic Gain:");
534-
if (position != NULL) {
535-
position = strstr(line, ": "); // need to ad one memory location
536-
gbitShift = atol(position + 3);
537-
ESP_LOGI(TAG, "bit shift %d", gbitShift);
538-
}
539-
540-
position = strstr(line, "Seconds Per File:");
541-
if (position != NULL) {
542-
position = strstr(line, ": "); // need to ad one memory location
543-
gSecondsPerFile = atol(position + 3);
544-
ESP_LOGI(TAG, "seconds per file %d", gSecondsPerFile);
545-
}
546-
}
547-
}
548-
549-
fclose(f);
550-
}

eloc610LowPowerPartition/src/ElocConfig.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,5 @@ void writeSettings(String settings);
6262
void readSettings();
6363
//TODO: why are there 2 different kind of configs?
6464
void readConfig();
65-
void readCurrentSession();
6665

6766
#endif // ELOCCONFIG_HPP_

eloc610LowPowerPartition/src/main.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -1199,12 +1199,6 @@ if (SerialBT.isReady()) {
11991199
readSettings();
12001200
readMicInfo();
12011201

1202-
1203-
readCurrentSession();
1204-
1205-
1206-
1207-
12081202
ESP_ERROR_CHECK(gpio_install_isr_service(GPIO_INTR_PRIO));
12091203

12101204
ESP_LOGI(TAG, "Creating LIS3DH wakeup task...");

0 commit comments

Comments
 (0)