mkfat: only use 8k sectors over 16 MB, not 16 kB

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-06-09 15:51:59 +08:00
parent f68f8215b7
commit 66136b70b8

View File

@ -13,7 +13,7 @@ int fat12_mkfs(int fd, uint32_t bytes) {
uint8_t mbr[512]; uint8_t mbr[512];
const uint32_t sector_size = 512; const uint32_t sector_size = 512;
uint32_t cluster_size = 4096 / sector_size; // 4 kiB cluster sizes match flash erase block size uint32_t cluster_size = 4096 / sector_size; // 4 kiB cluster sizes match flash erase block size
if (bytes > 16000) { if (bytes > 16000000) {
// We run out of clusters just below 16 megabytes. Use bigger cluseters. // We run out of clusters just below 16 megabytes. Use bigger cluseters.
cluster_size = 8192 / sector_size; cluster_size = 8192 / sector_size;
} }