From f23e056d950c72582ddb1d3d68ad5d012541afff Mon Sep 17 00:00:00 2001 From: "adam@algroup.co.uk" Date: Fri, 3 Jul 2009 10:17:52 +0000 Subject: [PATCH] added 'buffclear' - when you absolutely positivley must clear every bit in the room --- armsrc/appmain.c | 11 +++++++++++ include/usb_cmd.h | 1 + winsrc/command.cpp | 8 ++++++++ winsrc/prox.h | 1 + 4 files changed, 21 insertions(+) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 18b8d64a..681bba99 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -27,6 +27,13 @@ BYTE ToSend[256]; int ToSendMax; static int ToSendBit; + +void BufferClear(void) +{ + memset(BigBuf,0,sizeof(BigBuf)); + DbpString("Buffer cleared"); +} + void ToSendReset(void) { ToSendMax = -1; @@ -603,6 +610,10 @@ void UsbPacketReceived(BYTE *packet, int len) case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693: AcquireRawAdcSamplesIso15693(); break; + + case CMD_BUFF_CLEAR: + BufferClear(); + break; case CMD_READER_ISO_15693: ReaderIso15693(c->ext1); diff --git a/include/usb_cmd.h b/include/usb_cmd.h index 655f194c..78b48425 100644 --- a/include/usb_cmd.h +++ b/include/usb_cmd.h @@ -33,6 +33,7 @@ typedef struct { #define CMD_DEBUG_PRINT_BYTES 0x0102 #define CMD_LCD_RESET 0x0103 #define CMD_LCD 0x0104 +#define CMD_BUFF_CLEAR 0x0105 // For low-frequency tags #define CMD_ACQUIRE_RAW_BITS_TI_TYPE 0x0200 diff --git a/winsrc/command.cpp b/winsrc/command.cpp index 8da91f52..8a7fd6fb 100644 --- a/winsrc/command.cpp +++ b/winsrc/command.cpp @@ -52,6 +52,13 @@ static void CmdReset(char *str) SendCommand(&c, FALSE); } +static void CmdBuffClear(char *str) +{ + UsbCommand c; + c.cmd = CMD_BUFF_CLEAR; + SendCommand(&c, FALSE); + CmdClearGraph(TRUE); +} static void CmdQuit(char *str) { @@ -2396,6 +2403,7 @@ static struct { "autocorr", CmdAutoCorr,1, " -- Autocorrelation over window", "bitsamples", CmdBitsamples,0, " Get raw samples as bitstring", "bitstream", Cmdbitstream,1, "[clock rate] -- Convert waveform into a bitstream", + "buffclear", CmdBuffClear,0, " Clear sample buffer and graph window", "dec", CmdDec,1, " Decimate samples", "detectclock", Cmddetectclockrate,1, " Detect clock rate", "em410xsim", CmdEM410xsim,1, " -- Simulate EM410x tag", diff --git a/winsrc/prox.h b/winsrc/prox.h index 232aba1f..e93975de 100644 --- a/winsrc/prox.h +++ b/winsrc/prox.h @@ -22,6 +22,7 @@ extern int CommandFinished; extern int offline; // command.cpp +static void CmdBuffClear(char *str); static void GetFromBigBuf(BYTE *dest, int bytes); static void CmdReset(char *str); static void CmdQuit(char *str); -- 2.39.2