Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
1d399c3c
Commit
1d399c3c
authored
Sep 07, 2015
by
Daniel Campora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cc3200: Improve file system check routine.
parent
4d7fa05b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
cc3200/fatfs/src/drivers/sflash_diskio.c
cc3200/fatfs/src/drivers/sflash_diskio.c
+13
-7
No files found.
cc3200/fatfs/src/drivers/sflash_diskio.c
View file @
1d399c3c
...
...
@@ -54,8 +54,20 @@ DRESULT sflash_disk_init (void) {
// Allocate space for the block cache
ASSERT
((
sflash_block_cache
=
mem_Malloc
(
SFLASH_BLOCK_SIZE
))
!=
NULL
);
sflash_init_done
=
true
;
sflash_prblock
=
UINT32_MAX
;
sflash_cache_is_dirty
=
false
;
// Proceed to format the memory if not done yet
// In order too speed up booting, check the last block, if exists, then
// it means that the file system has been already created
print_block_name
(
SFLASH_BLOCK_COUNT
-
1
);
sl_LockObjLock
(
&
wlan_LockObj
,
SL_OS_WAIT_FOREVER
);
if
(
!
sl_FsGetInfo
(
sflash_block_name
,
0
,
&
FsFileInfo
))
{
sl_LockObjUnlock
(
&
wlan_LockObj
);
return
RES_OK
;
}
sl_LockObjUnlock
(
&
wlan_LockObj
);
// Proceed to format the memory
for
(
int
i
=
0
;
i
<
SFLASH_BLOCK_COUNT
;
i
++
)
{
print_block_name
(
i
);
sl_LockObjLock
(
&
wlan_LockObj
,
SL_OS_WAIT_FOREVER
);
...
...
@@ -74,15 +86,9 @@ 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
);
}
sflash_prblock
=
UINT32_MAX
;
sflash_cache_is_dirty
=
false
;
}
return
RES_OK
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment