diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2008-03-14 04:55:15 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2008-03-14 04:55:15 +0000 |
commit | e2e37bea66206adefbb2fc97fcbfb71c1a3cfbe7 (patch) | |
tree | 8e1edc0418be46c82e59e5782c9534ebf3d5651c /openpicc/application/performance.c | |
parent | 9615190a75ab0304d37701e97947ffe36be2d345 (diff) |
Add T/C based receiver code with integrated miller decoder
Integrate T/C receiver into iso14443 layer 2a
Add state field to iso14443_frame, rename ssc buffer state constants
Sniffer seems to work with the new code
git-svn-id: https://svn.openpcd.org:2342/trunk@452 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/performance.c')
-rw-r--r-- | openpicc/application/performance.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/openpicc/application/performance.c b/openpicc/application/performance.c index cffd094..4515f18 100644 --- a/openpicc/application/performance.c +++ b/openpicc/application/performance.c @@ -33,6 +33,7 @@ static u_int32_t overruns = 0; #define NUMBER_OF_CHECKPOINTS 20 static struct performance_checkpoint checkpoints[NUMBER_OF_CHECKPOINTS]; static int current_checkpoint; +static int running=0; static void __ramfunc tc_perf_irq(void) __attribute__ ((naked)); static void __ramfunc tc_perf_irq(void) @@ -66,6 +67,7 @@ inline void performance_start(void) memset(checkpoints, 0, sizeof(checkpoints)); current_checkpoint = 0; overruns = 0; + running = 1; tc_perf->TC_CCR = AT91C_TC_SWTRG | AT91C_TC_CLKEN; } @@ -82,6 +84,7 @@ inline perf_time_t performance_get(void) inline perf_time_t performance_stop(void) { perf_time_t result = performance_get(); + running = 0; tc_perf->TC_CCR = AT91C_TC_CLKDIS; return result; } @@ -105,6 +108,7 @@ perf_time_t performance_diff(perf_time_t a, perf_time_t b) void performance_set_checkpoint(const char * const description) { + if(!running) return; if(current_checkpoint < NUMBER_OF_CHECKPOINTS) { perf_time_t time = performance_get(); checkpoints[current_checkpoint++] = (struct performance_checkpoint){ @@ -116,6 +120,7 @@ void performance_set_checkpoint(const char * const description) void performance_stop_report(void) { + if(!running) return; perf_time_t _now = performance_stop(); struct performance_checkpoint now = { .time = _now, |