Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
人间散章
rt-thread
提交
5ac5d92c
R
rt-thread
项目概览
人间散章
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
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,发现更多精彩内容 >>
提交
5ac5d92c
编写于
6月 16, 2021
作者:
C
chenjh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[serial] 优化发送非阻塞时,serial_close未执行rt_completion_done的问题。
上级
fac3c5cd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
71 addition
and
53 deletion
+71
-53
bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c
bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c
+1
-0
bsp/stm32/stm32l475-atk-pandora/project.uvprojx
bsp/stm32/stm32l475-atk-pandora/project.uvprojx
+58
-48
components/drivers/include/drivers/serial_v2.h
components/drivers/include/drivers/serial_v2.h
+0
-2
components/drivers/serial/SConscript
components/drivers/serial/SConscript
+1
-0
components/drivers/serial/serial_v2.c
components/drivers/serial/serial_v2.c
+11
-3
未找到文件。
bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c
浏览文件 @
5ac5d92c
...
...
@@ -456,6 +456,7 @@ static void uart_isr(struct rt_serial_device *serial)
{
if
(
__HAL_UART_GET_FLAG
(
&
(
uart
->
handle
),
UART_FLAG_ORE
)
!=
RESET
)
{
LOG_E
(
"(%s) serial device Overrun error!"
,
serial
->
parent
.
parent
.
name
);
__HAL_UART_CLEAR_OREFLAG
(
&
uart
->
handle
);
}
if
(
__HAL_UART_GET_FLAG
(
&
(
uart
->
handle
),
UART_FLAG_NE
)
!=
RESET
)
...
...
bsp/stm32/stm32l475-atk-pandora/project.uvprojx
浏览文件 @
5ac5d92c
...
...
@@ -338,7 +338,7 @@
<MiscControls></MiscControls>
<Define>
USE_HAL_DRIVER, __RTTHREAD__, STM32L475xx
</Define>
<Undefine></Undefine>
<IncludePath>
.;applications;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;board\CubeMX_Config\Inc;board\ports;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\components\finsh;.;..\..\..\include;..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Inc;..\libraries\STM32L4xx_HAL\CMSIS\Device\ST\STM32L4xx\Include;..\libraries\STM32L4xx_HAL\CMSIS\Include
</IncludePath>
<IncludePath>
.;applications;..\..\..\libcpu\arm\common;..\..\..\libcpu\arm\cortex-m4;..\..\..\components\drivers\include;..\..\..\components\drivers\include;..\..\..\components\drivers\include;board;board\CubeMX_Config\Inc;board\ports;..\libraries\HAL_Drivers;..\libraries\HAL_Drivers\config;..\..\..\components\finsh;.;..\..\..\include;..\libraries\STM32L4xx_HAL\STM32L4xx_HAL_Driver\Inc;..\libraries\STM32L4xx_HAL\CMSIS\Device\ST\STM32L4xx\Include;..\libraries\STM32L4xx_HAL\CMSIS\Include
;..\..\..\components\utilities\utest;..\..\..\examples\utest\testcases\kernel
</IncludePath>
</VariousControls>
</Cads>
<Aads>
...
...
@@ -388,15 +388,20 @@
<FilePath>
applications\main.c
</FilePath>
</File>
<File>
<FileName>
uart_
sample
.c
</FileName>
<FileName>
uart_
rxblocking_txblocking
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
.\applications\uart_
sample
.c
</FilePath>
<FilePath>
.\applications\uart_
rxblocking_txblocking
.c
</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>
CPU
</GroupName>
<Files>
<File>
<FileName>
backtrace.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\libcpu\arm\common\backtrace.c
</FilePath>
</File>
<File>
<FileName>
showmem.c
</FileName>
<FileType>
1
</FileType>
...
...
@@ -408,20 +413,15 @@
<FilePath>
..\..\..\libcpu\arm\common\div0.c
</FilePath>
</File>
<File>
<FileName>
backtrace.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\libcpu\arm\co
mmon\backtrace.c
</FilePath>
<FileName>
context_rvds.S
</FileName>
<FileType>
2
</FileType>
<FilePath>
..\..\..\libcpu\arm\co
rtex-m4\context_rvds.S
</FilePath>
</File>
<File>
<FileName>
cpuport.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\libcpu\arm\cortex-m4\cpuport.c
</FilePath>
</File>
<File>
<FileName>
context_rvds.S
</FileName>
<FileType>
2
</FileType>
<FilePath>
..\..\..\libcpu\arm\cortex-m4\context_rvds.S
</FilePath>
</File>
</Files>
</Group>
<Group>
...
...
@@ -438,14 +438,9 @@
<FilePath>
..\..\..\components\drivers\serial\serial_v2.c
</FilePath>
</File>
<File>
<FileName>
completion.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\src\completion.c
</FilePath>
</File>
<File>
<FileName>
ringbuffer.c
</FileName>
<FileName>
ringblk_buf.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\src\ringb
uffer
.c
</FilePath>
<FilePath>
..\..\..\components\drivers\src\ringb
lk_buf
.c
</FilePath>
</File>
<File>
<FileName>
waitqueue.c
</FileName>
...
...
@@ -453,14 +448,14 @@
<FilePath>
..\..\..\components\drivers\src\waitqueue.c
</FilePath>
</File>
<File>
<FileName>
ringblk_buf
.c
</FileName>
<FileName>
workqueue
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\src\
ringblk_buf
.c
</FilePath>
<FilePath>
..\..\..\components\drivers\src\
workqueue
.c
</FilePath>
</File>
<File>
<FileName>
dataqueue
.c
</FileName>
<FileName>
ringbuffer
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\src\
dataqueue
.c
</FilePath>
<FilePath>
..\..\..\components\drivers\src\
ringbuffer
.c
</FilePath>
</File>
<File>
<FileName>
pipe.c
</FileName>
...
...
@@ -468,9 +463,14 @@
<FilePath>
..\..\..\components\drivers\src\pipe.c
</FilePath>
</File>
<File>
<FileName>
workqueue
.c
</FileName>
<FileName>
completion
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\src\workqueue.c
</FilePath>
<FilePath>
..\..\..\components\drivers\src\completion.c
</FilePath>
</File>
<File>
<FileName>
dataqueue.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\drivers\src\dataqueue.c
</FilePath>
</File>
</Files>
</Group>
...
...
@@ -533,9 +533,14 @@
<GroupName>
Kernel
</GroupName>
<Files>
<File>
<FileName>
idl
e.c
</FileName>
<FileName>
devic
e.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\idle.c
</FilePath>
<FilePath>
..\..\..\src\device.c
</FilePath>
</File>
<File>
<FileName>
timer.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\timer.c
</FilePath>
</File>
<File>
<FileName>
kservice.c
</FileName>
...
...
@@ -543,14 +548,19 @@
<FilePath>
..\..\..\src\kservice.c
</FilePath>
</File>
<File>
<FileName>
device
.c
</FileName>
<FileName>
irq
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\
device
.c
</FilePath>
<FilePath>
..\..\..\src\
irq
.c
</FilePath>
</File>
<File>
<FileName>
clock
.c
</FileName>
<FileName>
ipc
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\clock.c
</FilePath>
<FilePath>
..\..\..\src\ipc.c
</FilePath>
</File>
<File>
<FileName>
idle.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\idle.c
</FilePath>
</File>
<File>
<FileName>
mempool.c
</FileName>
...
...
@@ -563,24 +573,19 @@
<FilePath>
..\..\..\src\scheduler.c
</FilePath>
</File>
<File>
<FileName>
mem.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\mem.c
</FilePath>
</File>
<File>
<FileName>
components.c
</FileName>
<FileName>
clock.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\c
omponents
.c
</FilePath>
<FilePath>
..\..\..\src\c
lock
.c
</FilePath>
</File>
<File>
<FileName>
ipc
.c
</FileName>
<FileName>
thread
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\
ipc
.c
</FilePath>
<FilePath>
..\..\..\src\
thread
.c
</FilePath>
</File>
<File>
<FileName>
irq
.c
</FileName>
<FileName>
mem
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\
irq
.c
</FilePath>
<FilePath>
..\..\..\src\
mem
.c
</FilePath>
</File>
<File>
<FileName>
object.c
</FileName>
...
...
@@ -588,14 +593,9 @@
<FilePath>
..\..\..\src\object.c
</FilePath>
</File>
<File>
<FileName>
thread.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\thread.c
</FilePath>
</File>
<File>
<FileName>
timer.c
</FileName>
<FileName>
components.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\src\
timer
.c
</FilePath>
<FilePath>
..\..\..\src\
components
.c
</FilePath>
</File>
</Files>
</Group>
...
...
@@ -709,6 +709,16 @@
</File>
</Files>
</Group>
<Group>
<GroupName>
UTest
</GroupName>
<Files>
<File>
<FileName>
utest.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\components\utilities\utest\utest.c
</FilePath>
</File>
</Files>
</Group>
</Groups>
</Target>
</Targets>
...
...
components/drivers/include/drivers/serial_v2.h
浏览文件 @
5ac5d92c
...
...
@@ -118,8 +118,6 @@ struct rt_serial_rx_fifo
{
struct
rt_ringbuffer
rb
;
rt_uint16_t
rx_index
;
struct
rt_completion
rx_cpt
;
rt_uint16_t
rx_cpt_index
;
...
...
components/drivers/serial/SConscript
浏览文件 @
5ac5d92c
...
...
@@ -2,6 +2,7 @@ from building import *
cwd
=
GetCurrentDir
()
CPPPATH
=
[
cwd
+
'/../include'
]
group
=
[]
if
GetDepend
([
'RT_USING_SERIAL'
]):
if
GetDepend
([
'RT_USING_SERIAL_V2'
]):
src
=
Glob
(
'serial_v2.c'
)
...
...
components/drivers/serial/serial_v2.c
浏览文件 @
5ac5d92c
...
...
@@ -726,7 +726,6 @@ static rt_err_t rt_serial_rx_enable(struct rt_device *dev,
RT_ASSERT
(
rx_fifo
!=
RT_NULL
);
rt_ringbuffer_init
(
&
(
rx_fifo
->
rb
),
rx_fifo
->
buffer
,
serial
->
config
.
rx_bufsz
);
rx_fifo
->
rx_index
=
serial
->
config
.
rx_bufsz
;
serial
->
serial_rx
=
rx_fifo
;
dev
->
read
=
_serial_fifo_rx
;
...
...
@@ -813,6 +812,9 @@ static rt_err_t rt_serial_tx_disable(struct rt_device *dev,
dev
->
write
=
RT_NULL
;
if
(
serial
->
serial_tx
==
RT_NULL
)
return
RT_EOK
;
tx_fifo
=
(
struct
rt_serial_tx_fifo
*
)
serial
->
serial_tx
;
RT_ASSERT
(
tx_fifo
!=
RT_NULL
);
do
{
if
(
tx_oflag
==
RT_SERIAL_TX_NON_BLOCKING
)
...
...
@@ -825,14 +827,13 @@ static rt_err_t rt_serial_tx_disable(struct rt_device *dev,
break
;
}
rt_completion_done
(
&
(
tx_fifo
->
tx_cpt
));
dev
->
open_flag
&=
~
RT_SERIAL_TX_BLOCKING
;
serial
->
ops
->
control
(
serial
,
RT_DEVICE_CTRL_CLR_INT
,
(
void
*
)
RT_SERIAL_TX_BLOCKING
);
}
while
(
0
);
tx_fifo
=
(
struct
rt_serial_tx_fifo
*
)
serial
->
serial_tx
;
RT_ASSERT
(
tx_fifo
!=
RT_NULL
);
rt_free
(
tx_fifo
);
serial
->
serial_tx
=
RT_NULL
;
...
...
@@ -876,6 +877,13 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
RT_ASSERT
(
dev
!=
RT_NULL
);
serial
=
(
struct
rt_serial_device
*
)
dev
;
/* Check that the device has been turned on */
if
((
dev
->
open_flag
)
&
(
15
<<
12
))
{
LOG_D
(
"(%s) serial device has already been opened, it will run in its original configuration"
,
dev
->
parent
.
name
);
return
RT_EOK
;
}
LOG_D
(
"open serial device: 0x%08x with open flag: 0x%04x"
,
dev
,
oflag
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录