From 369df25cd377341e5e9323ab926ed5060c5ecd09 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 19 May 2022 15:17:54 +0300 Subject: [PATCH] nyx: fatfs: add failsafes for wrong mkfs usage --- nyx/nyx_gui/libs/fatfs/diskio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nyx/nyx_gui/libs/fatfs/diskio.c b/nyx/nyx_gui/libs/fatfs/diskio.c index f453dbe..c877800 100644 --- a/nyx/nyx_gui/libs/fatfs/diskio.c +++ b/nyx/nyx_gui/libs/fatfs/diskio.c @@ -138,6 +138,18 @@ DRESULT disk_ioctl ( break; } } + else // Catch all for unknown devices. + { + switch (cmd) + { + case CTRL_SYNC: + break; + case GET_SECTOR_COUNT: + case GET_BLOCK_SIZE: + *buf = 0; // Zero value to force default or abort. + break; + } + } return RES_OK; }