Skip to content

Commit 1d9ecea

Browse files
committed
[fatfs] Make LFN and RT_DFS_ELM_CODE_PAGE >= 900 config working
1 parent bb71431 commit 1d9ecea

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=RT-Thread
2-
version=0.4.2
2+
version=0.4.3
33
author=Bernard Xiong <[email protected]>, onelife <[email protected]>
44
maintainer=onelife <[email protected]>
55
sentence=Real Time Operating System porting for Arduino SAM and SAMD boards

src/components/dfs/filesystems/elmfat/dfs_patch_content.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @author onelife <onelife.real[at]gmail.com>
77
******************************************************************************/
88
#include "include/rtthread.h"
9-
#include "dfs_patch_header.h"
9+
1010

1111
FRESULT f_seekdir(
1212
DIR *dj, /* Pointer to the open directory object */

src/components/dfs/filesystems/elmfat/ffconf.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*---------------------------------------------------------------------------/
22
/ FatFs Functional Configurations
33
/---------------------------------------------------------------------------*/
4+
#include "rtconfig.h" /* RTT config */
5+
46

57
#define FFCONF_DEF 86604 /* Revision ID */
68

@@ -101,7 +103,7 @@
101103
*/
102104

103105

104-
#if RT_DFS_ELM_USE_LFN /* RTT config */
106+
#ifdef RT_DFS_ELM_USE_LFN /* RTT config */
105107
#define FF_USE_LFN RT_DFS_ELM_USE_LFN
106108
#define FF_MAX_LFN RT_DFS_ELM_MAX_LFN
107109
#else
@@ -127,7 +129,7 @@
127129

128130

129131
#ifdef RT_DFS_ELM_LFN_UNICODE /* RTT config */
130-
#define FF_LFN_UNICODE 1
132+
#define FF_LFN_UNICODE 2
131133
#else
132134
#define FF_LFN_UNICODE 0
133135
#endif

src/rtconfig.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,16 @@
140140
// #define RT_USING_DFS_MNTTABLE
141141
#define RT_USING_DFS_ELMFAT
142142
#define DFS_USING_WORKDIR
143+
// #define DFS_FILESYSTEMS_MAX (2) /* Max number of fs */
144+
// #define DFS_FD_MAX (4) /* Max number of open file */
143145
#define RT_DFS_ELM_CODE_PAGE (437)
146+
// #define RT_DFS_ELM_CODE_PAGE 936 /* (936) is wrong -_-! */
147+
// #define RT_DFS_ELM_LFN_UNICODE
144148
// #define RT_DFS_ELM_USE_EXFAT
145-
#ifdef RT_DFS_ELM_USE_EXFAT
149+
#if defined(RT_DFS_ELM_USE_EXFAT) || (RT_DFS_ELM_CODE_PAGE >= 900)
146150
#define RT_DFS_ELM_USE_LFN (2)
147151
#define RT_DFS_ELM_MAX_LFN (255)
148-
#endif /* RT_DFS_ELM_USE_EXFAT */
152+
#endif /* defined(RT_DFS_ELM_USE_EXFAT) || (RT_DFS_ELM_CODE_PAGE >= 900) */
149153
#endif /* CONFIG_USING_SPISD */
150154

151155
/* Other Options */

src/rtt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ void arduino_thread_entry(void *param) {
200200
(void)elm_init();
201201
#endif
202202
if (dfs_mount(SD_NAME, "/", "elm", 0, 0))
203-
rt_kprintf("[ERR] Mount %s failed!\n", SD_NAME);
203+
rt_kprintf("! Mount %s failed!\n", SD_NAME);
204204
else
205-
rt_kprintf("[INFO] Mount %s to \"/\"\n", SD_NAME);
205+
rt_kprintf("+ Mount %s to \"/\"\n", SD_NAME);
206206
#endif
207207

208208
/* run Arduino loop here */

0 commit comments

Comments
 (0)