Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2345VOR
rt-thread
提交
c8d92d75
R
rt-thread
项目概览
2345VOR
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c8d92d75
编写于
6月 15, 2022
作者:
C
cmbjxxiao
提交者:
GitHub
6月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs of hc32 driver adc and can (#6077)
* fix bugs of hc32 driver adc and can
上级
14cd8d01
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
7 deletion
+16
-7
bsp/hc32/ev_hc32f4a0_lqfp176/board/Kconfig
bsp/hc32/ev_hc32f4a0_lqfp176/board/Kconfig
+1
-1
bsp/hc32/libraries/hc32_drivers/drv_adc.c
bsp/hc32/libraries/hc32_drivers/drv_adc.c
+5
-4
bsp/hc32/libraries/hc32_drivers/drv_can.c
bsp/hc32/libraries/hc32_drivers/drv_can.c
+10
-2
未找到文件。
bsp/hc32/ev_hc32f4a0_lqfp176/board/Kconfig
浏览文件 @
c8d92d75
...
...
@@ -237,7 +237,7 @@ menu "On-chip Peripheral Drivers"
bool "Enable CAN"
default n
select RT_USING_CAN
select
BSP_USING_TCA9539
select
RT_CAN_USING_HDR
if BSP_USING_CAN
config BSP_USING_CAN1
bool "using can1"
...
...
bsp/hc32/libraries/hc32_drivers/drv_adc.c
浏览文件 @
c8d92d75
...
...
@@ -8,6 +8,7 @@
* Date Author Notes
* 2022-04-28 CDT first version
* 2022-06-08 xiaoxiaolisunny add hc32f460 series
* 2022-06-14 CDT fix a bug of internal trigger
*/
#include <board.h>
...
...
@@ -128,8 +129,8 @@ static void _adc_internal_trigger1_set(adc_device *p_adc_dev)
default:
break
;
}
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG1
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
0
_comtrg0_enable
);
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG2
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
0
_comtrg1_enable
);
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG1
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
1
_comtrg0_enable
);
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG2
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
1
_comtrg1_enable
);
#endif
#if defined(HC32F460)
...
...
@@ -144,8 +145,8 @@ static void _adc_internal_trigger1_set(adc_device *p_adc_dev)
default:
break
;
}
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG1
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
0
_comtrg0_enable
);
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG2
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
0
_comtrg1_enable
);
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG1
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
1
_comtrg0_enable
);
AOS_CommonTriggerCmd
(
u32TriggerSel
,
AOS_COMM_TRIG2
,
(
en_functional_state_t
)
p_adc_dev
->
init
.
internal_trig
1
_comtrg1_enable
);
#endif
AOS_SetTriggerEventSrc
(
u32TriggerSel
,
p_adc_dev
->
init
.
internal_trig1_sel
);
}
...
...
bsp/hc32/libraries/hc32_drivers/drv_can.c
浏览文件 @
c8d92d75
...
...
@@ -8,6 +8,7 @@
* Date Author Notes
* 2022-04-28 CDT first version
* 2022-06-07 xiaoxiaolisunny add hc32f460 series
* 2022-06-08 CDT fix a bug of RT_CAN_CMD_SET_FILTER
*/
#include "drv_can.h"
...
...
@@ -274,7 +275,14 @@ static rt_err_t _can_control(struct rt_can_device *can, int cmd, void *arg)
{
p_can_dev
->
ll_init
.
pstcFilter
[
i
].
u32ID
=
filter_cfg
->
items
[
i
].
id
;
p_can_dev
->
ll_init
.
pstcFilter
[
i
].
u32IDMask
=
filter_cfg
->
items
[
i
].
mask
;
p_can_dev
->
ll_init
.
pstcFilter
[
i
].
u32IDType
=
filter_cfg
->
items
[
i
].
ide
;
if
(
filter_cfg
->
items
[
i
].
ide
==
RT_CAN_STDID
)
{
p_can_dev
->
ll_init
.
pstcFilter
[
i
].
u32IDType
=
CAN_ID_STD
;
}
else
{
p_can_dev
->
ll_init
.
pstcFilter
[
i
].
u32IDType
=
CAN_ID_EXT
;
}
}
}
(
void
)
CAN_Init
(
p_can_dev
->
instance
,
&
p_can_dev
->
ll_init
);
...
...
@@ -623,7 +631,7 @@ int rt_hw_can_init(void)
g_can_dev_array
[
i
].
ll_init
.
u16FilterSelect
=
CAN_FILTER1
;
g_can_dev_array
[
i
].
rt_can
.
config
=
rt_can_config
;
/* register CAN
1
device */
/* register CAN device */
rt_hw_board_can_init
(
g_can_dev_array
[
i
].
instance
);
rt_hw_can_register
(
&
g_can_dev_array
[
i
].
rt_can
,
g_can_dev_array
[
i
].
init
.
name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录