@@ -465,86 +465,3 @@ void readConfig() {
465
465
ESP_LOGI (TAG, " Sample Rate is > 32khz Forcing NO_APLL " );
466
466
}
467
467
}
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
- }
0 commit comments