SD library: Fix format (#9034)

Pass correct work buffer size to f_mkfs
This commit is contained in:
Michael 2023-12-28 23:46:47 +11:00 committed by GitHub
parent 4d469c8f86
commit b2e7338a5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -818,7 +818,7 @@ bool sdcard_mount(uint8_t pdrv, const char* path, uint8_t max_files, bool format
}
//FRESULT f_mkfs (const TCHAR* path, const MKFS_PARM* opt, void* work, UINT len);
const MKFS_PARM opt = {(BYTE)FM_ANY, 0, 0, 0, 0};
res = f_mkfs(drv, &opt, work, sizeof(work));
res = f_mkfs(drv, &opt, work, sizeof(BYTE) * FF_MAX_SS);
free(work);
if (res != FR_OK) {
log_e("f_mkfs failed: %s", fferr2str[res]);