From 5a0575e7be1281ebc891a7ff5c4c64a3c405b672 Mon Sep 17 00:00:00 2001 From: brightsally <121477585@qq.com> Date: Tue, 25 Jan 2022 06:35:27 +0000 Subject: [PATCH] =?UTF-8?q?!428=20[at91sam9260=20platform/interrupt.c=20fi?= =?UTF-8?q?x=20"rt=5Finterrupt=5Fdispatch"=20Undefined=20error]=20*=201.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9template.uvproj=E6=96=87=E4=BB=B6=E6=89=80?= =?UTF-8?q?=E4=BC=B4=E9=9A=8F=E7=9A=84=E6=94=B9=E5=8A=A8=20*=201.=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=80=89=E9=A1=B9=E6=8C=87=E5=AE=9AC99=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E8=A7=A3=E5=86=B3=E7=BC=96=E8=AF=91=E9=94=99?= =?UTF-8?q?=E8=AF=AFdeclaration=20may=20not=20appear=20after=20executable?= =?UTF-8?q?=20statem=E2=80=A6=20*=201.=E4=BF=AE=E5=A4=8D=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E5=87=BD=E6=95=B0rt=5Finterrupt=5Fdispatch=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/at91sam9260/platform/interrupt.c | 22 ++++++++++++++++++++++ bsp/at91sam9260/template.uvopt | 13 +++++++++++-- bsp/at91sam9260/template.uvproj | 22 +++++++++++++++++----- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/bsp/at91sam9260/platform/interrupt.c b/bsp/at91sam9260/platform/interrupt.c index dc98fe7c4d..60c4d0790b 100644 --- a/bsp/at91sam9260/platform/interrupt.c +++ b/bsp/at91sam9260/platform/interrupt.c @@ -396,6 +396,28 @@ void rt_hw_interrupt_ack(rt_uint32_t fiq_irq, rt_uint32_t id) at91_sys_write(AT91_AIC_EOICR, 0x0); } +void rt_interrupt_dispatch(rt_uint32_t fiq_irq) +{ + rt_isr_handler_t isr_func; + rt_uint32_t irq; + void *param; + + /* get irq number */ + irq = rt_hw_interrupt_get_active(fiq_irq); + + /* get interrupt service routine */ + isr_func = irq_desc[irq].handler; + param = irq_desc[irq].param; + + /* turn to interrupt service routine */ + isr_func(irq, param); + + rt_hw_interrupt_ack(fiq_irq, irq); +#ifdef RT_USING_INTERRUPT_INFO + irq_desc[irq].counter ++; +#endif +} + #ifdef RT_USING_FINSH #ifdef RT_USING_INTERRUPT_INFO void list_irq(void) diff --git a/bsp/at91sam9260/template.uvopt b/bsp/at91sam9260/template.uvopt index 2dca5102b8..7454a3661d 100644 --- a/bsp/at91sam9260/template.uvopt +++ b/bsp/at91sam9260/template.uvopt @@ -13,6 +13,7 @@ *.txt; *.h; *.inc *.plm *.cpp + 0 @@ -31,6 +32,7 @@ 1 1 0 + 0 1 @@ -108,10 +110,10 @@ 1 1 1 - 1 0 0 - 5 + 1 + 18 @@ -168,6 +170,13 @@ + 0 + 0 + 0 + + + + diff --git a/bsp/at91sam9260/template.uvproj b/bsp/at91sam9260/template.uvproj index c644bc5440..6e4ee85615 100644 --- a/bsp/at91sam9260/template.uvproj +++ b/bsp/at91sam9260/template.uvproj @@ -72,14 +72,18 @@ 0 0 + 0 + 0 - 0 + 1 0 - + fromelf.exe --bin -o $L@L.bin #L 0 0 + 0 + 0 0 @@ -141,10 +145,9 @@ 1 1 1 - 1 0 - 5 + 18 @@ -224,6 +227,7 @@ 0 0 0 + 0 3 3 0 @@ -356,8 +360,15 @@ 2 0 0 - 0 + 1 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 RT_USING_INTERRUPT_INFO @@ -375,6 +386,7 @@ 0 0 0 + 0 -- GitLab