impoved initial code

This commit is contained in:
schneider 2011-08-06 07:15:13 +02:00
parent 162cc4336b
commit 707faf0266
1 changed files with 28 additions and 6 deletions

View File

@ -79,12 +79,34 @@ void mount(void)
void format(void) void format(void)
{ {
int res; int res;
delayms(500); FIL file;
lcdPrintln("Format DF:"); uint8_t ok = 0;
res=f_mount(0, &FatFs); uint8_t count = 0;
res=f_mkfs(0,1,0); while(!ok){
lcdPrintln(f_get_rc_string(res)); delayms(500);
lcdRefresh(); lcdPrintln("Format DF:");
res=f_mount(0, &FatFs);
res=f_mkfs(0,1,0);
lcdPrintln(f_get_rc_string(res));
lcdRefresh();
lcdPrintln("open file:");
res=f_open(&file, "test.cfg", FA_CREATE_ALWAYS|FA_WRITE);
lcdPrintln(f_get_rc_string(res));
lcdRefresh();
count++;
if( res ){
if( count >= 10 ){
while(1){
delayms(50);
gpioSetValue (RB_LED3, 0);
delayms(50);
gpioSetValue (RB_LED3, 1);
}
}
}else{
ok = 1;
}
}
} }
int check(void) int check(void)