From 5850458dfbc2a3a5c5860abed48a4d628f67328e Mon Sep 17 00:00:00 2001 From: Georg Date: Tue, 4 Apr 2017 16:23:56 +0200 Subject: [PATCH] added new log type, so python knows that in reader mode the data also contain the parity bits --- Firmware/Chameleon-Mini/Codec/Reader14443-2A.c | 4 ++-- Firmware/Chameleon-Mini/Log.h | 2 ++ Software/Chameleon/Log.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Firmware/Chameleon-Mini/Codec/Reader14443-2A.c b/Firmware/Chameleon-Mini/Codec/Reader14443-2A.c index e069b41..1921e43 100644 --- a/Firmware/Chameleon-Mini/Codec/Reader14443-2A.c +++ b/Firmware/Chameleon-Mini/Codec/Reader14443-2A.c @@ -326,7 +326,7 @@ void Reader14443ACodecTask(void) if (BitCount % 8) // copy the last byte, if there is an incomplete byte CodecBuffer[BitCount / 8] = SampleRegister >> (8 - (BitCount % 8)); LEDHook(LED_CODEC_RX, LED_PULSE); - LogEntry(LOG_INFO_CODEC_RX_DATA, CodecBuffer, (BitCount + 7) / 8); + LogEntry(LOG_INFO_CODEC_RX_DATA_W_PARITY, CodecBuffer, (BitCount + 7) / 8); breakflag = true; break; @@ -384,7 +384,7 @@ void Reader14443ACodecTask(void) CODEC_DEMOD_IN_PORT.INTCTRL = 0; LEDHook(LED_CODEC_TX, LED_PULSE); - LogEntry(LOG_INFO_CODEC_TX_DATA, CodecBuffer, (BitCount + 7) / 8); + LogEntry(LOG_INFO_CODEC_TX_DATA_W_PARITY, CodecBuffer, (BitCount + 7) / 8); /* Set state and start timer for Miller encoding. */ State = STATE_MILLER_SOF0; diff --git a/Firmware/Chameleon-Mini/Log.h b/Firmware/Chameleon-Mini/Log.h index 5b3f776..bcd1567 100644 --- a/Firmware/Chameleon-Mini/Log.h +++ b/Firmware/Chameleon-Mini/Log.h @@ -19,6 +19,8 @@ typedef enum { /* Codec */ LOG_INFO_CODEC_RX_DATA = 0x40, ///< Currently active codec received data. LOG_INFO_CODEC_TX_DATA = 0x41, ///< Currently active codec sent data. + LOG_INFO_CODEC_RX_DATA_W_PARITY = 0x42, ///< Currently active codec received data. + LOG_INFO_CODEC_TX_DATA_W_PARITY = 0x43, ///< Currently active codec sent data. /* App */ LOG_INFO_APP_CMD_READ = 0x80, ///< Application processed read command. diff --git a/Software/Chameleon/Log.py b/Software/Chameleon/Log.py index 9b09769..c541c43 100644 --- a/Software/Chameleon/Log.py +++ b/Software/Chameleon/Log.py @@ -22,6 +22,8 @@ eventTypes = { 0x40: { 'name': 'CODEC RX', 'decoder': binaryDecoder }, 0x41: { 'name': 'CODEC TX', 'decoder': binaryDecoder }, + 0x42: { 'name': 'CODEC RX W/ PARITY', 'decoder': binaryDecoder }, + 0x43: { 'name': 'CODEC TX W/ PARITY', 'decoder': binaryDecoder }, 0x80: { 'name': 'APP READ', 'decoder': binaryDecoder }, 0x81: { 'name': 'APP WRITE', 'decoder': binaryDecoder },