14 |
14 |
15 #include "vfs_fat_internal.h" |
15 #include "vfs_fat_internal.h" |
16 #include "driver/sdmmc_host.h" |
16 #include "driver/sdmmc_host.h" |
17 #include "driver/sdspi_host.h" |
17 #include "driver/sdspi_host.h" |
18 #include "sdmmc_cmd.h" |
18 #include "sdmmc_cmd.h" |
19 #include "diskio.h" |
19 #include "diskio_impl.h" |
|
20 #include "diskio_sdmmc.h" |
20 |
21 |
21 #include "config.h" |
22 #include "config.h" |
22 |
23 |
23 |
24 |
24 |
25 |
137 |
138 |
138 |
139 |
139 |
140 |
140 void log_annotation(int annotation_type, char *label) |
141 void log_annotation(int annotation_type, char *label) |
141 { |
142 { |
142 char filename[32]; |
143 char filename[64]; |
143 char bordercolor[9], color[9], pos[8]; |
144 char bordercolor[9], color[9], pos[8]; |
144 FILE *f; |
145 FILE *f; |
145 bool addcomma = true; |
146 bool addcomma = true; |
146 int Hour = (TimeBrewing / 3600); |
147 int Hour = (TimeBrewing / 3600); |
147 int Minute = ((TimeBrewing % 3600) / 60); |
148 int Minute = ((TimeBrewing % 3600) / 60); |
463 char lf[32]; |
464 char lf[32]; |
464 |
465 |
465 if (dir != NULL) { |
466 if (dir != NULL) { |
466 struct dirent *de = readdir(dir); |
467 struct dirent *de = readdir(dir); |
467 while (de) { |
468 while (de) { |
468 sprintf(lf, "/spiffs/log/%s", de->d_name); |
469 sprintf(lf, "/spiffs/log/"); |
|
470 strncat(lf, de->d_name, 31 - strlen(lf)); |
469 if (unlink(lf) == ESP_OK) { |
471 if (unlink(lf) == ESP_OK) { |
470 ESP_LOGI(TAG, "Removed old %s", lf); |
472 ESP_LOGI(TAG, "Removed old %s", lf); |
471 } |
473 } |
472 de = readdir(dir); |
474 de = readdir(dir); |
473 vTaskDelay(2 / portTICK_PERIOD_MS); |
475 vTaskDelay(2 / portTICK_PERIOD_MS); |