18 Commits
Author SHA1 Message Date
Federico Cerutti 247a0ffd55 Faster ISR sharing in ASM
While in the process of writing a new codec I stumbled upon the long
standing issue of ISR sharing in AVR MCUs.
Actually this is accomplished with an ISR written in C, which simply
calls another plain C function referenced via a function pointer
updated at runtime.
This approach is slow because GCC can't optimize the ISR, since it
does not know which registers will be used, so it defaults to push/pop
all of them.

My solution keeps the concept of pointers to functions, but greatly
improves speed by reducing the ISR itself to the bare minimum to call
another function, which will be compiled by GCC as a signal.
This means all interrupt optimizations will be put in place by GCC,
while ISRs can be still written in plain C code, but the overhead is
now much smaller. It has proven to reduce by 20 the number of
instructions for every ISR, mainly pushes/pops, which cuts the clock
cycle count down by 30 cycles (1 cycle for every push, 2 for pop).
In time units, this means 1.1 uSec are saved for every ISR invocation
and every shared ISR now takes only 13 clock cycles more than the
"bare" one.

A new ISR_SHARED function type has been defined in Common.h to hide
away from the programmer GCC attributes. All new shared interrupt
handling routines should be defined of this type to prevent
stack and registers corruption.

Minor changes were made to Codec.h to allow including it in .S files.
2019-12-08 14:11:05 +01:00
Fabian a35610f6a7 run make style #237 2019-11-15 10:21:40 +01:00
ThorstenandGitHub 3484ce8288 Merge branch 'master' into ISO15693_base 2018-10-17 00:29:09 +02:00
Thorsten Bosbach d0c0da7d70 get iso15 buildable, runable and accepted by android reader 2018-08-18 12:37:59 +02:00
chenzitai 2fa4a94fb9 name Interrupt vectors
(cherry picked from commit 8d15036)
2018-08-15 22:46:42 +01:00
chenzitai 686691f30c Remove experimental code in Reader14443-2A.c, make sniffing code independent form Reader14443-2A.c and ISO14443-2A.c
(cherry picked from commit 16f4fb1)
2018-08-15 22:46:30 +01:00
chenzitai 08404604c2 Separate Reader->Card sniffing from the ISO14443-2A code
Use PORTB INT1, TCD0 CCD for sampling

The card->reader sniffing of this commint may be buggy

(cherry picked from commit 73b6c51)
2018-08-15 22:46:10 +01:00
chenzitai 43ebccbb53 Remove redundancy code, disable sniff flag when deInit the siniff mode
(cherry picked from commit 58df0cd)
2018-08-15 22:45:03 +01:00
chenzitai 288ae73308 Remove repeately called function: CodecInitCommon and keep demod power on
(cherry picked from commit 8eb0d58)
2018-08-15 22:44:57 +01:00
chenzitai 64534c8912 Works for one round of traffic
(cherry picked from commit 800f72a)
2018-08-15 22:44:50 +01:00
chenzitai fd57c63ba8 Work in Card->Reader direction only, WIP
(cherry picked from commit 9ce138c)
2018-08-15 22:44:41 +01:00
Georg a5d0a8d216 reader codec upgrade 2018-01-22 08:47:59 +01:00
Georg 33f3525497 removed removeSOC function (not needed anymore) 2017-11-07 16:27:26 +01:00
Georg 94d24d95c6 unified indentation 2017-11-07 15:53:23 +01:00
Georg b1e457ca01 added reader restart function which may be called from application, so the reader field will be shut down and restarted after a given time 2017-04-04 16:26:09 +02:00
Georg 5850458dfb added new log type, so python knows that in reader mode the data also contain the parity bits 2017-04-04 16:23:56 +02:00
Georg 06f6d970ba added Reader_FWT variable
Application with this may now change the frame waiting time which may be helpful for ISO14443A-4 processing
2017-04-04 16:18:10 +02:00
Georg f46f5b4fbf update to RevG 2016-10-07 23:44:50 +02:00