Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
67fff44f
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67fff44f
编写于
10月 25, 2017
作者:
B
bernard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[DFS] Fix the UFFS compiling issue.
上级
5bc69033
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
535 addition
and
488 deletion
+535
-488
components/dfs/KConfig
components/dfs/KConfig
+27
-0
components/dfs/filesystems/uffs/dfs_uffs.c
components/dfs/filesystems/uffs/dfs_uffs.c
+487
-488
components/dfs/filesystems/uffs/dfs_uffs.h
components/dfs/filesystems/uffs/dfs_uffs.h
+21
-0
未找到文件。
components/dfs/KConfig
浏览文件 @
67fff44f
...
@@ -109,6 +109,33 @@ if RT_USING_DFS
...
@@ -109,6 +109,33 @@ if RT_USING_DFS
select RT_USING_MTD_NAND
select RT_USING_MTD_NAND
default n
default n
if RT_USING_DFS_UFFS
choice
prompt "UFFS ECC mode"
default RT_UFFS_ECC_MODE_1
config RT_UFFS_ECC_MODE_0
bool "0: Do not use ECC"
config RT_UFFS_ECC_MODE_1
bool "1: UFFS calculate the ECC"
config RT_UFFS_ECC_MODE_2
bool "2: Flash driver(or by hardware) calculate the ECC"
config RT_UFFS_ECC_MODE_3
bool "3: Hardware calculate the ECC and automatically write to spare."
endchoice
config RT_UFFS_ECC_MODE
int
default 0 if RT_UFFS_ECC_MODE_0
default 1 if RT_UFFS_ECC_MODE_1
default 2 if RT_UFFS_ECC_MODE_2
default 3 if RT_UFFS_ECC_MODE_3
endif
config RT_USING_DFS_NFS
config RT_USING_DFS_NFS
bool "Using NFS v3 client file system"
bool "Using NFS v3 client file system"
depends on RT_USING_LWIP
depends on RT_USING_LWIP
...
...
components/dfs/filesystems/uffs/dfs_uffs.c
浏览文件 @
67fff44f
...
@@ -28,8 +28,9 @@
...
@@ -28,8 +28,9 @@
#include <rtthread.h>
#include <rtthread.h>
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_
def
.h>
#include <dfs_
file
.h>
#include <rtdevice.h>
#include <rtdevice.h>
#include "dfs_uffs.h"
#include "dfs_uffs.h"
#include "uffs/uffs_fd.h"
/* posix file api is here */
#include "uffs/uffs_fd.h"
/* posix file api is here */
...
@@ -213,7 +214,7 @@ static int dfs_uffs_unmount(struct dfs_filesystem* fs)
...
@@ -213,7 +214,7 @@ static int dfs_uffs_unmount(struct dfs_filesystem* fs)
break
;
break
;
result
=
uffs_UnRegisterMountTable
(
&
nand_part
[
index
].
mount_table
);
result
=
uffs_UnRegisterMountTable
(
&
nand_part
[
index
].
mount_table
);
return
(
result
==
U_SUCC
)
?
DFS_STATUS_
OK
:
-
1
;
return
(
result
==
U_SUCC
)
?
RT_E
OK
:
-
1
;
}
}
}
}
return
-
ENOENT
;
return
-
ENOENT
;
...
@@ -259,7 +260,7 @@ static int dfs_uffs_mkfs(rt_device_t dev_id)
...
@@ -259,7 +260,7 @@ static int dfs_uffs_mkfs(rt_device_t dev_id)
{
{
return
uffs_result_to_dfs
(
uffs_get_error
());
return
uffs_result_to_dfs
(
uffs_get_error
());
}
}
return
DFS_STATUS_
OK
;
return
RT_E
OK
;
}
}
static
int
dfs_uffs_statfs
(
struct
dfs_filesystem
*
fs
,
static
int
dfs_uffs_statfs
(
struct
dfs_filesystem
*
fs
,
...
@@ -325,7 +326,7 @@ static int dfs_uffs_open(struct dfs_fd* file)
...
@@ -325,7 +326,7 @@ static int dfs_uffs_open(struct dfs_fd* file)
/* save this pointer,will used by dfs_uffs_getdents*/
/* save this pointer,will used by dfs_uffs_getdents*/
file
->
data
=
dir
;
file
->
data
=
dir
;
rt_free
(
file_path
);
rt_free
(
file_path
);
return
DFS_STATUS_
OK
;
return
RT_E
OK
;
}
}
/* regular file operations */
/* regular file operations */
/* int uffs_open(const char *name, int oflag, ...); what is this?
/* int uffs_open(const char *name, int oflag, ...); what is this?
...
@@ -390,7 +391,7 @@ static int dfs_uffs_ioctl(struct dfs_fd * file, int cmd, void* args)
...
@@ -390,7 +391,7 @@ static int dfs_uffs_ioctl(struct dfs_fd * file, int cmd, void* args)
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
static
int
dfs_uffs_read
(
struct
dfs_fd
*
file
,
void
*
buf
,
rt_
size_t
len
)
static
int
dfs_uffs_read
(
struct
dfs_fd
*
file
,
void
*
buf
,
size_t
len
)
{
{
int
fd
;
int
fd
;
int
char_read
;
int
char_read
;
...
@@ -407,7 +408,7 @@ static int dfs_uffs_read(struct dfs_fd * file, void* buf, rt_size_t len)
...
@@ -407,7 +408,7 @@ static int dfs_uffs_read(struct dfs_fd * file, void* buf, rt_size_t len)
static
int
dfs_uffs_write
(
struct
dfs_fd
*
file
,
static
int
dfs_uffs_write
(
struct
dfs_fd
*
file
,
const
void
*
buf
,
const
void
*
buf
,
rt_
size_t
len
)
size_t
len
)
{
{
int
fd
;
int
fd
;
int
char_write
;
int
char_write
;
...
@@ -524,16 +525,16 @@ static int dfs_uffs_getdents(
...
@@ -524,16 +525,16 @@ static int dfs_uffs_getdents(
switch
(
s
.
st_mode
&
US_IFMT
)
/* file type mark */
switch
(
s
.
st_mode
&
US_IFMT
)
/* file type mark */
{
{
case
US_IFREG
:
/* directory */
case
US_IFREG
:
/* directory */
d
->
d_type
=
DFS_
DT_REG
;
d
->
d_type
=
DT_REG
;
break
;
break
;
case
US_IFDIR
:
/* regular file */
case
US_IFDIR
:
/* regular file */
d
->
d_type
=
DFS_
DT_DIR
;
d
->
d_type
=
DT_DIR
;
break
;
break
;
case
US_IFLNK
:
/* symbolic link */
case
US_IFLNK
:
/* symbolic link */
case
US_IREAD
:
/* read permission */
case
US_IREAD
:
/* read permission */
case
US_IWRITE
:
/* write permission */
case
US_IWRITE
:
/* write permission */
default:
default:
d
->
d_type
=
DFS_
DT_UNKNOWN
;
d
->
d_type
=
DT_UNKNOWN
;
break
;
break
;
}
}
...
@@ -605,7 +606,6 @@ static int dfs_uffs_stat(struct dfs_filesystem* fs, const char *path, struct sta
...
@@ -605,7 +606,6 @@ static int dfs_uffs_stat(struct dfs_filesystem* fs, const char *path, struct sta
{
{
int
result
;
int
result
;
struct
uffs_stat
s
;
struct
uffs_stat
s
;
struct
rt_mtd_nand_device
*
mtd
;
result
=
uffs_stat
(
path
,
&
s
);
result
=
uffs_stat
(
path
,
&
s
);
if
(
result
<
0
)
if
(
result
<
0
)
...
@@ -618,8 +618,6 @@ static int dfs_uffs_stat(struct dfs_filesystem* fs, const char *path, struct sta
...
@@ -618,8 +618,6 @@ static int dfs_uffs_stat(struct dfs_filesystem* fs, const char *path, struct sta
st
->
st_size
=
s
.
st_size
;
st
->
st_size
=
s
.
st_size
;
st
->
st_mtime
=
s
.
st_mtime
;
st
->
st_mtime
=
s
.
st_mtime
;
mtd
=
RT_MTD_NAND_DEVICE
(
fs
->
dev_id
);
return
0
;
return
0
;
}
}
...
@@ -671,3 +669,4 @@ int dfs_uffs_init(void)
...
@@ -671,3 +669,4 @@ int dfs_uffs_init(void)
return
-
RT_ERROR
;
return
-
RT_ERROR
;
}
}
INIT_FS_EXPORT
(
dfs_uffs_init
);
INIT_FS_EXPORT
(
dfs_uffs_init
);
components/dfs/filesystems/uffs/dfs_uffs.h
浏览文件 @
67fff44f
...
@@ -29,6 +29,27 @@
...
@@ -29,6 +29,27 @@
#include "uffs/uffs_public.h"
#include "uffs/uffs_public.h"
/* the UFFS ECC mode opitons */
/* the UFFS ECC mode opitons */
#ifndef RT_UFFS_ECC_MODE
#define RT_UFFS_ECC_MODE 1
#endif
/*
* RT_UFFS_ECC_MODE:
* 0, Do not use ECC
* 1, UFFS calculate the ECC
* 2, Flash driver(or by hardware) calculate the ECC
* 3, Hardware calculate the ECC and automatically write to spare.
*/
#if RT_UFFS_ECC_MODE == 0
#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_NONE
#elif RT_UFFS_ECC_MODE == 1
#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_SOFT
#elif RT_UFFS_ECC_MODE == 2
#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW
#elif RT_UFFS_ECC_MODE == 3
#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO
#endif
/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO */
/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO */
/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_SOFT */
/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_SOFT */
/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_NONE */
/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_NONE */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录