diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2008-03-15 08:14:11 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2008-03-15 08:14:11 +0000 |
commit | 5ed9125edc78ee5ad44fd2c82b916d4cce5335fd (patch) | |
tree | 10726aef1f8441d2040b65142e3beda2b2495d59 | |
parent | 625ffcb32a947cbcf66b491f1f0ddd49d31c0a5e (diff) |
Revert since the 'faster' version was not correct (and a fixed version was even slower)
git-svn-id: https://svn.openpcd.org:2342/trunk@458 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r-- | openpicc/application/iso14443a_diffmiller.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openpicc/application/iso14443a_diffmiller.c b/openpicc/application/iso14443a_diffmiller.c index e6eb6d8..97017f7 100644 --- a/openpicc/application/iso14443a_diffmiller.c +++ b/openpicc/application/iso14443a_diffmiller.c @@ -191,13 +191,14 @@ static inline void end_frame(struct diffmiller_state * const state, const u_int3 #define DO_BIT_1 { \ last_data_bit = 1; \ - if(++counter==9) { \ - append_to_frame(state, state->byte, 1, 8); \ - counter=state->byte=state->parity=0; \ - } else { \ + if(counter<8) { \ state->byte |= (1<<counter); \ state->parity ^= 1; \ } \ + if(++counter==9) { \ + append_to_frame(state, state->byte, 1, 8); \ + counter=state->byte=state->parity=0; \ + } \ PRINT_BIT(" 1"); \ } |