Fix SDcard size and format issue (#5004)

* - fix overflow in SDcard size computation
- fix format function
- implement more informative format error handling

* Move to a function
This commit is contained in:
3djc
2017-06-14 23:33:31 +02:00
committed by Bertrand Songis
parent 547606b44e
commit 656daa75fa
4 changed files with 38 additions and 14 deletions
+1 -5
View File
@@ -151,14 +151,10 @@ bool menuRadioSdManager(event_t _event)
showMessageBox(STR_FORMATTING);
logsClose();
audioQueue.stopSD();
BYTE work[_MAX_SS];
if (f_mkfs(0, FM_FAT32, 0, work, sizeof(work)) == FR_OK) {
if(sdCardFormat()) {
f_chdir("/");
REFRESH_FILES();
}
else {
POPUP_WARNING(STR_SDCARD_ERROR);
}
}
event_t event = (EVT_KEY_MASK(_event) == KEY_ENTER ? 0 : _event);