}
cmd_send(CMD_ACK,1,card_sz,0,uid,sizeof(uid));
-out:
+OUT:
switch_off_tag_rwd();
LEDsoff();
// The software UART that receives commands from the reader, and its state
// variables.
//-----------------------------------------------------------------------------
+/*
static struct {
enum {
STATE_UNSYNCD,
int posCnt;
uint8_t *output;
} Uart;
-
+*/
/* Receive & handle a bit coming from the reader.
*
* This function is called 4 times per bit (every 2 subcarrier cycles).
// return FALSE;
// }
-
+/*
static void UartReset() {
Uart.byteCntMax = 3;
Uart.posCnt = 0;
memset(Uart.output, 0x00, 3);
}
-
+*/
// static void UartInit(uint8_t *data) {
// Uart.output = data;
// UartReset();
// tag's response, which we leave in the buffer to be demodulated on the
// PC side.
//=============================================================================
-
+/*
static struct {
enum {
DEMOD_UNSYNCD,
int sumI;
int sumQ;
} Demod;
-
+*/
/*
* Handles reception of a bit from the tag
*
* false if we are still waiting for some more
*
*/
-
- #ifndef SUBCARRIER_DETECT_THRESHOLD
- # define SUBCARRIER_DETECT_THRESHOLD 8
- #endif
- // Subcarrier amplitude v = sqrt(ci^2 + cq^2), approximated here by max(abs(ci),abs(cq)) + 1/2*min(abs(ci),abs(cq)))
-#ifndef CHECK_FOR_SUBCARRIER
-# define CHECK_FOR_SUBCARRIER() { v = MAX(ai, aq) + MIN(halfci, halfcq); }
-#endif
-
-// The soft decision on the bit uses an estimate of just the
-// quadrant of the reference angle, not the exact angle.
-// Subcarrier amplitude v = sqrt(ci^2 + cq^2), approximated here by max(abs(ci),abs(cq)) + 1/2*min(abs(ci),abs(cq)))
-#define MAKE_SOFT_DECISION() { \
- if(Demod.sumI > 0) \
- v = ci; \
- else \
- v = -ci; \
- \
- if(Demod.sumQ > 0) \
- v += cq; \
- else \
- v -= cq; \
- \
- }
-
+/*
static RAMFUNC int HandleLegicSamplesDemod(int ci, int cq)
{
int v = 0;
}
return FALSE;
}
-
+*/
+/*
// Clear out the state of the "UART" that receives from the tag.
static void DemodReset() {
Demod.len = 0;
Demod.output = data;
DemodReset();
}
+*/
/*
* Demodulate the samples we received from the tag, also log to tracebuffer
* quiet: set to 'TRUE' to disable debug output
*/
+
+ /*
#define LEGIC_DMA_BUFFER_SIZE 256
-static void GetSamplesForLegicDemod(int n, bool quiet)
+
+ static void GetSamplesForLegicDemod(int n, bool quiet)
{
int max = 0;
bool gotFrame = FALSE;
LogTrace(Demod.output, Demod.len, 0, 0, parity, FALSE);
}
}
+
+*/
+
//-----------------------------------------------------------------------------
// Transmit the command (to the tag) that was placed in ToSend[].
//-----------------------------------------------------------------------------
+/*
static void TransmitForLegic(void)
{
int c;
}
LED_B_OFF();
}
-
+*/
//-----------------------------------------------------------------------------
// Code a layer 2 command (string of octets, including CRC) into ToSend[],
// so that it is ready to transmit to the tag using TransmitForLegic().
//-----------------------------------------------------------------------------
+/*
static void CodeLegicBitsAsReader(const uint8_t *cmd, uint8_t cmdlen, int bits)
{
int i, j;
// Convert from last character reference to length
++ToSendMax;
}
-
+*/
/**
Convenience function to encode, transmit and trace Legic comms
**/
-static void CodeAndTransmitLegicAsReader(const uint8_t *cmd, uint8_t cmdlen, int bits)
+/*
+ static void CodeAndTransmitLegicAsReader(const uint8_t *cmd, uint8_t cmdlen, int bits)
{
CodeLegicBitsAsReader(cmd, cmdlen, bits);
TransmitForLegic();
}
}
-
+*/
// Set up LEGIC communication
+/*
void ice_legic_setup() {
// standard things.
// initalize prng
legic_prng_init(0);
-}
\ No newline at end of file
+}
+*/
\ No newline at end of file