summaryrefslogtreecommitdiff
path: root/openpicc/application/ssc_picc.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-14 05:28:05 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-14 05:28:05 +0000
commit8dc345999942b1f213f54c2ce4f2878abdabac4a (patch)
treeda82d2cd90d043f2475b0d584869115fce349296 /openpicc/application/ssc_picc.c
parent3fb02f719f0bea99548a6bc7fe7c37e9d25ce800 (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/ssc_picc.c')
-rw-r--r--openpicc/application/ssc_picc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c
index 4d21644..9818296 100644
--- a/openpicc/application/ssc_picc.c
+++ b/openpicc/application/ssc_picc.c
@@ -313,9 +313,8 @@ static int8_t ssc_rx_refill(void)
#define ISO14443A_FDT_SHORT_1 1236
#define ISO14443A_FDT_SHORT_0 1172
-static void __ramfunc ssc_irq(void)
+static void __ramfunc ssc_irq_inner(void)
{
- portSAVE_CONTEXT();
u_int32_t ssc_sr = ssc->SSC_SR;
// int i, *tmp, emptyframe = 0;
DEBUGP("ssc_sr=0x%08x, mode=%u: ", ssc_sr, ssc_state.mode);
@@ -453,6 +452,12 @@ static void __ramfunc ssc_irq(void)
#endif
DEBUGPCR("I");
AT91F_AIC_ClearIt(AT91C_ID_SSC);
+}
+
+static void __ramfunc ssc_irq_outer(void) __attribute__ ((naked));
+static void __ramfunc ssc_irq_outer(void) {
+ portSAVE_CONTEXT();
+ ssc_irq_inner();
portRESTORE_CONTEXT();
}
@@ -546,7 +551,7 @@ void ssc_rx_init(void)
AT91F_AIC_ConfigureIt(AT91C_ID_SSC,
OPENPICC_IRQ_PRIO_SSC,
- AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, (THandler)&ssc_irq);
+ AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, (THandler)&ssc_irq_outer);
/* don't divide clock inside SSC, we do that in tc_cdiv */
ssc->SSC_CMR = 0;
personal git repositories of Harald Welte. Your mileage may vary