summaryrefslogtreecommitdiff
path: root/openpicc/application/ssc_picc.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-06 19:38:50 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-06 19:38:50 +0000
commitdc75722228b0c63666103613d742b769d5523531 (patch)
treed90c6b89e94b0a84e8f5b01f6068666dff51775d /openpicc/application/ssc_picc.c
parent45af06edee7ea828af9e6e3862e53456489feb1a (diff)
Fix stupid buffer leakage code in standard mode
git-svn-id: https://svn.openpcd.org:2342/trunk@376 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/ssc_picc.c')
-rw-r--r--openpicc/application/ssc_picc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c
index 55f8978..9f0630f 100644
--- a/openpicc/application/ssc_picc.c
+++ b/openpicc/application/ssc_picc.c
@@ -193,6 +193,7 @@ static ssc_dma_rx_buffer_t* __ramfunc __ssc_rx_unload(int secondary)
} else {
AT91F_PDC_SetRx(rx_pdc, 0, 0);
}
+ if(buffer->state == PENDING) buffer->state = FREE;
ssc_state.buffer[secondary] = NULL;
return buffer;
@@ -414,7 +415,7 @@ static void __ramfunc ssc_irq(void)
ssc_state.buffer[0] = ssc_state.buffer[1];
ssc_state.buffer[1] = NULL;
if(ssc_state.mode == SSC_MODE_EDGE_ONE_SHOT || ssc_state.mode == SSC_MODE_14443A_SHORT
- || ssc_state.mode == SSC_MODE_14443A_SHORT) {
+ || ssc_state.mode == SSC_MODE_14443A_STANDARD) {
// Stop sampling here
ssc_rx_stop();
} else {
@@ -428,13 +429,13 @@ static void __ramfunc ssc_irq(void)
//gaportEXIT_CRITICAL();
task_woken = xQueueSendFromISR(ssc_rx_queue, &ssc_state.buffer[0], task_woken);
}
- if (__ssc_rx_load(0) == -1)
+ if(ssc_sr & AT91C_SSC_RXENA) if (__ssc_rx_load(0) == -1)
AT91F_SSC_DisableIt(ssc, AT91C_SSC_ENDRX |
AT91C_SSC_RXBUFF |
AT91C_SSC_OVRUN);
}
- if (__ssc_rx_load(1) == -1)
+ if(ssc_sr & AT91C_SSC_RXENA) if (__ssc_rx_load(1) == -1)
AT91F_SSC_DisableIt(ssc, AT91C_SSC_ENDRX |
AT91C_SSC_RXBUFF |
AT91C_SSC_OVRUN);
personal git repositories of Harald Welte. Your mileage may vary