From 84d09d8fb956d311a14800e73c644945df0b2ccc Mon Sep 17 00:00:00 2001 From: schneider Date: Sun, 17 Jul 2011 21:02:37 +0200 Subject: [PATCH] default: we only have one file open --- firmware/applications/default.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/firmware/applications/default.c b/firmware/applications/default.c index 6aa970d..4da267b 100644 --- a/firmware/applications/default.c +++ b/firmware/applications/default.c @@ -11,7 +11,7 @@ FATFS FatFs[_VOLUMES]; /* File system object for logical drive */ #define CONFIGLEN 2 int lcdInitConfig(){ - FIL file[2]; /* File objects */ + FIL file; /* File objects */ BYTE buf[CONFIGLEN]; UINT readbytes; int res; @@ -24,13 +24,13 @@ int lcdInitConfig(){ return 1; }; - res=f_open(&file[0], "r0ket.cfg", FA_OPEN_EXISTING|FA_READ); + res=f_open(&file, "r0ket.cfg", FA_OPEN_EXISTING|FA_READ); lcdPrint("open:"); lcdPrintln(f_get_rc_string(res)); if(res){ lcdPrintln("new r0ket.cfg..."); - res=f_open(&file[0], "r0ket.cfg", FA_OPEN_ALWAYS|FA_WRITE); + res=f_open(&file, "r0ket.cfg", FA_OPEN_ALWAYS|FA_WRITE); lcdPrint("create:"); lcdPrintln(f_get_rc_string(res)); if(res){ @@ -39,7 +39,7 @@ int lcdInitConfig(){ buf[0]='0'; buf[1]='0'; - res = f_write(&file[0], buf, 2, &readbytes); + res = f_write(&file, buf, 2, &readbytes); lcdPrint("write:"); lcdPrintln(f_get_rc_string(res)); if(res){ @@ -50,7 +50,7 @@ int lcdInitConfig(){ lcdPrintInt(readbytes); lcdPrintln("b"); - res=f_close(&file[0]); + res=f_close(&file); lcdPrint("close:"); lcdPrintln(f_get_rc_string(res)); if(res){ @@ -62,7 +62,7 @@ int lcdInitConfig(){ for(int i=0;i