From 92b5f96c44d1e54a8d1ac98a4598b83acfc755fa Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Tue, 25 Jul 2006 09:43:41 +0000 Subject: - add some comments on what this code does - more debugging output - switch LED1(red) according to the result of the transceive operation git-svn-id: https://svn.openpcd.org:2342/trunk@46 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/src/main_reqa.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/openpcd/firmware/src/main_reqa.c b/openpcd/firmware/src/main_reqa.c index 64cceb0..1c375c3 100644 --- a/openpcd/firmware/src/main_reqa.c +++ b/openpcd/firmware/src/main_reqa.c @@ -1,3 +1,12 @@ +/* main_reqa - OpenPCD firmware for generating an endless loop of + * ISO 14443-A REQA packets. + * + * If a response is received from the PICC, LED1 (Red) will be switched + * on. If no valid response has been received within the timeout of the + * receiver, LED1 (Red) will be switched off. + * + */ + #include "rc632.h" #include "dbgu.h" #include "led.h" @@ -8,9 +17,13 @@ void _init_func(void) { - rc632_init(); //udp_init(); trigger_init(); + rc632_init(); + DEBUGPCRF("turning on RF"); + rc632_turn_on_rf(RAH); + DEBUGPCRF("initializing 14443A operation"); + rc632_iso14443a_init(RAH); } @@ -22,8 +35,11 @@ void _main_func(void) trigger_pulse(); - if (rc632_iso14443a_transceive_sf(ISO14443A_SF_CMD_WUPA, &atqa) < 0) + if (rc632_iso14443a_transceive_sf(RAH, ISO14443A_SF_CMD_WUPA, &atqa) < 0) { DEBUGPCRF("error during transceive_sf"); + led_switch(1, 0); + } else + led_switch(1, 1); led_toggle(2); } -- cgit v1.2.3