microSD Card control function for DISCO-F469NI based on BD_SD_DISCO_F746NG library by Roy Krikke
Dependencies: BSP_DISCO_F469NI_modified BD_SD_DISCO_F469NI
Fork of DISCO-F769NI_BD_SD_Card_Control by
Please refer following my Notebook page.
/users/kenjiArai/notebook/sd-card-control-new/
Diff: FatFs_Mon/mon.cpp
- Revision:
- 9:b819be925e97
- Parent:
- 7:ce59e951625f
- Child:
- 10:b5665028f662
diff -r 3c5373ba612a -r b819be925e97 FatFs_Mon/mon.cpp --- a/FatFs_Mon/mon.cpp Sat Dec 07 03:26:31 2019 +0000 +++ b/FatFs_Mon/mon.cpp Fri Dec 27 02:59:09 2019 +0000 @@ -8,7 +8,7 @@ * Created: May 5th, 2015 * Revised: June 14th, 2015 * Revised: April 7th, 2018 - * Revised: August 17th, 2019 + * Revised: December 24th, 2019 */ /* @@ -119,7 +119,7 @@ "x extend commands mode\r\n" "q Return to main\r\n" "t Show current time or Adjust time\r\n" - " e.g. t 18 3 28 14 48 20 -> 2018-03-28 14:48:20\r\n" + " e.g. t 19 12 24 10 11 12 -> 2019-12-24 10:11:12\r\n" "? Help/You know the command\r\n" "\r\n"; @@ -292,6 +292,30 @@ } } +uint32_t get_data_file_size(const char *const file_name) +{ + BYTE res; + //const char *file_name ="acc_data.txt"; + + if (Dirx == NULL){ + Dirx = new FATFS_DIR; + } + char p = NULL; + res = f_opendir(Dirx, &p); + if (res) { + put_rc((FRESULT)res); + return 0; + } + for(;;) { + res = f_readdir(Dirx, &Finfo); + if ((res != FR_OK) || !Finfo.fname[0]) break; + if (strcmp(Finfo.fname, file_name) == 0){ + return Finfo.fsize; + } + } + return 0; +} + static void extended_mon( char *ptr ) { PUTS(HelpMsg1);