File tree 4 files changed +17
-317
lines changed 4 files changed +17
-317
lines changed Original file line number Diff line number Diff line change 34
34
35
35
#include "py/runtime.h"
36
36
#include "lib/fatfs/ff.h" /* FatFs lower layer API */
37
- #include "lib/fatfs/diskio.h" /* FatFs lower layer API */
37
+ #include "lib/fatfs/diskio.h" /* FatFs lower layer API */
38
38
#include "rtc.h"
39
39
#include "storage.h"
40
40
#include "sdcard.h"
@@ -50,10 +50,6 @@ const PARTITION VolToPart[] = {
50
50
*/
51
51
};
52
52
53
- /* Definitions of physical drive number for each media */
54
- #define PD_FLASH (0)
55
- #define PD_SDCARD (1)
56
- #define PD_USER (2)
57
53
58
54
/*-----------------------------------------------------------------------*/
59
55
/* Initialize a Drive */
Original file line number Diff line number Diff line change 28
28
29
29
#include "py/mpstate.h"
30
30
#include "lib/fatfs/ff.h"
31
- #include "ffconf.h"
31
+ #include "lib/fatfs/ffconf.h"
32
+ #include "lib/fatfs/diskio.h"
32
33
#include "fsusermount.h"
33
34
34
35
STATIC bool check_path (const TCHAR * * path , const char * mount_point_str , mp_uint_t mount_point_len ) {
@@ -60,21 +61,21 @@ int ff_get_ldnumber (const TCHAR **path) {
60
61
}
61
62
62
63
if (check_path (path , "/flash" , 6 )) {
63
- return 0 ;
64
+ return PD_FLASH ;
64
65
} else if (check_path (path , "/sd" , 3 )) {
65
- return 1 ;
66
+ return PD_SDCARD ;
66
67
} else if (MP_STATE_PORT (fs_user_mount ) != NULL && check_path (path , MP_STATE_PORT (fs_user_mount )-> str , MP_STATE_PORT (fs_user_mount )-> len )) {
67
- return 2 ;
68
+ return PD_USER ;
68
69
} else {
69
70
return -1 ;
70
71
}
71
72
}
72
73
73
74
void ff_get_volname (BYTE vol , TCHAR * * dest ) {
74
- if (vol == 0 ) {
75
+ if (vol == PD_FLASH ) {
75
76
memcpy (* dest , "/flash" , 6 );
76
77
* dest += 6 ;
77
- } else if (vol == 1 ) {
78
+ } else if (vol == PD_SDCARD ) {
78
79
memcpy (* dest , "/sd" , 3 );
79
80
* dest += 3 ;
80
81
} else {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 46
46
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
47
47
#define MICROPY_OPT_COMPUTED_GOTO (1)
48
48
#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
49
- /* Enable FatFS LFNs
50
- 0: Disable LFN feature.
51
- 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
52
- 2: Enable LFN with dynamic working buffer on the STACK.
53
- 3: Enable LFN with dynamic working buffer on the HEAP.
54
- */
55
- #define MICROPY_ENABLE_LFN (1)
56
- #define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
49
+
50
+ // fatfs configuration used in ffconf.h
51
+ #define MICROPY_FATFS_ENABLE_LFN (1)
52
+ #define MICROPY_FATFS_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
53
+ #define MICROPY_FATFS_USE_LABEL (1)
54
+ #define MICROPY_FATFS_RPATH (2)
55
+ #define MICROPY_FATFS_VOLUMES (3)
56
+ #define MICROPY_FATFS_MULTI_PARTITION (1)
57
+
57
58
#define MICROPY_STREAMS_NON_BLOCK (1)
58
59
#define MICROPY_MODULE_WEAK_LINKS (1)
59
60
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
You can’t perform that action at this time.
0 commit comments