From 651c870d77fdb34b50d74a4388bdc364d3b7a42e Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Sun, 9 Aug 2015 18:53:49 +0200 Subject: [PATCH] cc3200: Speed up file system checking during start-up. --- cc3200/fatfs/src/drivers/sflash_diskio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc3200/fatfs/src/drivers/sflash_diskio.c b/cc3200/fatfs/src/drivers/sflash_diskio.c index 5acfa50ac2..bc982d6e81 100644 --- a/cc3200/fatfs/src/drivers/sflash_diskio.c +++ b/cc3200/fatfs/src/drivers/sflash_diskio.c @@ -60,7 +60,7 @@ DRESULT sflash_disk_init (void) { print_block_name (i); sl_LockObjLock (&wlan_LockObj, SL_OS_WAIT_FOREVER); // Create the block file if it doesn't exist - if (sl_FsGetInfo(sflash_block_name, 0, &FsFileInfo) < 0) { + if (sl_FsGetInfo(sflash_block_name, 0, &FsFileInfo) != 0) { if (!sl_FsOpen(sflash_block_name, FS_MODE_OPEN_CREATE(SFLASH_BLOCK_SIZE, 0), NULL, &fileHandle)) { sl_FsClose(fileHandle, NULL, NULL, 0); sl_LockObjUnlock (&wlan_LockObj); @@ -74,6 +74,10 @@ DRESULT sflash_disk_init (void) { sl_LockObjUnlock (&wlan_LockObj); return RES_ERROR; } + } else { + // file system exists, break here to speed up booting + sl_LockObjUnlock (&wlan_LockObj); + break; } sl_LockObjUnlock (&wlan_LockObj); }