Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
4b41f0ee
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
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看板
提交
4b41f0ee
编写于
11月 03, 2014
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #367 from grissiom/ymodem-fix
ymodem: fix examples due to new API
上级
7cb64632
fe603dd3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
8 deletion
+8
-8
examples/ymodem/echo.c
examples/ymodem/echo.c
+2
-2
examples/ymodem/null.c
examples/ymodem/null.c
+2
-2
examples/ymodem/tofile.c
examples/ymodem/tofile.c
+4
-4
未找到文件。
examples/ymodem/echo.c
浏览文件 @
4b41f0ee
...
...
@@ -25,8 +25,8 @@ rt_err_t rym_cat_to_dev(rt_device_t idev, rt_device_t odev)
rt_kprintf
(
"open output device error: 0x%x"
,
-
res
);
return
res
;
}
res
=
rym_recv_on_device
(
&
rctx
,
idev
,
RT_NULL
,
_rym_echo_data
,
RT_NULL
,
1000
);
res
=
rym_recv_on_device
(
&
rctx
,
idev
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
RT_NULL
,
_rym_echo_data
,
RT_NULL
,
1000
);
rt_device_close
(
_odev
);
rt_kprintf
(
"leaving RYM mode with code %X
\n
"
,
res
);
return
res
;
...
...
examples/ymodem/null.c
浏览文件 @
4b41f0ee
...
...
@@ -20,8 +20,8 @@ rt_err_t rym_null(char *devname)
return
-
1
;
}
return
rym_recv_on_device
(
&
rctx
,
dev
,
RT_NULL
,
_rym_dummy_write
,
RT_NULL
,
1000
);
return
rym_recv_on_device
(
&
rctx
,
dev
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
RT_NULL
,
_rym_dummy_write
,
RT_NULL
,
1000
);
}
FINSH_FUNCTION_EXPORT
(
rym_null
,
dump
data
to
null
);
#endif
...
...
examples/ymodem/tofile.c
浏览文件 @
4b41f0ee
...
...
@@ -21,7 +21,7 @@ static enum rym_code _rym_bg(
struct
custom_ctx
*
cctx
=
(
struct
custom_ctx
*
)
ctx
;
cctx
->
fpath
[
0
]
=
'/'
;
/* the buf should be the file name */
strcpy
(
&
(
cctx
->
fpath
[
1
]),
buf
);
strcpy
(
&
(
cctx
->
fpath
[
1
]),
(
const
char
*
)
buf
);
cctx
->
fd
=
open
(
cctx
->
fpath
,
O_CREAT
|
O_WRONLY
|
O_TRUNC
,
0
);
if
(
cctx
->
fd
<
0
)
{
...
...
@@ -31,7 +31,7 @@ static enum rym_code _rym_bg(
return
RYM_CODE_CAN
;
}
cctx
->
flen
=
atoi
(
buf
+
strlen
(
buf
)
+
1
);
cctx
->
flen
=
atoi
(
(
const
char
*
)
buf
+
strlen
((
const
char
*
)
buf
)
+
1
);
if
(
cctx
->
flen
==
0
)
cctx
->
flen
=
-
1
;
return
RYM_CODE_ACK
;
...
...
@@ -80,8 +80,8 @@ rt_err_t rym_write_to_file(rt_device_t idev)
rt_kprintf
(
"entering RYM mode
\n
"
);
res
=
rym_recv_on_device
(
&
ctx
->
parent
,
idev
,
_rym_bg
,
_rym_tof
,
_rym_end
,
1000
);
res
=
rym_recv_on_device
(
&
ctx
->
parent
,
idev
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
_rym_bg
,
_rym_tof
,
_rym_end
,
1000
);
/* there is no Ymodem traffic on the line so print out info. */
rt_kprintf
(
"leaving RYM mode with code %d
\n
"
,
res
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录