From 66136b70b814ac6e7f3023283d217de8647faf83 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sun, 9 Jun 2019 15:51:59 +0800 Subject: [PATCH] mkfat: only use 8k sectors over 16 MB, not 16 kB Signed-off-by: Sean Cross --- src/mkfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mkfat.c b/src/mkfat.c index 3605620..0fe12aa 100644 --- a/src/mkfat.c +++ b/src/mkfat.c @@ -13,7 +13,7 @@ int fat12_mkfs(int fd, uint32_t bytes) { uint8_t mbr[512]; const uint32_t sector_size = 512; 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. cluster_size = 8192 / sector_size; }