Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaobo07
rt-thread
提交
08737c2a
R
rt-thread
项目概览
Xiaobo07
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
08737c2a
编写于
5月 17, 2022
作者:
mysterywolf
提交者:
guo
5月 19, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[simulator] 消除windows下的警告
上级
569facb1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
14 deletion
+13
-14
bsp/simulator/drivers/dfs_win32.c
bsp/simulator/drivers/dfs_win32.c
+1
-1
bsp/simulator/drivers/drv_rtc.c
bsp/simulator/drivers/drv_rtc.c
+8
-10
bsp/simulator/drivers/uart_console.c
bsp/simulator/drivers/uart_console.c
+1
-0
components/finsh/shell.c
components/finsh/shell.c
+3
-3
未找到文件。
bsp/simulator/drivers/dfs_win32.c
浏览文件 @
08737c2a
...
...
@@ -345,7 +345,7 @@ static int dfs_win32_getdents(struct dfs_fd *file, struct dirent *dirp, rt_uint3
d
->
d_type
=
DT_DIR
;
else
d
->
d_type
=
DT_REG
;
d
->
d_namlen
=
strlen
(
wdirp
->
curr
);
d
->
d_namlen
=
(
rt_uint8_t
)
strlen
(
wdirp
->
curr
);
strncpy
(
d
->
d_name
,
wdirp
->
curr
,
DFS_PATH_MAX
);
d
->
d_reclen
=
(
rt_uint16_t
)
sizeof
(
struct
dirent
);
wdirp
->
curr
+=
(
strlen
(
wdirp
->
curr
)
+
1
);
...
...
bsp/simulator/drivers/drv_rtc.c
浏览文件 @
08737c2a
...
...
@@ -58,10 +58,8 @@ static void get_rtc_timeval(struct timeval *tv)
tv
->
tv_usec
=
sys_time
.
wMilliseconds
*
1000UL
;
}
static
rt_err_t
windows
_rtc_control
(
rt_device_t
dev
,
int
cmd
,
void
*
args
)
static
rt_err_t
pc
_rtc_control
(
rt_device_t
dev
,
int
cmd
,
void
*
args
)
{
struct
tm
newtime
;
RT_ASSERT
(
dev
!=
RT_NULL
);
switch
(
cmd
)
...
...
@@ -70,7 +68,7 @@ static rt_err_t windows_rtc_control(rt_device_t dev, int cmd, void *args)
{
struct
timeval
tv
;
get_rtc_timeval
(
&
tv
);
*
(
rt_uint32_t
*
)
args
=
tv
.
tv_sec
;
*
(
time_t
*
)
args
=
tv
.
tv_sec
;
break
;
}
case
RT_DEVICE_CTRL_RTC_GET_TIMEVAL
:
...
...
@@ -104,18 +102,18 @@ static rt_err_t windows_rtc_control(rt_device_t dev, int cmd, void *args)
}
#ifdef RT_USING_DEVICE_OPS
const
static
struct
rt_device_ops
soft
_rtc_ops
=
const
static
struct
rt_device_ops
pc
_rtc_ops
=
{
RT_NULL
,
RT_NULL
,
RT_NULL
,
RT_NULL
,
RT_NULL
,
windows
_rtc_control
pc
_rtc_control
};
#endif
int
rt_
windows
_rtc_init
(
void
)
int
rt_
pc
_rtc_init
(
void
)
{
/* make sure only one 'rtc' device */
RT_ASSERT
(
!
rt_device_find
(
"rtc"
));
...
...
@@ -133,18 +131,18 @@ int rt_windows_rtc_init(void)
/* register rtc device */
#ifdef RT_USING_DEVICE_OPS
rtc_dev
.
ops
=
&
soft
_rtc_ops
;
rtc_dev
.
ops
=
&
pc
_rtc_ops
;
#else
rtc_dev
.
init
=
RT_NULL
;
rtc_dev
.
open
=
RT_NULL
;
rtc_dev
.
close
=
RT_NULL
;
rtc_dev
.
read
=
RT_NULL
;
rtc_dev
.
write
=
RT_NULL
;
rtc_dev
.
control
=
windows
_rtc_control
;
rtc_dev
.
control
=
pc
_rtc_control
;
#endif
rtc_dev
.
user_data
=
RT_NULL
;
/* no private */
rt_device_register
(
&
rtc_dev
,
"rtc"
,
RT_DEVICE_FLAG_RDWR
);
return
0
;
}
INIT_BOARD_EXPORT
(
rt_
windows
_rtc_init
);
INIT_BOARD_EXPORT
(
rt_
pc
_rtc_init
);
bsp/simulator/drivers/uart_console.c
浏览文件 @
08737c2a
...
...
@@ -29,6 +29,7 @@ static struct rt_serial_device _serial;
#include <windows.h>
#include <mmsystem.h>
#include <conio.h>
extern
int
getch
(
void
);
/*
* Handler for OSKey Thread
...
...
components/finsh/shell.c
浏览文件 @
08737c2a
...
...
@@ -529,7 +529,7 @@ void finsh_thread_entry(void *parameter)
/* copy the history command */
rt_memcpy
(
shell
->
line
,
&
shell
->
cmd_history
[
shell
->
current_history
][
0
],
FINSH_CMD_SIZE
);
shell
->
line_curpos
=
shell
->
line_position
=
strlen
(
shell
->
line
);
shell
->
line_curpos
=
shell
->
line_position
=
(
rt_uint16_t
)
strlen
(
shell
->
line
);
shell_handle_history
(
shell
);
#endif
continue
;
...
...
@@ -551,7 +551,7 @@ void finsh_thread_entry(void *parameter)
rt_memcpy
(
shell
->
line
,
&
shell
->
cmd_history
[
shell
->
current_history
][
0
],
FINSH_CMD_SIZE
);
shell
->
line_curpos
=
shell
->
line_position
=
strlen
(
shell
->
line
);
shell
->
line_curpos
=
shell
->
line_position
=
(
rt_uint16_t
)
strlen
(
shell
->
line
);
shell_handle_history
(
shell
);
#endif
continue
;
...
...
@@ -591,7 +591,7 @@ void finsh_thread_entry(void *parameter)
/* auto complete */
shell_auto_complete
(
&
shell
->
line
[
0
]);
/* re-calculate position */
shell
->
line_curpos
=
shell
->
line_position
=
strlen
(
shell
->
line
);
shell
->
line_curpos
=
shell
->
line_position
=
(
rt_uint16_t
)
strlen
(
shell
->
line
);
continue
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录