cc3200: Speed up file system checking during start-up.

This commit is contained in:
Daniel Campora 2015-08-09 18:53:49 +02:00
parent aa3569cd57
commit 651c870d77

View File

@ -60,7 +60,7 @@ DRESULT sflash_disk_init (void) {
print_block_name (i); print_block_name (i);
sl_LockObjLock (&wlan_LockObj, SL_OS_WAIT_FOREVER); sl_LockObjLock (&wlan_LockObj, SL_OS_WAIT_FOREVER);
// Create the block file if it doesn't exist // 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)) { if (!sl_FsOpen(sflash_block_name, FS_MODE_OPEN_CREATE(SFLASH_BLOCK_SIZE, 0), NULL, &fileHandle)) {
sl_FsClose(fileHandle, NULL, NULL, 0); sl_FsClose(fileHandle, NULL, NULL, 0);
sl_LockObjUnlock (&wlan_LockObj); sl_LockObjUnlock (&wlan_LockObj);
@ -74,6 +74,10 @@ DRESULT sflash_disk_init (void) {
sl_LockObjUnlock (&wlan_LockObj); sl_LockObjUnlock (&wlan_LockObj);
return RES_ERROR; return RES_ERROR;
} }
} else {
// file system exists, break here to speed up booting
sl_LockObjUnlock (&wlan_LockObj);
break;
} }
sl_LockObjUnlock (&wlan_LockObj); sl_LockObjUnlock (&wlan_LockObj);
} }