Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
宁楠萍
rt-thread
提交
40123f09
R
rt-thread
项目概览
宁楠萍
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
40123f09
编写于
6月 09, 2015
作者:
A
Aubr.Cool
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
correct bxcan drive errors
上级
c3e4fd07
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
bsp/stm32f10x/drivers/bxcan.c
bsp/stm32f10x/drivers/bxcan.c
+15
-15
未找到文件。
bsp/stm32f10x/drivers/bxcan.c
浏览文件 @
40123f09
...
@@ -139,7 +139,7 @@ static void bxcan2_filter_init(struct rt_can_device *can)
...
@@ -139,7 +139,7 @@ static void bxcan2_filter_init(struct rt_can_device *can)
CAN1
->
FMR
|=
FMR_FINIT
;
CAN1
->
FMR
|=
FMR_FINIT
;
mask
=
0x01
<<
(
i
+
0
);
mask
=
0x01
<<
(
i
+
0
);
off
=
i
-
BX_CAN2_FMRSTART
;
off
=
i
-
BX_CAN2_FMRSTART
;
if
(
i
<
pbxcan
->
fifo1filteroff
)
{
if
(
off
<
pbxcan
->
fifo1filteroff
)
{
if
(
pbxcan
->
filtermap
[
0
].
id32mask_cnt
&&
off
<
pbxcan
->
filtermap
[
0
].
id32mask_cnt
)
{
if
(
pbxcan
->
filtermap
[
0
].
id32mask_cnt
&&
off
<
pbxcan
->
filtermap
[
0
].
id32mask_cnt
)
{
CAN1
->
FS1R
|=
mask
;
CAN1
->
FS1R
|=
mask
;
CAN1
->
FM1R
&=
~
mask
;
CAN1
->
FM1R
&=
~
mask
;
...
@@ -586,7 +586,7 @@ static rt_int32_t bxcanfindfilter(struct stm_bxcan *pbxcan,struct rt_can_filter_
...
@@ -586,7 +586,7 @@ static rt_int32_t bxcanfindfilter(struct stm_bxcan *pbxcan,struct rt_can_filter_
if
(
pitem
->
rtr
)
{
if
(
pitem
->
rtr
)
{
thisid
|=
CAN_RTR_REMOTE
;
thisid
|=
CAN_RTR_REMOTE
;
}
}
if
((
off
==
0
&&
pfilterreg
->
FR1
==
thisid
)
||
if
((
*
off
==
0
&&
pfilterreg
->
FR1
==
thisid
)
||
(
*
off
==
1
&&
pfilterreg
->
FR2
==
thisid
)
(
*
off
==
1
&&
pfilterreg
->
FR2
==
thisid
)
)
{
)
{
found
=
1
;
found
=
1
;
...
@@ -959,14 +959,14 @@ static rt_err_t control(struct rt_can_device *can, int cmd, void *arg)
...
@@ -959,14 +959,14 @@ static rt_err_t control(struct rt_can_device *can, int cmd, void *arg)
break
;
break
;
case
RT_CAN_CMD_SET_BAUD
:
case
RT_CAN_CMD_SET_BAUD
:
argval
=
(
rt_uint32_t
)
arg
;
argval
=
(
rt_uint32_t
)
arg
;
if
(
argval
!=
CAN1MBaud
||
if
(
argval
!=
CAN1MBaud
&&
argval
!=
CAN800kBaud
||
argval
!=
CAN800kBaud
&&
argval
!=
CAN500kBaud
||
argval
!=
CAN500kBaud
&&
argval
!=
CAN250kBaud
||
argval
!=
CAN250kBaud
&&
argval
!=
CAN125kBaud
||
argval
!=
CAN125kBaud
&&
argval
!=
CAN100kBaud
||
argval
!=
CAN100kBaud
&&
argval
!=
CAN50kBaud
||
argval
!=
CAN50kBaud
&&
argval
!=
CAN20kBaud
||
argval
!=
CAN20kBaud
&&
argval
!=
CAN10kBaud
)
{
argval
!=
CAN10kBaud
)
{
return
RT_ERROR
;
return
RT_ERROR
;
}
}
...
@@ -1063,7 +1063,7 @@ static int recvmsg(struct rt_can_device *can, void* buf, rt_uint32_t boxno)
...
@@ -1063,7 +1063,7 @@ static int recvmsg(struct rt_can_device *can, void* buf, rt_uint32_t boxno)
pmsg
->
id
=
(
uint32_t
)
0x1FFFFFFF
&
(
pbxcan
->
sFIFOMailBox
[
boxno
].
RIR
>>
3
);
pmsg
->
id
=
(
uint32_t
)
0x1FFFFFFF
&
(
pbxcan
->
sFIFOMailBox
[
boxno
].
RIR
>>
3
);
}
}
pmsg
->
rtr
=
(
(
uint8_t
)
0x02
&
pbxcan
->
sFIFOMailBox
[
boxno
].
RIR
)
>>
1
;
pmsg
->
rtr
=
(
uint8_t
)
((
0x02
&
pbxcan
->
sFIFOMailBox
[
boxno
].
RIR
)
>>
1
)
;
pmsg
->
len
=
(
uint8_t
)
0x0F
&
pbxcan
->
sFIFOMailBox
[
boxno
].
RDTR
;
pmsg
->
len
=
(
uint8_t
)
0x0F
&
pbxcan
->
sFIFOMailBox
[
boxno
].
RDTR
;
pmsg
->
data
[
0
]
=
(
uint8_t
)
0xFF
&
pbxcan
->
sFIFOMailBox
[
boxno
].
RDLR
;
pmsg
->
data
[
0
]
=
(
uint8_t
)
0xFF
&
pbxcan
->
sFIFOMailBox
[
boxno
].
RDLR
;
pmsg
->
data
[
1
]
=
(
uint8_t
)
0xFF
&
(
pbxcan
->
sFIFOMailBox
[
boxno
].
RDLR
>>
8
);
pmsg
->
data
[
1
]
=
(
uint8_t
)
0xFF
&
(
pbxcan
->
sFIFOMailBox
[
boxno
].
RDLR
>>
8
);
...
@@ -1127,7 +1127,7 @@ static struct stm_bxcan bxcan1data =
...
@@ -1127,7 +1127,7 @@ static struct stm_bxcan bxcan1data =
struct
rt_can_device
bxcan1
;
struct
rt_can_device
bxcan1
;
void
CAN1_RX0_IRQHandler
(
void
)
void
CAN1_RX0_IRQHandler
(
void
)
{
{
while
(
CAN1
->
RF0R
&
0x11
)
if
(
CAN1
->
RF0R
&
0x11
)
{
{
if
((
CAN1
->
RF0R
&
CAN_RF0R_FOVR0
)
!=
0
)
if
((
CAN1
->
RF0R
&
CAN_RF0R_FOVR0
)
!=
0
)
{
{
...
@@ -1141,7 +1141,7 @@ void CAN1_RX0_IRQHandler(void)
...
@@ -1141,7 +1141,7 @@ void CAN1_RX0_IRQHandler(void)
}
}
void
CAN1_RX1_IRQHandler
(
void
)
void
CAN1_RX1_IRQHandler
(
void
)
{
{
while
(
CAN1
->
RF1R
&
0x11
)
if
(
CAN1
->
RF1R
&
0x11
)
{
{
if
((
CAN1
->
RF1R
&
CAN_RF1R_FOVR1
)
!=
0
)
if
((
CAN1
->
RF1R
&
CAN_RF1R_FOVR1
)
!=
0
)
{
{
...
@@ -1262,7 +1262,7 @@ static struct stm_bxcan bxcan2data =
...
@@ -1262,7 +1262,7 @@ static struct stm_bxcan bxcan2data =
struct
rt_can_device
bxcan2
;
struct
rt_can_device
bxcan2
;
void
CAN2_RX0_IRQHandler
(
void
)
void
CAN2_RX0_IRQHandler
(
void
)
{
{
while
(
CAN2
->
RF0R
&
0x11
)
if
(
CAN2
->
RF0R
&
0x11
)
{
{
if
((
CAN2
->
RF0R
&
CAN_RF0R_FOVR0
)
!=
0
)
if
((
CAN2
->
RF0R
&
CAN_RF0R_FOVR0
)
!=
0
)
{
{
...
@@ -1276,7 +1276,7 @@ void CAN2_RX0_IRQHandler(void)
...
@@ -1276,7 +1276,7 @@ void CAN2_RX0_IRQHandler(void)
}
}
void
CAN2_RX1_IRQHandler
(
void
)
void
CAN2_RX1_IRQHandler
(
void
)
{
{
while
(
CAN2
->
RF1R
&
0x11
)
if
(
CAN2
->
RF1R
&
0x11
)
{
{
if
((
CAN2
->
RF1R
&
CAN_RF1R_FOVR1
)
!=
0
)
if
((
CAN2
->
RF1R
&
CAN_RF1R_FOVR1
)
!=
0
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录