Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
混口饭吃,
rt-thread
提交
97671b12
R
rt-thread
项目概览
混口饭吃,
/
rt-thread
与 Fork 源项目一致
Fork自
Mr_Pangza / 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,发现更多精彩内容 >>
提交
97671b12
编写于
9月 21, 2016
作者:
B
Bernard Xiong
提交者:
GitHub
9月 21, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #663 from AubrCool/master
[BSP] remove c99 code in CAN demo.
上级
27c7ed35
c2d8bff6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
95 addition
and
83 deletion
+95
-83
bsp/lpc408x/applications/canapp.c
bsp/lpc408x/applications/canapp.c
+6
-6
bsp/lpc408x/applications/startup.c
bsp/lpc408x/applications/startup.c
+1
-1
bsp/lpc408x/project.uvprojx
bsp/lpc408x/project.uvprojx
+19
-14
bsp/lpc408x/rtconfig.h
bsp/lpc408x/rtconfig.h
+1
-1
bsp/stm32f10x/applications/canapp.c
bsp/stm32f10x/applications/canapp.c
+13
-13
bsp/stm32f10x/drivers/bxcan.c
bsp/stm32f10x/drivers/bxcan.c
+54
-47
bsp/stm32f10x/project.uvprojx
bsp/stm32f10x/project.uvprojx
+1
-1
未找到文件。
bsp/lpc408x/applications/canapp.c
浏览文件 @
97671b12
...
...
@@ -34,15 +34,15 @@ struct rt_can_filter_item filter1item[4] =
};
struct
rt_can_filter_config
filter1
=
{
.
count
=
4
,
.
actived
=
1
,
.
items
=
filter1item
,
4
,
1
,
filter1item
,
};
static
struct
can_app_struct
can_data
[
1
]
=
{
{
.
name
=
"lpccan1"
,
.
filter
=
&
filter1
,
.
eventopt
=
RT_EVENT_FLAG_OR
|
RT_EVENT_FLAG_CLEAR
,
"lpccan1"
,
&
filter1
,
RT_EVENT_FLAG_OR
|
RT_EVENT_FLAG_CLEAR
,
},
};
static
rt_err_t
lpccanind
(
rt_device_t
dev
,
rt_size_t
size
)
...
...
bsp/lpc408x/applications/startup.c
浏览文件 @
97671b12
...
...
@@ -19,7 +19,7 @@
#include "board.h"
extern
int
rt_application_init
(
void
);
extern
void
sram_init
(
void
);
/**
* This function will startup RT-Thread RTOS.
*/
...
...
bsp/lpc408x/project.uvprojx
浏览文件 @
97671b12
...
...
@@ -361,7 +361,7 @@
<wLevel>
0
</wLevel>
<uThumb>
0
</uThumb>
<uSurpInc>
0
</uSurpInc>
<uC99>
1
</uC99>
<uC99>
0
</uC99>
<useXO>
0
</useXO>
<v6Lang>
0
</v6Lang>
<v6LangP>
0
</v6LangP>
...
...
@@ -369,7 +369,7 @@
<MiscControls></MiscControls>
<Define>
CORE_M4, RT_USING_ARM_LIBC
</Define>
<Undefine></Undefine>
<IncludePath>
Libraries/Device/NXP/LPC407x_8x_177x_8x/Include;Libraries/CMSIS/Include;Libraries/Drivers/include;applications;.;drivers;../../include;../../libcpu/arm/cortex-m4;../../libcpu/arm/common;..
/../components/
pthreads;../../components/libc/armlibc;../../components/drivers/include;../../components/drivers/include;../../components/finsh
</IncludePath>
<IncludePath>
Libraries/Device/NXP/LPC407x_8x_177x_8x/Include;Libraries/CMSIS/Include;Libraries/Drivers/include;applications;.;drivers;../../include;../../libcpu/arm/cortex-m4;../../libcpu/arm/common;..
\..\components\libc\
pthreads;../../components/libc/armlibc;../../components/drivers/include;../../components/drivers/include;../../components/finsh
</IncludePath>
</VariousControls>
</Cads>
<Aads>
...
...
@@ -607,6 +607,11 @@
<FileType>
1
</FileType>
<FilePath>
.\drivers\drv_lpccan.c
</FilePath>
</File>
<File>
<FileName>
drv_sdram.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
.\drivers\drv_sdram.c
</FilePath>
</File>
</Files>
</Group>
<Group>
...
...
@@ -720,62 +725,62 @@
<File>
<FileName>
clock_time.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
clock_time.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
clock_time.c
</FilePath>
</File>
<File>
<FileName>
mqueue.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
mqueue.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
mqueue.c
</FilePath>
</File>
<File>
<FileName>
pthread.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread.c
</FilePath>
</File>
<File>
<FileName>
pthread_attr.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread_attr.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread_attr.c
</FilePath>
</File>
<File>
<FileName>
pthread_barrier.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread_barrier.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread_barrier.c
</FilePath>
</File>
<File>
<FileName>
pthread_cond.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread_cond.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread_cond.c
</FilePath>
</File>
<File>
<FileName>
pthread_mutex.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread_mutex.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread_mutex.c
</FilePath>
</File>
<File>
<FileName>
pthread_rwlock.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread_rwlock.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread_rwlock.c
</FilePath>
</File>
<File>
<FileName>
pthread_spin.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread_spin.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread_spin.c
</FilePath>
</File>
<File>
<FileName>
pthread_tls.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
pthread_tls.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
pthread_tls.c
</FilePath>
</File>
<File>
<FileName>
sched.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
sched.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
sched.c
</FilePath>
</File>
<File>
<FileName>
semaphore.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..
/../components/pthreads/
semaphore.c
</FilePath>
<FilePath>
..
\..\components\libc\pthreads\
semaphore.c
</FilePath>
</File>
</Files>
</Group>
...
...
bsp/lpc408x/rtconfig.h
浏览文件 @
97671b12
...
...
@@ -151,7 +151,7 @@
// </section>
// <section name="RT_USING_LWIP" description="lwip, a lightweight TCP/IP protocol stack" default="true" >
#define RT_USING_LWIP
//
#define RT_USING_LWIP
// <bool name="RT_LWIP_ICMP" description="Enable ICMP protocol" default="true" />
#define RT_LWIP_ICMP
// <bool name="RT_LWIP_IGMP" description="Enable IGMP protocol" default="false" />
...
...
bsp/stm32f10x/applications/canapp.c
浏览文件 @
97671b12
...
...
@@ -120,9 +120,9 @@ INIT_DEVICE_EXPORT(can_bus_hook_init);
struct
can_app_struct
{
const
char
*
name
;
struct
rt_event
event
;
struct
rt_can_filter_config
*
filter
;
rt_uint8_t
eventopt
;
struct
rt_event
event
;
};
static
struct
can_app_struct
can_data
[
2
];
static
rt_err_t
can1ind
(
rt_device_t
dev
,
void
*
args
,
rt_int32_t
hdr
,
rt_size_t
size
)
...
...
@@ -153,27 +153,27 @@ struct rt_can_filter_item filter2item[4] =
};
struct
rt_can_filter_config
filter1
=
{
.
count
=
4
,
.
actived
=
1
,
.
items
=
filter1item
,
4
,
1
,
filter1item
,
};
struct
rt_can_filter_config
filter2
=
{
.
count
=
4
,
.
actived
=
1
,
.
items
=
filter2item
,
4
,
1
,
filter2item
,
};
static
struct
can_app_struct
can_data
[
2
]
=
{
{
.
name
=
"bxcan1"
,
.
filter
=
&
filter1
,
.
eventopt
=
RT_EVENT_FLAG_OR
|
RT_EVENT_FLAG_CLEAR
,
"bxcan1"
,
&
filter1
,
RT_EVENT_FLAG_OR
|
RT_EVENT_FLAG_CLEAR
,
},
{
.
name
=
"bxcan2"
,
.
filter
=
&
filter2
,
.
eventopt
=
RT_EVENT_FLAG_AND
|
RT_EVENT_FLAG_CLEAR
,
"bxcan2"
,
&
filter2
,
RT_EVENT_FLAG_AND
|
RT_EVENT_FLAG_CLEAR
,
},
};
void
rt_can_thread_entry
(
void
*
parameter
)
...
...
bsp/stm32f10x/drivers/bxcan.c
浏览文件 @
97671b12
...
...
@@ -20,6 +20,7 @@
#endif
#ifdef RT_USING_CAN
#define inline __inline
#ifndef STM32F10X_CL
#define BX_CAN_FMRNUMBER 14
#define BX_CAN2_FMRSTART 7
...
...
@@ -849,6 +850,12 @@ static rt_err_t bxmodifyfilter(struct stm_bxcan *pbxcan, struct rt_can_filter_it
rt_int32_t
fcase
;
rt_err_t
res
;
rt_int32_t
hdr
,
fbase
,
foff
;
rt_uint32_t
ID
[
2
];
rt_uint32_t
shift
;
rt_uint32_t
thisid
;
rt_uint32_t
thismask
;
CAN_FilterInitTypeDef
CAN_FilterInitStructure
;
CAN_FilterRegister_TypeDef
*
pfilterreg
;
fcase
=
(
pitem
->
mode
|
(
pitem
->
ide
<<
1
));
hdr
=
bxcanfindfilter
(
pbxcan
,
pitem
,
fcase
,
&
fbase
,
&
foff
);
...
...
@@ -894,14 +901,9 @@ static rt_err_t bxmodifyfilter(struct stm_bxcan *pbxcan, struct rt_can_filter_it
return
RT_EBUSY
;
}
}
rt_uint32_t
ID
[
2
];
rt_uint32_t
shift
;
rt_uint32_t
thisid
;
rt_uint32_t
thismask
;
CAN_FilterInitTypeDef
CAN_FilterInitStructure
;
pitem
->
hdr
=
hdr
;
CAN_FilterRegister_TypeDef
*
pfilterreg
=
&
((
CAN_FilterRegister_TypeDef
*
)
pbxcan
->
mfrbase
)[
fbase
];
pfilterreg
=
&
((
CAN_FilterRegister_TypeDef
*
)
pbxcan
->
mfrbase
)[
fbase
];
ID
[
0
]
=
pfilterreg
->
FR1
;
ID
[
1
]
=
pfilterreg
->
FR2
;
CAN_FilterInitStructure
.
CAN_FilterNumber
=
(
pfilterreg
-
&
CAN1
->
sFilterRegister
[
0
]);
...
...
@@ -1152,7 +1154,6 @@ static rt_err_t control(struct rt_can_device *can, int cmd, void *arg)
break
;
case
RT_CAN_CMD_SET_FILTER
:
return
setfilter
(
pbxcan
,
(
struct
rt_can_filter_config
*
)
arg
);
break
;
case
RT_CAN_CMD_SET_MODE
:
argval
=
(
rt_uint32_t
)
arg
;
if
(
argval
!=
RT_CAN_MODE_NORMAL
||
...
...
@@ -1306,27 +1307,30 @@ static const struct rt_can_ops canops =
#ifdef USING_BXCAN1
static
struct
stm_bxcan
bxcan1data
=
{
.
reg
=
CAN1
,
.
mfrbase
=
(
void
*
)
&
CAN1
->
sFilterRegister
[
0
],
.
sndirq
=
CAN1_TX_IRQn
,
.
rcvirq0
=
CAN1_RX0_IRQn
,
.
rcvirq1
=
CAN1_RX1_IRQn
,
.
errirq
=
CAN1_SCE_IRQn
,
.
alocmask
=
{
0
,
0
},
.
filtercnt
=
BX_CAN2_FMRSTART
,
.
fifo1filteroff
=
7
,
.
filtermap
=
{
[
0
]
=
{
.
id32mask_cnt
=
0
,
.
id32bit_cnt
=
0
,
.
id16mask_cnt
=
2
,
.
id16bit_cnt
=
24
,
CAN1
,
(
void
*
)
&
CAN1
->
sFilterRegister
[
0
],
CAN1_TX_IRQn
,
CAN1_RX0_IRQn
,
CAN1_RX1_IRQn
,
CAN1_SCE_IRQn
,
{
0
,
},
{
0
,
0
},
BX_CAN2_FMRSTART
,
7
,
{
{
0
,
0
,
2
,
24
,
},
[
1
]
=
{
.
id32mask_cnt
=
0
,
.
id32bit_cnt
=
0
,
.
id16mask_cnt
=
2
,
.
id16bit_cnt
=
24
,
{
0
,
0
,
2
,
24
,
},
},
};
...
...
@@ -1444,27 +1448,30 @@ void CAN1_SCE_IRQHandler(void)
#ifdef USING_BXCAN2
static
struct
stm_bxcan
bxcan2data
=
{
.
reg
=
CAN2
,
.
mfrbase
=
(
void
*
)
&
CAN1
->
sFilterRegister
[
BX_CAN2_FMRSTART
],
.
sndirq
=
CAN2_TX_IRQn
,
.
rcvirq0
=
CAN2_RX0_IRQn
,
.
rcvirq1
=
CAN2_RX1_IRQn
,
.
errirq
=
CAN2_SCE_IRQn
,
.
alocmask
=
{
0
,
0
},
.
filtercnt
=
BX_CAN_FMRNUMBER
-
BX_CAN2_FMRSTART
,
.
fifo1filteroff
=
7
,
.
filtermap
=
{
[
0
]
=
{
.
id32mask_cnt
=
0
,
.
id32bit_cnt
=
0
,
.
id16mask_cnt
=
2
,
.
id16bit_cnt
=
24
,
CAN2
,
(
void
*
)
&
CAN1
->
sFilterRegister
[
BX_CAN2_FMRSTART
],
CAN2_TX_IRQn
,
CAN2_RX0_IRQn
,
CAN2_RX1_IRQn
,
CAN2_SCE_IRQn
,
{
0
,
}
{
0
,
0
},
BX_CAN_FMRNUMBER
-
BX_CAN2_FMRSTART
,
7
,
{
{
0
,
0
,
2
,
24
,
},
[
1
]
=
{
.
id32mask_cnt
=
0
,
.
id32bit_cnt
=
0
,
.
id16mask_cnt
=
2
,
.
id16bit_cnt
=
24
,
{
0
,
0
,
2
,
24
,
},
},
};
...
...
bsp/stm32f10x/project.uvprojx
浏览文件 @
97671b12
...
...
@@ -361,7 +361,7 @@
<wLevel>
0
</wLevel>
<uThumb>
0
</uThumb>
<uSurpInc>
0
</uSurpInc>
<uC99>
1
</uC99>
<uC99>
0
</uC99>
<useXO>
0
</useXO>
<v6Lang>
0
</v6Lang>
<v6LangP>
0
</v6LangP>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录