summaryrefslogtreecommitdiff
path: root/firmware/src/picc/ssc_picc.c
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-12-18 15:19:19 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-12-18 15:19:19 +0000
commit2b28edee6805407541a223a317beb3a0b391aad3 (patch)
treec95199ecee492cd8c4bbdcf8900d37fb8265e29a /firmware/src/picc/ssc_picc.c
parentb7e111098ccb1cd2cc47b73a38a056811fa69b3e (diff)
- modify SSC code to again use tc_cdiv_sync for bitclock synchronization
git-svn-id: https://svn.openpcd.org:2342/trunk@289 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware/src/picc/ssc_picc.c')
-rw-r--r--firmware/src/picc/ssc_picc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/src/picc/ssc_picc.c b/firmware/src/picc/ssc_picc.c
index b7c4219..8ec6f79 100644
--- a/firmware/src/picc/ssc_picc.c
+++ b/firmware/src/picc/ssc_picc.c
@@ -36,6 +36,8 @@
#include <os/led.h>
#include "../openpcd.h"
+#include <picc/tc_cdiv_sync.h>
+
//#define DEBUG_SSC_REFILL
/* definitions for four-times oversampling */
@@ -468,10 +470,8 @@ void ssc_rx_start(void)
AT91C_SSC_RXBUFF | AT91C_SSC_OVRUN);
AT91F_SSC_EnableRx(AT91C_BASE_SSC);
- // Clear the flipflop
- AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL);
- for(int i = 0; i<0xff; i++) { }
- AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL);
+ /* Clear the flipflop */
+ tc_cdiv_sync_reset();
}
void ssc_rx_stop(void)
@@ -518,6 +518,9 @@ static int ssc_usb_in(struct req_ctx *rctx)
void ssc_rx_init(void)
{
+ tc_cdiv_sync_init();
+ tc_cdiv_sync_enable();
+
rx_pdc = (AT91PS_PDC) &(ssc->SSC_RPR);
AT91F_SSC_CfgPMC();
personal git repositories of Harald Welte. Your mileage may vary