Recording WAV files
Dependencies: mbed SDFileSystem
Diff: FatFs_Mon/mon.cpp
- Revision:
- 4:fc36c8ec2966
- Parent:
- 2:1397a54382ec
- Child:
- 5:e222c59853e2
diff -r 2134d3cb4e8e -r fc36c8ec2966 FatFs_Mon/mon.cpp --- a/FatFs_Mon/mon.cpp Tue Jun 04 11:28:09 2019 +0000 +++ b/FatFs_Mon/mon.cpp Sat Aug 17 03:28:33 2019 +0000 @@ -2,12 +2,13 @@ * mbed Application program for the mbed * FatFs Check program / monitor part * - * Copyright (c) 2015,'18 Kenji Arai / JH1PJL + * Copyright (c) 2015,'18,'19 Kenji Arai / JH1PJL * http://www.page.sannet.ne.jp/kenjia/index.html * https://os.mbed.com/users/kenjiArai/ * Created: May 5th, 2015 * Revised: June 14th, 2015 * Revised: April 7th, 2018 + * Revised: August 17th, 2019 */ /* @@ -62,7 +63,6 @@ // from ffconf.h #define _VOLUMES 1 -#define FF_USE_LFN 0 #if !defined(FF_FS_RPATH) #define FF_FS_RPATH 0 @@ -101,16 +101,12 @@ FIL File1, File2; // File objects FATFS_DIR* Dirx; FILINFO Finfo; -#if FF_USE_LFN -//inside of FILINFO -char Lfname[512]; -#endif DWORD AccSize; // Work register for fs command WORD AccFiles, AccDirs; // ROM / Constant data -------------------------------------------------------- -char *const monmsg0 = "Start monitor program for FatFs File System\r\n"; -char *const monmsg1 = " <Please press any key to start the monitor>"; +const char *const monmsg0 = "Start monitor program for FatFs File System\r\n"; +const char *const monmsg1 = " <Please press any key to start the monitor>"; static const char HelpMsg0[] = "dir <full_pass>\r\n" @@ -212,11 +208,6 @@ PUTS(monmsg0); PUTS(monmsg1); crlf(); -#if FF_USE_LFN - // no needs because FILINFO structure is changed - Finfo.lfname = Lfname; - Finfo.lfsize = sizeof Lfname; -#endif for (;;) { DEBUG_LINE PUTC('>'); @@ -446,16 +437,7 @@ if (FF_FS_RPATH && Finfo.fname[0] == '.') { continue; } -#if FF_USE_LFN - //fn = *Finfo.lfname ? Finfo.lfname : Finfo.fname; - if (Finfo.altname[0] == 0) { - fn = Finfo.fname; - } else { - fn = Finfo.altname; - } -#else fn = Finfo.fname; -#endif if (Finfo.fattrib & AM_DIR) { AccDirs++; *(path+i) = '/'; @@ -931,13 +913,13 @@ for (;;) { /* 2nd parameter is not given (interactive mode) */ switch (p3) { case DW_LONG: - PRINTF("%08X 0x%08X-", p1, *(DWORD*)p1); + PRINTF("%08X 0x%08X-", (unsigned int)p1, *(unsigned int*)p1); break; case DW_SHORT: - PRINTF("%08X 0x%04X-", p1, *(WORD*)p1); + PRINTF("%08X 0x%04X-", (unsigned int)p1, *(WORD*)p1); break; default: - PRINTF("%08X 0x%02X-", p1, *(BYTE*)p1); + PRINTF("%08X 0x%02X-", (unsigned int)p1, *(BYTE*)p1); } ptr = Linebuf; get_line(ptr, sizeof Linebuf); @@ -1092,22 +1074,22 @@ if (xatoi(&ptr, &p1)) { t.tm_year = (uint8_t)p1 + 100; - pc.printf("Year:%d ",p1); + pc.printf("Year:%ld ",p1); xatoi( &ptr, &p1 ); t.tm_mon = (uint8_t)p1 - 1; - pc.printf("Month:%d ",p1); + pc.printf("Month:%ld ",p1); xatoi( &ptr, &p1 ); t.tm_mday = (uint8_t)p1; - pc.printf("Day:%d ",p1); + pc.printf("Day:%ld ",p1); xatoi( &ptr, &p1 ); t.tm_hour = (uint8_t)p1; - pc.printf("Hour:%d ",p1); + pc.printf("Hour:%ld ",p1); xatoi( &ptr, &p1 ); t.tm_min = (uint8_t)p1; - pc.printf("Min:%d ",p1); + pc.printf("Min:%ld ",p1); xatoi( &ptr, &p1 ); t.tm_sec = (uint8_t)p1; - pc.printf("Sec: %d \r\n",p1); + pc.printf("Sec: %ld \r\n",p1); seconds = mktime(&t); set_time(seconds); } else {