format fs when filesystem is broken

This commit is contained in:
schneider 2011-12-17 22:25:21 +01:00
parent 64d08e8e74
commit 859f2d9591
1 changed files with 16 additions and 0 deletions

View File

@ -21,7 +21,23 @@ const char* f_get_rc_string (FRESULT rc) {
void fsInit(){
FRESULT i;
DIR dir; /* Directory object */
f_mount(0, &FatFs);
i = f_opendir(&dir, "0:");
if( i == FR_NO_FILESYSTEM ){
lcdPrintln("Could not mount");
lcdPrintln("filesystem.");
lcdPrintln("Formating...");
lcdRefresh();
format_formatDF();
lcdPrintln("done");
lcdPrintln("Please reboot");
lcdRefresh();
while(1);
}
};
void fsReInit(){