summaryrefslogtreecommitdiff
path: root/openpicc/application/tc_fdt.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-12 01:50:14 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-12 01:50:14 +0000
commit202b56a42c5e6a171ee43b469be48525d0e8e350 (patch)
tree84260eadbedd8575f158b95a43c3a481c35362ec /openpicc/application/tc_fdt.c
parent3d0e1db9d118f85441a9d559ba2fa7baa7195eee (diff)
Add new miller decoder (not working yet)
Vastly improve timing through CPU cycle counting. Jitter is now like 40ns (the SSC_DATA edge detection fuzziness) in 2 main clusters 4 CPU cycles (83ns) apart, plus an occasional glitch adding 4 CPU cycles in either direction git-svn-id: https://svn.openpcd.org:2342/trunk@385 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/tc_fdt.c')
-rw-r--r--openpicc/application/tc_fdt.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/openpicc/application/tc_fdt.c b/openpicc/application/tc_fdt.c
index 7413e11..2a306ef 100644
--- a/openpicc/application/tc_fdt.c
+++ b/openpicc/application/tc_fdt.c
@@ -50,16 +50,12 @@ void tc_fdt_set(u_int16_t count)
tcfdt->TC_RA = count;
}
-void __ramfunc tc_fdt_set_to_next_slot(int last_bit)
+int tc_fdt_get_next_slot(int reference_time, int slotlen)
{
- int reference_time;
- if(last_bit == 0) reference_time = ISO14443A_FDT_OFFSET_0;
- else reference_time = ISO14443A_FDT_OFFSET_1;
-
- if(tcfdt->TC_SR & AT91C_TC_CLKSTA)
+ /*if(tcfdt->TC_SR & AT91C_TC_CLKSTA)
while(tcfdt->TC_CV != 0xFFFF && (tcfdt->TC_CV - reference_time) % 128 != 0);
- tcfdt->TC_CCR = AT91C_TC_SWTRG;
- tc_fdt_set(2*128);
+ tcfdt->TC_CCR = AT91C_TC_SWTRG;*/
+ return tcfdt->TC_CV + (slotlen-((tcfdt->TC_CV - reference_time) % slotlen)) + 3*slotlen;
}
personal git repositories of Harald Welte. Your mileage may vary