From 48c311bd71544f4bfbf0820024fea2f13b974089 Mon Sep 17 00:00:00 2001 From: henryk Date: Tue, 27 Nov 2007 15:13:46 +0000 Subject: Print relevant SSC registers Set correct tc_cdiv for sending (FIXME: need to reset before receiving) git-svn-id: https://svn.openpcd.org:2342/trunk@356 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/cmd.c | 15 +++++++++++++++ openpicc/application/iso14443_layer3a.c | 1 + openpicc/application/ssc_picc.c | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'openpicc/application') diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c index 8c06a3d..b7169f1 100644 --- a/openpicc/application/cmd.c +++ b/openpicc/application/cmd.c @@ -263,9 +263,24 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) { DumpStringToUSB(" * TC0_CV value: "); DumpUIntToUSB(*AT91C_TC0_CV); DumpStringToUSB("\n\r"); + DumpStringToUSB(" * SSC_SR value: "); + DumpUIntToUSB(*AT91C_SSC_SR); + DumpStringToUSB("\n\r"); DumpStringToUSB(" * SSC_RCMR value: "); DumpUIntToUSB(*AT91C_SSC_RCMR); DumpStringToUSB("\n\r"); + DumpStringToUSB(" * SSC_TCMR value: "); + DumpUIntToUSB(*AT91C_SSC_TCMR); + DumpStringToUSB("\n\r"); + DumpStringToUSB(" * SSC_TFMR value: "); + DumpUIntToUSB(*AT91C_SSC_TFMR); + DumpStringToUSB("\n\r"); + DumpStringToUSB(" * SSC_TPR value: "); + DumpUIntToUSB(*AT91C_SSC_TPR); + DumpStringToUSB("\n\r"); + DumpStringToUSB(" * SSC_TCR value: "); + DumpUIntToUSB(*AT91C_SSC_TCR); + DumpStringToUSB("\n\r"); DumpStringToUSB( " *\n\r" " *****************************************************\n\r" diff --git a/openpicc/application/iso14443_layer3a.c b/openpicc/application/iso14443_layer3a.c index f2fe16e..de928ea 100644 --- a/openpicc/application/iso14443_layer3a.c +++ b/openpicc/application/iso14443_layer3a.c @@ -96,6 +96,7 @@ void __ramfunc iso14443_layer3a_irq_ext(u_int32_t ssc_sr, enum ssc_mode ssc_mode if(ret>0) { vLedSetGreen(1); ssc_tx_buffer.len = ret; + tc_cdiv_set_divider(8); ssc_tx_start(&ssc_tx_buffer); vLedSetGreen(0); diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c index df0f3f9..de2121d 100644 --- a/openpicc/application/ssc_picc.c +++ b/openpicc/application/ssc_picc.c @@ -184,8 +184,8 @@ void ssc_tx_start(ssc_dma_tx_buffer_t *buf) start_cond = AT91C_SSC_START_RISE_RF; sync_len = 0; ssc->SSC_RC0R = 0; - data_len = 16; - num_data = buf->len/2; + data_len = 32; + num_data = buf->len/(data_len/8); /* FIXME This is broken for more than 64 bytes */ ssc->SSC_TFMR = ((data_len-1) & 0x1f) | (((num_data-1) & 0x0f) << 8) | -- cgit v1.2.3