Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
ccfde36b
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看板
提交
ccfde36b
编写于
6年前
作者:
armink_ztl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[net][at] Using DMA mode first when device is supported.
上级
7323916c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
10 deletion
+29
-10
components/net/at/include/at.h
components/net/at/include/at.h
+1
-1
components/net/at/src/at_client.c
components/net/at/src/at_client.c
+14
-5
components/net/at/src/at_server.c
components/net/at/src/at_server.c
+14
-4
未找到文件。
components/net/at/include/at.h
浏览文件 @
ccfde36b
...
...
@@ -27,7 +27,7 @@
#include <rtthread.h>
#define AT_SW_VERSION "0.2.
1
"
#define AT_SW_VERSION "0.2.
2
"
#define DBG_ENABLE
#define DBG_SECTION_NAME "AT"
...
...
This diff is collapsed.
Click to expand it.
components/net/at/src/at_client.c
浏览文件 @
ccfde36b
...
...
@@ -354,11 +354,12 @@ rt_size_t at_client_send(const char *buf, rt_size_t size)
static
char
at_client_getchar
(
void
)
{
char
ch
;
at_client_t
client
=
at_client_local
;
rt_sem_take
(
client
->
rx_notice
,
RT_WAITING_FOREVER
);
rt_device_read
(
client
->
device
,
0
,
&
ch
,
1
);
if
(
rt_device_read
(
at_client_local
->
device
,
0
,
&
ch
,
1
)
==
0
)
{
rt_sem_take
(
at_client_local
->
rx_notice
,
RT_WAITING_FOREVER
);
rt_device_read
(
at_client_local
->
device
,
0
,
&
ch
,
1
);
}
return
ch
;
}
...
...
@@ -604,6 +605,7 @@ void at_set_urc_table(const struct at_urc *table, rt_size_t size)
int
at_client_init
(
void
)
{
int
result
=
RT_EOK
;
rt_err_t
open_result
=
RT_EOK
;
if
(
at_client_local
)
{
...
...
@@ -651,7 +653,14 @@ int at_client_init(void)
{
RT_ASSERT
(
at_client_local
->
device
->
type
==
RT_Device_Class_Char
);
rt_device_open
(
at_client_local
->
device
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
);
/* using DMA mode first */
open_result
=
rt_device_open
(
at_client_local
->
device
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_DMA_RX
);
/* using interrupt mode when DMA mode not supported */
if
(
open_result
==
-
RT_EIO
)
{
open_result
=
rt_device_open
(
at_client_local
->
device
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
);
}
RT_ASSERT
(
open_result
==
RT_EOK
);
rt_device_set_rx_indicate
(
at_client_local
->
device
,
at_client_rx_ind
);
}
...
...
This diff is collapsed.
Click to expand it.
components/net/at/src/at_server.c
浏览文件 @
ccfde36b
...
...
@@ -352,9 +352,11 @@ static char at_server_gerchar(void)
{
char
ch
;
rt_sem_take
(
at_server_local
->
rx_notice
,
RT_WAITING_FOREVER
);
rt_device_read
(
at_server_local
->
device
,
0
,
&
ch
,
1
);
if
(
rt_device_read
(
at_server_local
->
device
,
0
,
&
ch
,
1
)
==
0
)
{
rt_sem_take
(
at_server_local
->
rx_notice
,
RT_WAITING_FOREVER
);
rt_device_read
(
at_server_local
->
device
,
0
,
&
ch
,
1
);
}
return
ch
;
}
...
...
@@ -443,6 +445,7 @@ static rt_err_t at_rx_ind(rt_device_t dev, rt_size_t size)
int
at_server_init
(
void
)
{
rt_err_t
result
=
RT_EOK
;
rt_err_t
open_result
=
RT_EOK
;
if
(
at_server_local
)
{
...
...
@@ -493,7 +496,14 @@ int at_server_init(void)
{
RT_ASSERT
(
at_server_local
->
device
->
type
==
RT_Device_Class_Char
);
rt_device_open
(
at_server_local
->
device
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
);
/* using DMA mode first */
open_result
=
rt_device_open
(
at_server_local
->
device
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_DMA_RX
);
/* using interrupt mode when DMA mode not supported */
if
(
open_result
==
-
RT_EIO
)
{
open_result
=
rt_device_open
(
at_server_local
->
device
,
RT_DEVICE_OFLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
);
}
RT_ASSERT
(
open_result
==
RT_EOK
);
rt_device_set_rx_indicate
(
at_server_local
->
device
,
at_rx_ind
);
}
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部