summaryrefslogtreecommitdiff
path: root/openpicc/application/ssc_picc.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-11 12:25:41 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-11 12:25:41 +0000
commita72e0c20bb28d382fc7377f270b4d9944baeaf97 (patch)
treeccef735dde833330c87b44cbc02c9a5a4849174b /openpicc/application/ssc_picc.c
parentf0c0bc64efe337d28955bf0f0cc05871606e9ea6 (diff)
Framework to support run-time hardware selection. Future hardware releases should be changed to be boot-time detectable (e.g. using the yet unused AD inputs) so that one image can be used for all
releases git-svn-id: https://svn.openpcd.org:2342/trunk@411 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/ssc_picc.c')
-rw-r--r--openpicc/application/ssc_picc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c
index 1eabeb2..df6d7fa 100644
--- a/openpicc/application/ssc_picc.c
+++ b/openpicc/application/ssc_picc.c
@@ -649,17 +649,16 @@ void ssc_tx_init(void)
tx_pdc = (AT91PS_PDC) &(ssc->SSC_RPR);
}
-#ifdef OPENPICC_MODIFIED_BOARD
void ssc_set_data_gate(int enable)
{
+ if(! OPENPICC->features.clock_gating) return;
if(enable)
- AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE);
+ AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC->DATA_GATE);
else
- AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE);
+ AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC->DATA_GATE);
}
-#endif
-void ssc_rx_init(void)
+void ssc_rx_init()
{
tc_cdiv_sync_init();
tc_cdiv_sync_enable();
@@ -679,10 +678,10 @@ void ssc_rx_init(void)
AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL);
AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_CONTROL);
-#ifdef OPENPICC_MODIFIED_BOARD
- AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE);
- AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC_PIO_SSC_DATA_GATE);
-#endif
+ if(OPENPICC->features.clock_gating) {
+ AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPICC->DATA_GATE);
+ AT91F_PIO_SetOutput(AT91C_BASE_PIOA, OPENPICC->DATA_GATE);
+ }
AT91F_AIC_ConfigureIt(AT91C_ID_SSC,
OPENPICC_IRQ_PRIO_SSC,
personal git repositories of Harald Welte. Your mileage may vary