Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
cc6b2906
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cc6b2906
编写于
5月 04, 2015
作者:
A
ardafu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.[bsp][sam9260] Modify the define of irq get and ack function.
上级
a13132b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
52 deletion
+41
-52
bsp/at91sam9260/platform/interrupt.c
bsp/at91sam9260/platform/interrupt.c
+26
-43
bsp/at91sam9260/platform/interrupt.h
bsp/at91sam9260/platform/interrupt.h
+15
-9
未找到文件。
bsp/at91sam9260/platform/interrupt.c
浏览文件 @
cc6b2906
...
...
@@ -146,7 +146,7 @@ void at91_aic_init(rt_uint32_t *priority)
*/
for
(
i
=
0
;
i
<
AIC_IRQS
;
i
++
)
{
/* Put irq number in Source Vector Register: */
at91_sys_write
(
AT91_AIC_SVR
(
i
),
i
);
at91_sys_write
(
AT91_AIC_SVR
(
i
),
i
);
// no-used
/* Active Low interrupt, with the specified priority */
at91_sys_write
(
AT91_AIC_SMR
(
i
),
AT91_AIC_SRCTYPE_LOW
|
priority
[
i
]);
//AT91_AIC_SRCTYPE_FALLING
...
...
@@ -201,12 +201,11 @@ static void at91_gpio_irq_init()
*/
void
rt_hw_interrupt_init
(
void
)
{
rt_int32_t
i
;
register
rt_uint32_t
idx
;
rt_uint32_t
*
priority
=
at91sam9260_default_irq_priority
;
at91_extern_irq
=
(
1
<<
AT91SAM9260_ID_IRQ0
)
|
(
1
<<
AT91SAM9260_ID_IRQ1
)
|
(
1
<<
AT91SAM9260_ID_IRQ2
);
at91_extern_irq
=
(
1
UL
<<
AT91SAM9260_ID_IRQ0
)
|
(
1UL
<<
AT91SAM9260_ID_IRQ1
)
|
(
1
UL
<<
AT91SAM9260_ID_IRQ2
);
/* Initialize the AIC interrupt controller */
at91_aic_init
(
priority
);
...
...
@@ -341,7 +340,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
/*@}*/
/*
static int at91_aic_set_type(unsigned irq, unsigned type)
{
unsigned int smr, srctype;
...
...
@@ -354,13 +353,15 @@ static int at91_aic_set_type(unsigned irq, unsigned type)
srctype = AT91_AIC_SRCTYPE_RISING;
break;
case IRQ_TYPE_LEVEL_LOW:
if
((
irq
==
AT91_ID_FIQ
)
||
is_extern_irq
(
irq
))
/* only supported on external interrupts */
// only supported on external interrupts
if ((irq == AT91_ID_FIQ) || is_extern_irq(irq))
srctype = AT91_AIC_SRCTYPE_LOW;
else
return -1;
break;
case IRQ_TYPE_EDGE_FALLING:
if
((
irq
==
AT91_ID_FIQ
)
||
is_extern_irq
(
irq
))
/* only supported on external interrupts */
// only supported on external interrupts
if ((irq == AT91_ID_FIQ) || is_extern_irq(irq))
srctype = AT91_AIC_SRCTYPE_FALLING;
else
return -1;
...
...
@@ -373,54 +374,36 @@ static int at91_aic_set_type(unsigned irq, unsigned type)
at91_sys_write(AT91_AIC_SMR(irq), smr | srctype);
return 0;
}
rt_uint32_t
rt_hw_interrupt_get_active
(
rt_uint32_t
fiq_irq
,
rt_uint32_t
*
id
)
*/
rt_uint32_t
rt_hw_interrupt_get_active
(
rt_uint32_t
fiq_irq
)
{
rt_uint32_t
irqstat
;
//volatile rt_uint32_t irqstat;
rt_uint32_t
id
;
if
(
fiq_irq
==
INT_FIQ
)
{
*
id
=
0
;
}
else
//IRQ
{
/* get irq number */
*
id
=
(
rt_uint32_t
)
at91_sys_read
(
AT91_AIC_IVR
);
/* clear pending register */
irqstat
=
(
rt_uint32_t
)
at91_sys_read
(
AT91_AIC_ISR
);
}
return
0
;
return
irqstat
;
//IRQ
/* AIC need this dummy read */
at91_sys_read
(
AT91_AIC_IVR
);
/* clear pending register */
id
=
at91_sys_read
(
AT91_AIC_ISR
);
return
id
;
}
void
rt_hw_interrupt_ack
(
rt_uint32_t
fiq_irq
)
void
rt_hw_interrupt_ack
(
rt_uint32_t
fiq_irq
,
rt_uint32_t
id
)
{
/* new FIQ generation */
if
(
fiq_irq
==
INT_FIQ
)
{
/* new FIQ generation */
return
;
}
else
{
// EIOCR must be write any value after interrupt,
/* new IRQ generation */
// EIOCR must be write any value after interrupt,
// or else can't response next interrupt
/* new IRQ generation */
at91_sys_write
(
AT91_AIC_EOICR
,
0x55555555
);
}
at91_sys_write
(
AT91_AIC_EOICR
,
0x0
);
}
#ifdef RT_USING_FINSH
void
list_irq
(
void
)
{
...
...
bsp/at91sam9260/platform/interrupt.h
浏览文件 @
cc6b2906
/*
* File : interrupt.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 20
11
, RT-Thread Development Team
* COPYRIGHT (C) 20
06 - 2015
, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 201
3-07-06 Bernard
first version
* 201
5-04-14 ArdaFu
first version
*/
#ifndef __INTERRUPT_H__
#define __INTERRUPT_H__
...
...
@@ -19,7 +28,4 @@
#define INT_FIQ 0x01
rt_uint32_t
rt_hw_interrupt_get_active
(
rt_uint32_t
fiq_irq
,
rt_uint32_t
*
id
);
void
rt_hw_interrupt_ack
(
rt_uint32_t
fiq_irq
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录