Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
non-destructive text micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
badge fixer
non-destructive text micropython
Commits
e959f219
Commit
e959f219
authored
Feb 25, 2019
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
extmod/vfs_fat: Update for new oofatfs version.
parent
7eadcaa8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
extmod/vfs_fat.c
+5
-5
5 additions, 5 deletions
extmod/vfs_fat.c
extmod/vfs_fat_diskio.c
+3
-3
3 additions, 3 deletions
extmod/vfs_fat_diskio.c
with
8 additions
and
8 deletions
extmod/vfs_fat.c
+
5
−
5
View file @
e959f219
...
@@ -39,8 +39,8 @@
...
@@ -39,8 +39,8 @@
#include
"extmod/vfs_fat.h"
#include
"extmod/vfs_fat.h"
#include
"lib/timeutils/timeutils.h"
#include
"lib/timeutils/timeutils.h"
#if _MAX_SS == _MIN_SS
#if
FF
_MAX_SS ==
FF
_MIN_SS
#define SECSIZE(fs) (_MIN_SS)
#define SECSIZE(fs) (
FF
_MIN_SS)
#else
#else
#define SECSIZE(fs) ((fs)->ssize)
#define SECSIZE(fs) ((fs)->ssize)
#endif
#endif
...
@@ -111,7 +111,7 @@ STATIC mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) {
...
@@ -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
));
fs_user_mount_t
*
vfs
=
MP_OBJ_TO_PTR
(
fat_vfs_make_new
(
&
mp_fat_vfs_type
,
1
,
0
,
&
bdev_in
));
// make the filesystem
// 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
));
FRESULT
res
=
f_mkfs
(
&
vfs
->
fatfs
,
FM_FAT
|
FM_SFD
,
0
,
working_buf
,
sizeof
(
working_buf
));
if
(
res
!=
FR_OK
)
{
if
(
res
!=
FR_OK
)
{
mp_raise_OSError
(
fresult_to_errno_table
[
res
]);
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) {
...
@@ -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
[
6
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// f_ffree
t
->
items
[
7
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// f_favail
t
->
items
[
7
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// f_favail
t
->
items
[
8
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// f_flags
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
);
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
...
@@ -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
// check if we need to make the filesystem
FRESULT
res
=
(
self
->
flags
&
FSUSER_NO_FILESYSTEM
)
?
FR_NO_FILESYSTEM
:
FR_OK
;
FRESULT
res
=
(
self
->
flags
&
FSUSER_NO_FILESYSTEM
)
?
FR_NO_FILESYSTEM
:
FR_OK
;
if
(
res
==
FR_NO_FILESYSTEM
&&
mp_obj_is_true
(
mkfs
))
{
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
));
res
=
f_mkfs
(
&
self
->
fatfs
,
FM_FAT
|
FM_SFD
,
0
,
working_buf
,
sizeof
(
working_buf
));
}
}
if
(
res
!=
FR_OK
)
{
if
(
res
!=
FR_OK
)
{
...
...
This diff is collapsed.
Click to expand it.
extmod/vfs_fat_diskio.c
+
3
−
3
View file @
e959f219
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
#include
"lib/oofatfs/diskio.h"
#include
"lib/oofatfs/diskio.h"
#include
"extmod/vfs_fat.h"
#include
"extmod/vfs_fat.h"
#if _MAX_SS == _MIN_SS
#if
FF
_MAX_SS ==
FF
_MIN_SS
#define SECSIZE(fs) (_MIN_SS)
#define SECSIZE(fs) (
FF
_MIN_SS)
#else
#else
#define SECSIZE(fs) ((fs)->ssize)
#define SECSIZE(fs) ((fs)->ssize)
#endif
#endif
...
@@ -194,7 +194,7 @@ DRESULT disk_ioctl (
...
@@ -194,7 +194,7 @@ DRESULT disk_ioctl (
}
else
{
}
else
{
*
((
WORD
*
)
buff
)
=
mp_obj_get_int
(
ret
);
*
((
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
// need to store ssize because we use it in disk_read/disk_write
vfs
->
fatfs
.
ssize
=
*
((
WORD
*
)
buff
);
vfs
->
fatfs
.
ssize
=
*
((
WORD
*
)
buff
);
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment