Skip to content

Commit 651c870

Browse files
author
Daniel Campora
committed
cc3200: Speed up file system checking during start-up.
1 parent aa3569c commit 651c870

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cc3200/fatfs/src/drivers/sflash_diskio.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ DRESULT sflash_disk_init (void) {
6060
print_block_name (i);
6161
sl_LockObjLock (&wlan_LockObj, SL_OS_WAIT_FOREVER);
6262
// Create the block file if it doesn't exist
63-
if (sl_FsGetInfo(sflash_block_name, 0, &FsFileInfo) < 0) {
63+
if (sl_FsGetInfo(sflash_block_name, 0, &FsFileInfo) != 0) {
6464
if (!sl_FsOpen(sflash_block_name, FS_MODE_OPEN_CREATE(SFLASH_BLOCK_SIZE, 0), NULL, &fileHandle)) {
6565
sl_FsClose(fileHandle, NULL, NULL, 0);
6666
sl_LockObjUnlock (&wlan_LockObj);
@@ -74,6 +74,10 @@ DRESULT sflash_disk_init (void) {
7474
sl_LockObjUnlock (&wlan_LockObj);
7575
return RES_ERROR;
7676
}
77+
} else {
78+
// file system exists, break here to speed up booting
79+
sl_LockObjUnlock (&wlan_LockObj);
80+
break;
7781
}
7882
sl_LockObjUnlock (&wlan_LockObj);
7983
}

0 commit comments

Comments
 (0)