Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
circuitpython
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
circuitpython
Commits
e959f219
Commit
e959f219
authored
Feb 25, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extmod/vfs_fat: Update for new oofatfs version.
parent
7eadcaa8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
extmod/vfs_fat.c
extmod/vfs_fat.c
+5
-5
extmod/vfs_fat_diskio.c
extmod/vfs_fat_diskio.c
+3
-3
No files found.
extmod/vfs_fat.c
View file @
e959f219
...
...
@@ -39,8 +39,8 @@
#include "extmod/vfs_fat.h"
#include "lib/timeutils/timeutils.h"
#if
_MAX_SS ==
_MIN_SS
#define SECSIZE(fs) (_MIN_SS)
#if
FF_MAX_SS == FF
_MIN_SS
#define SECSIZE(fs) (
FF
_MIN_SS)
#else
#define SECSIZE(fs) ((fs)->ssize)
#endif
...
...
@@ -111,7 +111,7 @@ STATIC mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) {
fs_user_mount_t
*
vfs
=
MP_OBJ_TO_PTR
(
fat_vfs_make_new
(
&
mp_fat_vfs_type
,
1
,
0
,
&
bdev_in
));
// make the filesystem
uint8_t
working_buf
[
_MAX_SS
];
uint8_t
working_buf
[
FF
_MAX_SS
];
FRESULT
res
=
f_mkfs
(
&
vfs
->
fatfs
,
FM_FAT
|
FM_SFD
,
0
,
working_buf
,
sizeof
(
working_buf
));
if
(
res
!=
FR_OK
)
{
mp_raise_OSError
(
fresult_to_errno_table
[
res
]);
...
...
@@ -363,7 +363,7 @@ STATIC mp_obj_t fat_vfs_statvfs(mp_obj_t vfs_in, mp_obj_t path_in) {
t
->
items
[
6
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// f_ffree
t
->
items
[
7
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// f_favail
t
->
items
[
8
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// f_flags
t
->
items
[
9
]
=
MP_OBJ_NEW_SMALL_INT
(
_MAX_LFN
);
// f_namemax
t
->
items
[
9
]
=
MP_OBJ_NEW_SMALL_INT
(
FF
_MAX_LFN
);
// f_namemax
return
MP_OBJ_FROM_PTR
(
t
);
}
...
...
@@ -383,7 +383,7 @@ STATIC mp_obj_t vfs_fat_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t mkfs
// check if we need to make the filesystem
FRESULT
res
=
(
self
->
flags
&
FSUSER_NO_FILESYSTEM
)
?
FR_NO_FILESYSTEM
:
FR_OK
;
if
(
res
==
FR_NO_FILESYSTEM
&&
mp_obj_is_true
(
mkfs
))
{
uint8_t
working_buf
[
_MAX_SS
];
uint8_t
working_buf
[
FF
_MAX_SS
];
res
=
f_mkfs
(
&
self
->
fatfs
,
FM_FAT
|
FM_SFD
,
0
,
working_buf
,
sizeof
(
working_buf
));
}
if
(
res
!=
FR_OK
)
{
...
...
extmod/vfs_fat_diskio.c
View file @
e959f219
...
...
@@ -42,8 +42,8 @@
#include "lib/oofatfs/diskio.h"
#include "extmod/vfs_fat.h"
#if
_MAX_SS ==
_MIN_SS
#define SECSIZE(fs) (_MIN_SS)
#if
FF_MAX_SS == FF
_MIN_SS
#define SECSIZE(fs) (
FF
_MIN_SS)
#else
#define SECSIZE(fs) ((fs)->ssize)
#endif
...
...
@@ -194,7 +194,7 @@ DRESULT disk_ioctl (
}
else
{
*
((
WORD
*
)
buff
)
=
mp_obj_get_int
(
ret
);
}
#if
_MAX_SS !=
_MIN_SS
#if
FF_MAX_SS != FF
_MIN_SS
// need to store ssize because we use it in disk_read/disk_write
vfs
->
fatfs
.
ssize
=
*
((
WORD
*
)
buff
);
#endif
...
...
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