Issue 157 fixed

[stock] Flash saving (around 100bytes)
This commit is contained in:
bsongis
2012-11-12 21:06:40 +00:00
parent a29c9c724e
commit 1801cc5b53
8 changed files with 75 additions and 54 deletions
+7 -5
View File
@@ -309,10 +309,12 @@ FRESULT f_mount (BYTE, FATFS*)
FRESULT f_open (FIL * fil, const TCHAR *name, BYTE flag)
{
struct stat tmp;
if (stat(name, &tmp))
return FR_INVALID_NAME;
fil->fsize = tmp.st_size;
if (!(flag & FA_WRITE)) {
struct stat tmp;
if (stat(name, &tmp))
return FR_INVALID_NAME;
fil->fsize = tmp.st_size;
}
fil->fs = (FATFS*)fopen(name, (flag & FA_WRITE) ? "w+" : "r+");
return FR_OK;
}
@@ -421,7 +423,7 @@ int f_printf (FIL *f, const TCHAR * format, ...)
FRESULT f_getcwd (TCHAR *path, UINT sz_path)
{
getcwd(path, sz_path);
strcpy(path, ".");
return FR_OK;
}