Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
8803bf40
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
8803bf40
编写于
1月 26, 2022
作者:
W
Wayne Lin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update RT_USING_DFS options and sync new USB host API.
上级
64819980
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
92 addition
and
134 deletion
+92
-134
bsp/nuvoton/libraries/m2354/rtt_port/Kconfig
bsp/nuvoton/libraries/m2354/rtt_port/Kconfig
+1
-0
bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c
bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c
+24
-23
bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c
bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c
+1
-1
bsp/nuvoton/libraries/m480/rtt_port/Kconfig
bsp/nuvoton/libraries/m480/rtt_port/Kconfig
+1
-0
bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c
bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c
+6
-17
bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c
bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c
+1
-1
bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig
bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig
+1
-0
bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c
bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c
+6
-18
bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c
bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c
+4
-4
bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig
bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig
+1
-0
bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c
bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c
+6
-18
bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c
bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c
+4
-4
bsp/nuvoton/nk-980iot/applications/mnt.c
bsp/nuvoton/nk-980iot/applications/mnt.c
+6
-8
bsp/nuvoton/nk-n9h30/applications/mnt.c
bsp/nuvoton/nk-n9h30/applications/mnt.c
+6
-8
bsp/nuvoton/nk-rtu980/applications/mnt.c
bsp/nuvoton/nk-rtu980/applications/mnt.c
+6
-8
bsp/nuvoton/numaker-iot-m487/applications/mnt.c
bsp/nuvoton/numaker-iot-m487/applications/mnt.c
+6
-8
bsp/nuvoton/numaker-m032ki/applications/mnt.c
bsp/nuvoton/numaker-m032ki/applications/mnt.c
+6
-8
bsp/nuvoton/numaker-pfm-m487/applications/mnt.c
bsp/nuvoton/numaker-pfm-m487/applications/mnt.c
+6
-8
未找到文件。
bsp/nuvoton/libraries/m2354/rtt_port/Kconfig
浏览文件 @
8803bf40
...
@@ -470,6 +470,7 @@ config SOC_SERIES_M2354
...
@@ -470,6 +470,7 @@ config SOC_SERIES_M2354
menuconfig BSP_USING_SDH
menuconfig BSP_USING_SDH
bool "Enable Secure Digital Host Controller(SDH)"
bool "Enable Secure Digital Host Controller(SDH)"
select RT_USING_DFS
select RT_USING_DFS
select DFS_USING_POSIX
if BSP_USING_SDH
if BSP_USING_SDH
config BSP_USING_SDH0
config BSP_USING_SDH0
...
...
bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c
浏览文件 @
8803bf40
...
@@ -19,14 +19,12 @@
...
@@ -19,14 +19,12 @@
#include <drv_pdma.h>
#include <drv_pdma.h>
#include <string.h>
#include <string.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
/* Private define ---------------------------------------------------------------*/
/* Private define ---------------------------------------------------------------*/
...
@@ -236,11 +234,13 @@ static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz
...
@@ -236,11 +234,13 @@ static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz
{
{
rt_uint32_t
ret
=
0
;
rt_uint32_t
ret
=
0
;
nu_sdh_t
sdh
=
(
nu_sdh_t
)
dev
;
nu_sdh_t
sdh
=
(
nu_sdh_t
)
dev
;
rt_err_t
result
;
RT_ASSERT
(
dev
!=
RT_NULL
);
RT_ASSERT
(
dev
!=
RT_NULL
);
RT_ASSERT
(
buffer
!=
RT_NULL
);
RT_ASSERT
(
buffer
!=
RT_NULL
);
rt_sem_take
(
&
sdh
->
lock
,
RT_WAITING_FOREVER
);
result
=
rt_sem_take
(
&
sdh
->
lock
,
RT_WAITING_FOREVER
);
RT_ASSERT
(
result
==
RT_EOK
);
/* Check alignment. */
/* Check alignment. */
if
(((
uint32_t
)
buffer
&
0x03
)
!=
0
)
if
(((
uint32_t
)
buffer
&
0x03
)
!=
0
)
...
@@ -281,7 +281,8 @@ exit_nu_sdh_read:
...
@@ -281,7 +281,8 @@ exit_nu_sdh_read:
sdh
->
pbuf
=
RT_NULL
;
sdh
->
pbuf
=
RT_NULL
;
}
}
rt_sem_release
(
&
sdh
->
lock
);
result
=
rt_sem_release
(
&
sdh
->
lock
);
RT_ASSERT
(
result
==
RT_EOK
);
if
(
ret
==
Successful
)
if
(
ret
==
Successful
)
return
blk_nb
;
return
blk_nb
;
...
@@ -295,11 +296,13 @@ static rt_size_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer,
...
@@ -295,11 +296,13 @@ static rt_size_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer,
{
{
rt_uint32_t
ret
=
0
;
rt_uint32_t
ret
=
0
;
nu_sdh_t
sdh
=
(
nu_sdh_t
)
dev
;
nu_sdh_t
sdh
=
(
nu_sdh_t
)
dev
;
rt_err_t
result
;
RT_ASSERT
(
dev
!=
RT_NULL
);
RT_ASSERT
(
dev
!=
RT_NULL
);
RT_ASSERT
(
buffer
!=
RT_NULL
);
RT_ASSERT
(
buffer
!=
RT_NULL
);
rt_sem_take
(
&
sdh
->
lock
,
RT_WAITING_FOREVER
);
result
=
rt_sem_take
(
&
sdh
->
lock
,
RT_WAITING_FOREVER
);
RT_ASSERT
(
result
==
RT_EOK
);
/* Check alignment. */
/* Check alignment. */
if
(((
uint32_t
)
buffer
&
0x03
)
!=
0
)
if
(((
uint32_t
)
buffer
&
0x03
)
!=
0
)
...
@@ -338,7 +341,8 @@ exit_nu_sdh_write:
...
@@ -338,7 +341,8 @@ exit_nu_sdh_write:
sdh
->
pbuf
=
RT_NULL
;
sdh
->
pbuf
=
RT_NULL
;
}
}
rt_sem_release
(
&
sdh
->
lock
);
result
=
rt_sem_release
(
&
sdh
->
lock
);
RT_ASSERT
(
result
==
RT_EOK
);
if
(
ret
==
Successful
)
return
blk_nb
;
if
(
ret
==
Successful
)
return
blk_nb
;
...
@@ -393,7 +397,8 @@ static int rt_hw_sdh_init(void)
...
@@ -393,7 +397,8 @@ static int rt_hw_sdh_init(void)
/* Private */
/* Private */
nu_sdh_arr
[
i
].
dev
.
user_data
=
(
void
*
)
&
nu_sdh_arr
[
i
];
nu_sdh_arr
[
i
].
dev
.
user_data
=
(
void
*
)
&
nu_sdh_arr
[
i
];
rt_sem_init
(
&
nu_sdh_arr
[
i
].
lock
,
"sdhlock"
,
1
,
RT_IPC_FLAG_FIFO
);
ret
=
rt_sem_init
(
&
nu_sdh_arr
[
i
].
lock
,
"sdhlock"
,
1
,
RT_IPC_FLAG_FIFO
);
RT_ASSERT
(
ret
==
RT_EOK
);
SDH_Open
(
nu_sdh_arr
[
i
].
base
,
CardDetect_From_GPIO
);
SDH_Open
(
nu_sdh_arr
[
i
].
base
,
CardDetect_From_GPIO
);
...
@@ -402,6 +407,7 @@ static int rt_hw_sdh_init(void)
...
@@ -402,6 +407,7 @@ static int rt_hw_sdh_init(void)
NVIC_EnableIRQ
(
SDH0_IRQn
);
NVIC_EnableIRQ
(
SDH0_IRQn
);
nu_sdh_arr
[
i
].
pbuf
=
RT_NULL
;
nu_sdh_arr
[
i
].
pbuf
=
RT_NULL
;
ret
=
rt_device_register
(
&
nu_sdh_arr
[
i
].
dev
,
nu_sdh_arr
[
i
].
name
,
flags
);
ret
=
rt_device_register
(
&
nu_sdh_arr
[
i
].
dev
,
nu_sdh_arr
[
i
].
name
,
flags
);
RT_ASSERT
(
ret
==
RT_EOK
);
RT_ASSERT
(
ret
==
RT_EOK
);
}
}
...
@@ -415,8 +421,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -415,8 +421,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
{
{
rt_bool_t
ret
=
RT_FALSE
;
rt_bool_t
ret
=
RT_FALSE
;
#if defined(RT_USING_DFS)
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
if
(
psFS
==
RT_NULL
)
if
(
psFS
==
RT_NULL
)
{
{
...
@@ -431,8 +435,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -431,8 +435,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
ret
=
RT_FALSE
;
ret
=
RT_FALSE
;
}
}
#endif
exit_nu_sdh_hotplug_is_mounted:
exit_nu_sdh_hotplug_is_mounted:
return
ret
;
return
ret
;
...
@@ -442,8 +444,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
...
@@ -442,8 +444,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
DIR
*
t
;
DIR
*
t
;
#if defined(RT_USING_DFS)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
{
{
ret
=
RT_EOK
;
ret
=
RT_EOK
;
...
@@ -491,7 +491,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
...
@@ -491,7 +491,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
exit_nu_sdh_hotplug_mount:
exit_nu_sdh_hotplug_mount:
#endif
return
-
(
ret
);
return
-
(
ret
);
}
}
...
@@ -499,7 +498,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -499,7 +498,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
{
{
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
#if defined(RT_USING_DFS)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
{
{
ret
=
RT_EOK
;
ret
=
RT_EOK
;
...
@@ -516,7 +514,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -516,7 +514,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
rt_kprintf
(
"Succeed to unmount %s.
\n
"
,
sdh
->
mounted_point
);
rt_kprintf
(
"Succeed to unmount %s.
\n
"
,
sdh
->
mounted_point
);
ret
=
RT_EOK
;
ret
=
RT_EOK
;
}
}
#endif
exit_nu_sdh_hotplug_unmount:
exit_nu_sdh_hotplug_unmount:
...
@@ -585,7 +582,11 @@ static void sdh_hotplugger(void *param)
...
@@ -585,7 +582,11 @@ static void sdh_hotplugger(void *param)
int
mnt_init_sdcard_hotplug
(
void
)
int
mnt_init_sdcard_hotplug
(
void
)
{
{
rt_thread_init
(
&
sdh_tid
,
"hotplug"
,
sdh_hotplugger
,
NULL
,
sdh_stack
,
sizeof
(
sdh_stack
),
RT_THREAD_PRIORITY_MAX
-
2
,
10
);
rt_err_t
result
;
result
=
rt_thread_init
(
&
sdh_tid
,
"hotplug"
,
sdh_hotplugger
,
NULL
,
sdh_stack
,
sizeof
(
sdh_stack
),
RT_THREAD_PRIORITY_MAX
-
2
,
10
);
RT_ASSERT
(
result
==
RT_EOK
);
rt_thread_startup
(
&
sdh_tid
);
rt_thread_startup
(
&
sdh_tid
);
return
0
;
return
0
;
...
...
bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c
浏览文件 @
8803bf40
...
@@ -469,7 +469,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
...
@@ -469,7 +469,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
context
=
pipe
;
msg
.
content
.
cb
.
context
=
pipe
;
rt_usbh_event_signal
(
&
msg
);
rt_usbh_event_signal
(
&
s_sUSBHDev
.
uhcd
,
&
msg
);
}
}
exit_int_xfer_done_cb:
exit_int_xfer_done_cb:
...
...
bsp/nuvoton/libraries/m480/rtt_port/Kconfig
浏览文件 @
8803bf40
...
@@ -447,6 +447,7 @@ config SOC_SERIES_M480
...
@@ -447,6 +447,7 @@ config SOC_SERIES_M480
menuconfig BSP_USING_SDH
menuconfig BSP_USING_SDH
bool "Enable Secure Digital Host Controller(SDH)"
bool "Enable Secure Digital Host Controller(SDH)"
select RT_USING_DFS
select RT_USING_DFS
select DFS_USING_POSIX
if BSP_USING_SDH
if BSP_USING_SDH
config BSP_USING_SDH0
config BSP_USING_SDH0
...
...
bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c
浏览文件 @
8803bf40
...
@@ -19,14 +19,12 @@
...
@@ -19,14 +19,12 @@
#include <drv_pdma.h>
#include <drv_pdma.h>
#include <string.h>
#include <string.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
/* Private define ---------------------------------------------------------------*/
/* Private define ---------------------------------------------------------------*/
...
@@ -457,8 +455,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -457,8 +455,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
{
{
rt_bool_t
ret
=
RT_FALSE
;
rt_bool_t
ret
=
RT_FALSE
;
#if defined(RT_USING_DFS)
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
if
(
psFS
==
RT_NULL
)
if
(
psFS
==
RT_NULL
)
{
{
...
@@ -473,8 +469,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -473,8 +469,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
ret
=
RT_FALSE
;
ret
=
RT_FALSE
;
}
}
#endif
exit_nu_sdh_hotplug_is_mounted:
exit_nu_sdh_hotplug_is_mounted:
return
ret
;
return
ret
;
...
@@ -484,8 +478,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
...
@@ -484,8 +478,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
DIR
*
t
;
DIR
*
t
;
#if defined(RT_USING_DFS)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
{
{
ret
=
RT_EOK
;
ret
=
RT_EOK
;
...
@@ -533,7 +525,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
...
@@ -533,7 +525,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
exit_nu_sdh_hotplug_mount:
exit_nu_sdh_hotplug_mount:
#endif
return
-
(
ret
);
return
-
(
ret
);
}
}
...
@@ -541,7 +532,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -541,7 +532,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
{
{
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
#if defined(RT_USING_DFS)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
{
{
ret
=
RT_EOK
;
ret
=
RT_EOK
;
...
@@ -558,7 +548,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -558,7 +548,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
rt_kprintf
(
"Succeed to unmount %s.
\n
"
,
sdh
->
mounted_point
);
rt_kprintf
(
"Succeed to unmount %s.
\n
"
,
sdh
->
mounted_point
);
ret
=
RT_EOK
;
ret
=
RT_EOK
;
}
}
#endif
exit_nu_sdh_hotplug_unmount:
exit_nu_sdh_hotplug_unmount:
...
...
bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c
浏览文件 @
8803bf40
...
@@ -472,7 +472,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
...
@@ -472,7 +472,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
context
=
pipe
;
msg
.
content
.
cb
.
context
=
pipe
;
rt_usbh_event_signal
(
&
msg
);
rt_usbh_event_signal
(
&
s_sUSBHDev
.
uhcd
,
&
msg
);
}
}
exit_int_xfer_done_cb:
exit_int_xfer_done_cb:
...
...
bsp/nuvoton/libraries/n9h30/rtt_port/Kconfig
浏览文件 @
8803bf40
...
@@ -273,6 +273,7 @@ config SOC_SERIES_N9H30
...
@@ -273,6 +273,7 @@ config SOC_SERIES_N9H30
menuconfig BSP_USING_SDH
menuconfig BSP_USING_SDH
bool "Enable Secure Digital Host Controller(SDH)"
bool "Enable Secure Digital Host Controller(SDH)"
select RT_USING_DFS
select RT_USING_DFS
select DFS_USING_POSIX
if BSP_USING_SDH
if BSP_USING_SDH
...
...
bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c
浏览文件 @
8803bf40
...
@@ -19,14 +19,12 @@
...
@@ -19,14 +19,12 @@
#include "NuMicro.h"
#include "NuMicro.h"
#include <drv_sys.h>
#include <drv_sys.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
/* Private define ---------------------------------------------------------------*/
/* Private define ---------------------------------------------------------------*/
...
@@ -602,8 +600,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -602,8 +600,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
{
{
rt_bool_t
ret
=
RT_FALSE
;
rt_bool_t
ret
=
RT_FALSE
;
#if defined(RT_USING_DFS)
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
if
(
psFS
==
RT_NULL
)
if
(
psFS
==
RT_NULL
)
{
{
...
@@ -620,15 +616,11 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -620,15 +616,11 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
exit_nu_sdh_hotplug_is_mounted:
exit_nu_sdh_hotplug_is_mounted:
#endif
return
ret
;
return
ret
;
}
}
static
rt_err_t
nu_sdh_hotplug_mount
(
nu_sdh_t
sdh
)
static
rt_err_t
nu_sdh_hotplug_mount
(
nu_sdh_t
sdh
)
{
{
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
#if defined(RT_USING_DFS)
DIR
*
t
;
DIR
*
t
;
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
...
@@ -678,7 +670,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
...
@@ -678,7 +670,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
exit_nu_sdh_hotplug_mount:
exit_nu_sdh_hotplug_mount:
#endif
return
-
(
ret
);
return
-
(
ret
);
}
}
...
@@ -686,7 +677,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -686,7 +677,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
{
{
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
#if defined(RT_USING_DFS)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
{
{
ret
=
RT_EOK
;
ret
=
RT_EOK
;
...
@@ -706,8 +696,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -706,8 +696,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
exit_nu_sdh_hotplug_unmount:
exit_nu_sdh_hotplug_unmount:
#endif
return
-
(
ret
);
return
-
(
ret
);
}
}
...
...
bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c
浏览文件 @
8803bf40
...
@@ -425,7 +425,7 @@ static int nu_bulk_xfer(
...
@@ -425,7 +425,7 @@ static int nu_bulk_xfer(
UTR_T
*
psUTR
,
UTR_T
*
psUTR
,
int
timeouts
)
int
timeouts
)
{
{
#define TIMEOUT_RETRY 3
#define TIMEOUT_RETRY 3
int
retry
=
TIMEOUT_RETRY
;
int
retry
=
TIMEOUT_RETRY
;
int
ret
=
usbh_bulk_xfer
(
psUTR
);
int
ret
=
usbh_bulk_xfer
(
psUTR
);
...
@@ -435,9 +435,9 @@ static int nu_bulk_xfer(
...
@@ -435,9 +435,9 @@ static int nu_bulk_xfer(
return
ret
;
return
ret
;
}
}
while
(
retry
>
0
)
while
(
retry
>
0
)
{
{
if
(
rt_completion_wait
(
&
(
psPortDev
->
utr_completion
),
timeouts
)
!=
0
)
if
(
rt_completion_wait
(
&
(
psPortDev
->
utr_completion
),
timeouts
)
!=
0
)
{
{
rt_uint32_t
level
;
rt_uint32_t
level
;
...
@@ -513,7 +513,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
...
@@ -513,7 +513,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
context
=
pipe
;
msg
.
content
.
cb
.
context
=
pipe
;
rt_usbh_event_signal
(
&
msg
);
rt_usbh_event_signal
(
&
s_sUSBHDev
.
uhcd
,
&
msg
);
}
}
exit_int_xfer_done_cb:
exit_int_xfer_done_cb:
...
...
bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig
浏览文件 @
8803bf40
...
@@ -353,6 +353,7 @@ config SOC_SERIES_NUC980
...
@@ -353,6 +353,7 @@ config SOC_SERIES_NUC980
menuconfig BSP_USING_SDH
menuconfig BSP_USING_SDH
bool "Enable Secure Digital Host Controller(SDH)"
bool "Enable Secure Digital Host Controller(SDH)"
select RT_USING_DFS
select RT_USING_DFS
select DFS_USING_POSIX
if BSP_USING_SDH
if BSP_USING_SDH
config BSP_USING_SDH0
config BSP_USING_SDH0
...
...
bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c
浏览文件 @
8803bf40
...
@@ -20,14 +20,12 @@
...
@@ -20,14 +20,12 @@
#include <drv_pdma.h>
#include <drv_pdma.h>
#include <drv_sys.h>
#include <drv_sys.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
/* Private define ---------------------------------------------------------------*/
/* Private define ---------------------------------------------------------------*/
...
@@ -458,8 +456,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -458,8 +456,6 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
{
{
rt_bool_t
ret
=
RT_FALSE
;
rt_bool_t
ret
=
RT_FALSE
;
#if defined(RT_USING_DFS)
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
struct
dfs_filesystem
*
psFS
=
dfs_filesystem_lookup
(
mounting_path
);
if
(
psFS
==
RT_NULL
)
if
(
psFS
==
RT_NULL
)
{
{
...
@@ -476,15 +472,11 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
...
@@ -476,15 +472,11 @@ static rt_bool_t nu_sdh_hotplug_is_mounted(const char *mounting_path)
exit_nu_sdh_hotplug_is_mounted:
exit_nu_sdh_hotplug_is_mounted:
#endif
return
ret
;
return
ret
;
}
}
static
rt_err_t
nu_sdh_hotplug_mount
(
nu_sdh_t
sdh
)
static
rt_err_t
nu_sdh_hotplug_mount
(
nu_sdh_t
sdh
)
{
{
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
#if defined(RT_USING_DFS)
DIR
*
t
;
DIR
*
t
;
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_TRUE
)
...
@@ -534,7 +526,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
...
@@ -534,7 +526,6 @@ static rt_err_t nu_sdh_hotplug_mount(nu_sdh_t sdh)
exit_nu_sdh_hotplug_mount:
exit_nu_sdh_hotplug_mount:
#endif
return
-
(
ret
);
return
-
(
ret
);
}
}
...
@@ -542,7 +533,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -542,7 +533,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
{
{
rt_err_t
ret
=
RT_ERROR
;
rt_err_t
ret
=
RT_ERROR
;
#if defined(RT_USING_DFS)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
if
(
nu_sdh_hotplug_is_mounted
(
sdh
->
mounted_point
)
==
RT_FALSE
)
{
{
ret
=
RT_EOK
;
ret
=
RT_EOK
;
...
@@ -562,8 +552,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
...
@@ -562,8 +552,6 @@ static rt_err_t nu_sdh_hotplug_unmount(nu_sdh_t sdh)
exit_nu_sdh_hotplug_unmount:
exit_nu_sdh_hotplug_unmount:
#endif
return
-
(
ret
);
return
-
(
ret
);
}
}
...
...
bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c
浏览文件 @
8803bf40
...
@@ -425,7 +425,7 @@ static int nu_bulk_xfer(
...
@@ -425,7 +425,7 @@ static int nu_bulk_xfer(
UTR_T
*
psUTR
,
UTR_T
*
psUTR
,
int
timeouts
)
int
timeouts
)
{
{
#define TIMEOUT_RETRY 3
#define TIMEOUT_RETRY 3
int
retry
=
TIMEOUT_RETRY
;
int
retry
=
TIMEOUT_RETRY
;
int
ret
=
usbh_bulk_xfer
(
psUTR
);
int
ret
=
usbh_bulk_xfer
(
psUTR
);
...
@@ -435,9 +435,9 @@ static int nu_bulk_xfer(
...
@@ -435,9 +435,9 @@ static int nu_bulk_xfer(
return
ret
;
return
ret
;
}
}
while
(
retry
>
0
)
while
(
retry
>
0
)
{
{
if
(
rt_completion_wait
(
&
(
psPortDev
->
utr_completion
),
timeouts
)
!=
0
)
if
(
rt_completion_wait
(
&
(
psPortDev
->
utr_completion
),
timeouts
)
!=
0
)
{
{
rt_uint32_t
level
;
rt_uint32_t
level
;
...
@@ -513,7 +513,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
...
@@ -513,7 +513,7 @@ static void int_xfer_done_cb(UTR_T *psUTR)
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
type
=
USB_MSG_CALLBACK
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
function
=
pipe
->
callback
;
msg
.
content
.
cb
.
context
=
pipe
;
msg
.
content
.
cb
.
context
=
pipe
;
rt_usbh_event_signal
(
&
msg
);
rt_usbh_event_signal
(
&
s_sUSBHDev
.
uhcd
,
&
msg
);
}
}
exit_int_xfer_done_cb:
exit_int_xfer_done_cb:
...
...
bsp/nuvoton/nk-980iot/applications/mnt.c
浏览文件 @
8803bf40
...
@@ -21,14 +21,12 @@
...
@@ -21,14 +21,12 @@
#define DBG_COLOR
#define DBG_COLOR
#include <rtdbg.h>
#include <rtdbg.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
#if defined(PKG_USING_FAL)
#if defined(PKG_USING_FAL)
#include <fal.h>
#include <fal.h>
...
...
bsp/nuvoton/nk-n9h30/applications/mnt.c
浏览文件 @
8803bf40
...
@@ -21,14 +21,12 @@
...
@@ -21,14 +21,12 @@
#define DBG_COLOR
#define DBG_COLOR
#include <rtdbg.h>
#include <rtdbg.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
#if defined(PKG_USING_FAL)
#if defined(PKG_USING_FAL)
#include <fal.h>
#include <fal.h>
...
...
bsp/nuvoton/nk-rtu980/applications/mnt.c
浏览文件 @
8803bf40
...
@@ -21,14 +21,12 @@
...
@@ -21,14 +21,12 @@
#define DBG_COLOR
#define DBG_COLOR
#include <rtdbg.h>
#include <rtdbg.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
#if defined(PKG_USING_FAL)
#if defined(PKG_USING_FAL)
#include <fal.h>
#include <fal.h>
...
...
bsp/nuvoton/numaker-iot-m487/applications/mnt.c
浏览文件 @
8803bf40
...
@@ -12,14 +12,12 @@
...
@@ -12,14 +12,12 @@
#include <rtthread.h>
#include <rtthread.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
#if defined(PKG_USING_FAL)
#if defined(PKG_USING_FAL)
#include <fal.h>
#include <fal.h>
...
...
bsp/nuvoton/numaker-m032ki/applications/mnt.c
浏览文件 @
8803bf40
...
@@ -12,14 +12,12 @@
...
@@ -12,14 +12,12 @@
#include <rtthread.h>
#include <rtthread.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
#if defined(PKG_USING_FAL)
#if defined(PKG_USING_FAL)
#include <fal.h>
#include <fal.h>
...
...
bsp/nuvoton/numaker-pfm-m487/applications/mnt.c
浏览文件 @
8803bf40
...
@@ -12,14 +12,12 @@
...
@@ -12,14 +12,12 @@
#include <rtthread.h>
#include <rtthread.h>
#if defined(RT_USING_DFS)
#include <dfs_fs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_file.h>
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statfs.h>
#endif
#if defined(PKG_USING_FAL)
#if defined(PKG_USING_FAL)
#include <fal.h>
#include <fal.h>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录