summaryrefslogtreecommitdiff
path: root/openpicc/application
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-21 00:24:39 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-21 00:24:39 +0000
commitf06c7a7ffa7ca7bcd0c86238e9f94a9f4cf8333f (patch)
tree72fa0e7141eea6a2aebfa9d5c1c39324952960e0 /openpicc/application
parent021f73634e525901dd38b206dac35b747c8dd8d2 (diff)
Use finer grained #ifdef's for the new board's features
git-svn-id: https://svn.openpcd.org:2342/trunk@400 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application')
-rw-r--r--openpicc/application/ssc_picc.c6
-rw-r--r--openpicc/application/tc_cdiv.c8
-rw-r--r--openpicc/application/tc_cdiv_sync.c2
3 files changed, 11 insertions, 5 deletions
diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c
index ab3f2e9..d92c7bc 100644
--- a/openpicc/application/ssc_picc.c
+++ b/openpicc/application/ssc_picc.c
@@ -441,6 +441,9 @@ void ssc_tx_start(ssc_dma_tx_buffer_t *buf)
AT91F_SSC_EnableTx(AT91C_BASE_SSC);
#else
ssc_tx_pending = 1;
+#ifdef OPENPICC_USE_SSC_DATA_GATING
+ ssc_set_data_gate(0);
+#endif
pio_irq_enable(OPENPICC_SSC_TF);
if(AT91F_PIO_IsInputSet(AT91C_BASE_PIOA, OPENPICC_SSC_TF)) {
/* TF was probably already high when we enabled the PIO change interrupt for it. */
@@ -590,6 +593,9 @@ static void __ramfunc ssc_irq(void)
DEBUGP("TXSYN ");
if(ssc_sr & AT91C_SSC_ENDTX) {
+#ifdef OPENPICC_USE_SSC_DATA_GATING
+ ssc_set_data_gate(1);
+#endif
//usb_print_string_f("ENDTX ", 0);
if(ssc_tx_buffer.state == PENDING) {
ssc_tx_buffer.state = FREE;
diff --git a/openpicc/application/tc_cdiv.c b/openpicc/application/tc_cdiv.c
index eb8484c..226abbe 100644
--- a/openpicc/application/tc_cdiv.c
+++ b/openpicc/application/tc_cdiv.c
@@ -45,7 +45,7 @@ void __ramfunc tc_cdiv_set_divider(u_int16_t div)
* zero modulo the new RC.*/
/*tc_cdiv_phase_add(tcb->TCB_TC0.TC_RC-(tcb->TCB_TC0.TC_CV%tcb->TCB_TC0.TC_RC));*/
if(tcb->TCB_TC0.TC_CV > div
-#ifdef OPENPICC_MODIFIED_BOARD
+#ifdef OPENPICC_USE_CLOCK_GATING
/* Don't spin if FRAME_BURST is clear, the clock is stopped in this case */
&& !(!AT91F_PIO_IsInputSet(AT91C_BASE_PIOA, OPENPICC_PIO_FRAME_BURST))
#endif
@@ -81,7 +81,7 @@ void tc_cdiv_init(void)
OPENPICC_PIO_CARRIER_DIV_OUT |
OPENPICC_PIO_CDIV_HELP_OUT |
OPENPICC_PIO_CDIV_HELP_IN
-#ifdef OPENPICC_MODIFIED_BOARD
+#ifdef OPENPICC_USE_CLOCK_GATING
| OPENPICC_PIO_FRAME_BURST
#endif
);
@@ -95,7 +95,7 @@ void tc_cdiv_init(void)
/* Connect TCLK1 to XC1, TCLK2 to XC2 */
tcb->TCB_BMR &= ~(AT91C_TCB_TC1XC1S | AT91C_TCB_TC2XC2S);
tcb->TCB_BMR |= (AT91C_TCB_TC1XC1S_TCLK1 | AT91C_TCB_TC2XC2S_TCLK2);
-#ifdef OPENPICC_MODIFIED_BOARD
+#ifdef OPENPICC_USE_CLOCK_GATING
/* Connect TCLK0 to XC0 */
tcb->TCB_BMR &= ~(AT91C_TCB_TC0XC0S);
tcb->TCB_BMR |= (AT91C_TCB_TC0XC0S_TCLK0);
@@ -112,7 +112,7 @@ void tc_cdiv_init(void)
AT91C_TC_BEEVT_SET | AT91C_TC_BCPB_CLEAR |
AT91C_TC_EEVT_XC2 | AT91C_TC_ETRGEDG_RISING |
AT91C_TC_BSWTRG_CLEAR | AT91C_TC_ASWTRG_CLEAR
-#ifdef OPENPICC_MODIFIED_BOARD
+#ifdef OPENPICC_USE_CLOCK_GATING
| AT91C_TC_BURST_XC0
#endif
;
diff --git a/openpicc/application/tc_cdiv_sync.c b/openpicc/application/tc_cdiv_sync.c
index c6d3f47..dbaf3f7 100644
--- a/openpicc/application/tc_cdiv_sync.c
+++ b/openpicc/application/tc_cdiv_sync.c
@@ -46,7 +46,7 @@ void tc_cdiv_sync_reset(void)
for (i = 0; i < 0xff; i++) ;
AT91F_PIO_SetOutput(AT91C_BASE_PIOA,
OPENPICC_PIO_SSC_DATA_CONTROL);
-#ifdef OPENPICC_MODIFIED_BOARD
+#ifdef OPENPICC_USE_CLOCK_GATING
/* reset tc_cdiv counter, the cleared frame signal stopped the tc_cdiv clock */
tc_cdiv_reset();
#endif
personal git repositories of Harald Welte. Your mileage may vary