summaryrefslogtreecommitdiff
path: root/openpicc/application/ssc.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-03 20:56:30 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-03 20:56:30 +0000
commit440a95fcf18a3504ec06b0e90a660b5f8e184cde (patch)
treea3fe39164de35d6d1eaace78e9b206d98371bf57 /openpicc/application/ssc.c
parentd3bab6e9439b7161b7724df0cc902f4adcf1ecce (diff)
Sending seems to be reliable now.
Once in a while (about 1 in 20) there's an error condition that's not being recovered from, need to investigate git-svn-id: https://svn.openpcd.org:2342/trunk@438 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/ssc.c')
-rw-r--r--openpicc/application/ssc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/openpicc/application/ssc.c b/openpicc/application/ssc.c
index 5603256..50d416b 100644
--- a/openpicc/application/ssc.c
+++ b/openpicc/application/ssc.c
@@ -192,7 +192,7 @@ static int __ramfunc _ssc_tx_irq(u_int32_t sr, portBASE_TYPE task_woken)
{
ssc_handle_t *sh = &_ssc;
- if( sr & AT91C_SSC_ENDTX ) {
+ if( sr & AT91C_SSC_TXEMPTY ) {
/* Tx has ended */
AT91F_PDC_DisableTx(sh->pdc);
AT91F_SSC_DisableTx(sh->ssc);
@@ -656,16 +656,16 @@ int ssc_send(ssc_handle_t* sh, ssc_dma_tx_buffer_t *buffer)
sh->ssc->SSC_TFMR = ((data_len-1) & 0x1f) |
(((num_data_ssc-1) & 0x0f) << 8) |
(((sync_len-1) & 0x0f) << 16);
- sh->ssc->SSC_TCMR = 0x01 | AT91C_SSC_CKO_NONE | (AT91C_SSC_CKI&0) | start_cond;
+ sh->ssc->SSC_TCMR = 0x01 | AT91C_SSC_CKO_NONE | AT91C_SSC_CKI | start_cond;
AT91F_PDC_SetTx(sh->pdc, buffer->data, num_data);
AT91F_PDC_SetNextTx(sh->pdc, 0, 0);
buffer->state = PENDING;
- sh->ssc->SSC_IER = AT91C_SSC_ENDTX;
+ sh->ssc->SSC_IER = AT91C_SSC_TXEMPTY;
/* Enable DMA */
+ sh->ssc->SSC_THR = 0;
AT91F_PDC_EnableTx(sh->pdc);
- //AT91F_PDC_SetTx(sh->pdc, buffer->data, num_data);
/* Disable Receiver, see comments in _ssc_rx_irq */
AT91F_SSC_DisableRx(sh->ssc);
personal git repositories of Harald Welte. Your mileage may vary