summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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