summaryrefslogtreecommitdiff
path: root/openpcd
diff options
context:
space:
mode:
author(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-07-25 09:43:41 +0000
committer(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-07-25 09:43:41 +0000
commit92b5f96c44d1e54a8d1ac98a4598b83acfc755fa (patch)
tree57340191563a9f1fb977a5f39d12291d296d2ba9 /openpcd
parentdd0638d20edf7893eac179c24e0e519bc4fc21cb (diff)
- 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
Diffstat (limited to 'openpcd')
-rw-r--r--openpcd/firmware/src/main_reqa.c20
1 files 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);
}
personal git repositories of Harald Welte. Your mileage may vary