diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-14 05:28:05 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-14 05:28:05 +0000 |
commit | 8dc345999942b1f213f54c2ce4f2878abdabac4a (patch) | |
tree | da82d2cd90d043f2475b0d584869115fce349296 /openpicc/application/tc_fdt.c | |
parent | 3fb02f719f0bea99548a6bc7fe7c37e9d25ce800 (diff) |
Rewrite irq handlers according to the new information in http://www.freertos.org/portsam7xlwIP.html: /* Call the handler function. This must be a separate function unless you can guarantee that
handling the interrupt will never use any stack space. */
git-svn-id: https://svn.openpcd.org:2342/trunk@327 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/tc_fdt.c')
-rw-r--r-- | openpicc/application/tc_fdt.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/openpicc/application/tc_fdt.c b/openpicc/application/tc_fdt.c index 0193863..179ea98 100644 --- a/openpicc/application/tc_fdt.c +++ b/openpicc/application/tc_fdt.c @@ -55,9 +55,8 @@ void tc_frame_end_set(u_int16_t count) tcfdt->TC_RB = count; } -static void tc_fdt_irq(void) +static void tc_fdt_irq_inner(void) { - portSAVE_CONTEXT(); vLedSetGreen(1); u_int32_t sr = tcfdt->TC_SR; DEBUGP("tc_fdt_irq: TC2_SR=0x%08x TC2_CV=0x%08x ", @@ -84,6 +83,12 @@ static void tc_fdt_irq(void) DEBUGPCR(""); AT91F_AIC_AcknowledgeIt(); vLedSetGreen(0); +} + +static void tc_fdt_irq_outer(void) __attribute__ ((naked)); +static void tc_fdt_irq_outer(void) { + portSAVE_CONTEXT(); + tc_fdt_irq_inner(); portRESTORE_CONTEXT(); } @@ -125,7 +130,7 @@ void tc_fdt_init(void) AT91F_AIC_ConfigureIt(AT91C_ID_TC2, OPENPCD_IRQ_PRIO_TC_FDT, - AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &tc_fdt_irq); + AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, &tc_fdt_irq_outer); AT91F_AIC_EnableIt(AT91C_ID_TC2); tcfdt->TC_IER = AT91C_TC_CPAS | AT91C_TC_CPBS | AT91C_TC_CPCS | |