From: adam@algroup.co.uk Date: Fri, 3 Jul 2009 10:17:52 +0000 (+0000) Subject: added 'buffclear' - when you absolutely positivley must clear every bit in the room X-Git-Tag: v1.0.0~588 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/f23e056d950c72582ddb1d3d68ad5d012541afff?hp=93f36463fb6f075656a133e7c8a329da976f6ac3 added 'buffclear' - when you absolutely positivley must clear every bit in the room --- 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);