File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434
3535#include "py/runtime.h"
3636#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 */
3838#include "rtc.h"
3939#include "storage.h"
4040#include "sdcard.h"
@@ -50,10 +50,6 @@ const PARTITION VolToPart[] = {
5050 */
5151};
5252
53- /* Definitions of physical drive number for each media */
54- #define PD_FLASH (0)
55- #define PD_SDCARD (1)
56- #define PD_USER (2)
5753
5854/*-----------------------------------------------------------------------*/
5955/* Initialize a Drive */
Original file line number Diff line number Diff line change 2828
2929#include "py/mpstate.h"
3030#include "lib/fatfs/ff.h"
31- #include "ffconf.h"
31+ #include "lib/fatfs/ffconf.h"
32+ #include "lib/fatfs/diskio.h"
3233#include "fsusermount.h"
3334
3435STATIC 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) {
6061 }
6162
6263 if (check_path (path , "/flash" , 6 )) {
63- return 0 ;
64+ return PD_FLASH ;
6465 } else if (check_path (path , "/sd" , 3 )) {
65- return 1 ;
66+ return PD_SDCARD ;
6667 } 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 ;
6869 } else {
6970 return -1 ;
7071 }
7172}
7273
7374void ff_get_volname (BYTE vol , TCHAR * * dest ) {
74- if (vol == 0 ) {
75+ if (vol == PD_FLASH ) {
7576 memcpy (* dest , "/flash" , 6 );
7677 * dest += 6 ;
77- } else if (vol == 1 ) {
78+ } else if (vol == PD_SDCARD ) {
7879 memcpy (* dest , "/sd" , 3 );
7980 * dest += 3 ;
8081 } else {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4646#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
4747#define MICROPY_OPT_COMPUTED_GOTO (1)
4848#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+
5758#define MICROPY_STREAMS_NON_BLOCK (1)
5859#define MICROPY_MODULE_WEAK_LINKS (1)
5960#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
You can’t perform that action at this time.
0 commit comments