mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Formatting FATFS filesystems works, more or less.
This commit is contained in:
@@ -36,6 +36,20 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void create(bool quick, const std::string& volumeName)
|
||||
{
|
||||
if (!quick)
|
||||
eraseEverythingOnDisk();
|
||||
|
||||
char buffer[FF_MAX_SS * 2];
|
||||
currentFatFs = this;
|
||||
FRESULT res = f_mkfs("", nullptr, buffer, sizeof(buffer));
|
||||
throwError(res);
|
||||
|
||||
mount();
|
||||
f_setlabel(volumeName.c_str());
|
||||
}
|
||||
|
||||
FilesystemStatus check()
|
||||
{
|
||||
return FS_OK;
|
||||
@@ -162,9 +176,14 @@ public:
|
||||
case GET_SECTOR_SIZE:
|
||||
*(DWORD*)buffer = getLogicalSectorSize();
|
||||
break;
|
||||
|
||||
case GET_SECTOR_COUNT:
|
||||
*(DWORD*)buffer = getLogicalSectorCount();
|
||||
break;
|
||||
|
||||
case CTRL_SYNC:
|
||||
break;
|
||||
|
||||
default:
|
||||
return RES_PARERR;
|
||||
}
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
|
||||
static FlagGroup flags({&fileFlags});
|
||||
|
||||
static StringFlag volumeName({"-n", "--name"}, "volume name", "FEDISK");
|
||||
static BoolFlag quick({"-q", "--quick"},
|
||||
"perform quick format (requires the disk to be previously formatted)",
|
||||
false);
|
||||
static StringFlag volumeName({"-n", "--name"}, "volume name", "FluxEngine");
|
||||
static SettableFlag quick({"-q", "--quick"},
|
||||
"perform quick format (requires the disk to be previously formatted)");
|
||||
|
||||
int mainFormat(int argc, const char* argv[])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user