summaryrefslogtreecommitdiff
path: root/openpicc/application/iso14443_layer3a.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 16:31:46 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 16:31:46 +0000
commit91d960e6945a1bb8e70e41d62fbb3be93b16f989 (patch)
tree3c63f308eb33e979e7ae919c961c87abcf9bc30a /openpicc/application/iso14443_layer3a.c
parent86c7c1ea486d01cb6f0cbd5f3bd8ab91e643489b (diff)
Prepare generic ISO 14443A reception mode (no short/standard distinction), prerequisite for proper frame handling and anticol, doesn't work yet
git-svn-id: https://svn.openpcd.org:2342/trunk@390 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/iso14443_layer3a.c')
-rw-r--r--openpicc/application/iso14443_layer3a.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/openpicc/application/iso14443_layer3a.c b/openpicc/application/iso14443_layer3a.c
index b9ee0b9..e3ce769 100644
--- a/openpicc/application/iso14443_layer3a.c
+++ b/openpicc/application/iso14443_layer3a.c
@@ -75,6 +75,14 @@ const iso14443_frame NULL_FRAME = {
#define INITIAL_FRAME NULL_FRAME
#endif
+#if 1
+#define SHORT_MODE SSC_MODE_14443A_SHORT
+#define STANDARD_MODE SSC_MODE_14443A_STANDARD
+#else
+#define SHORT_MODE SSC_MODE_14443A
+#define STANDARD_MODE SSC_MODE_14443A
+#endif
+
#define ISO14443A_TRANSMIT_AT_NEXT_INTERVAL_0 -1
#define ISO14443A_TRANSMIT_AT_NEXT_INTERVAL_1 -2
@@ -104,7 +112,7 @@ void __ramfunc iso14443_layer3a_irq_ext(u_int32_t ssc_sr, enum ssc_mode ssc_mode
{
(void)ssc_sr;
int fdt;
- if(ssc_mode == SSC_MODE_14443A_SHORT && samples) {
+ if((ssc_mode == SSC_MODE_14443A_SHORT || ssc_mode == SSC_MODE_14443A) && samples) {
ISO14443A_SHORT_TYPE sample = *(ISO14443A_SHORT_TYPE*)samples;
portBASE_TYPE send_atqa = 0;
if(sample == REQA) {
@@ -259,9 +267,9 @@ void iso14443_layer3a_state_machine (void *pvParameters)
DumpStringToUSB("\n\r");
state=INITIAL_STATE;
if(INITIAL_STATE == IDLE)
- enable_reception(SSC_MODE_14443A_SHORT);
+ enable_reception(SHORT_MODE);
else if(INITIAL_STATE == ACTIVE)
- enable_reception(SSC_MODE_14443A_STANDARD);
+ enable_reception(STANDARD_MODE);
else enable_reception(SSC_MODE_NONE);
} else {
LAYER3_DEBUG("SSC TX overflow error, please debug");
@@ -324,18 +332,18 @@ void iso14443_layer3a_state_machine (void *pvParameters)
* Normally we'd go to anticol from here*/
vTaskDelay(portTICK_RATE_MS);
if(prefill_buffer(&ssc_tx_buffer, &ATQA_FRAME)) {
- enable_reception(SSC_MODE_14443A_SHORT);
+ enable_reception(SHORT_MODE);
}
} else {
/* Wait for another frame */
- enable_reception(SSC_MODE_14443A_SHORT);
+ enable_reception(SHORT_MODE);
}
break;
case ACTIVE:
case ACTIVE_STAR:
/* Wait for another frame */
if(0) {
- ssc_rx_mode_set(SSC_MODE_14443A_STANDARD);
+ ssc_rx_mode_set(STANDARD_MODE);
ssc_rx_start();
} else {
//vTaskDelay(portTICK_RATE_MS);
@@ -351,7 +359,7 @@ void iso14443_layer3a_state_machine (void *pvParameters)
usb_print_flush();
}
/* Wait for another frame */
- enable_reception(SSC_MODE_14443A_STANDARD);
+ enable_reception(STANDARD_MODE);
}
default:
break;
personal git repositories of Harald Welte. Your mileage may vary