X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/30f2a7d38fd35b2427a7eb42e1cd75fb1105f927..f23e056d950c72582ddb1d3d68ad5d012541afff:/armsrc/appmain.c diff --git a/armsrc/appmain.c b/armsrc/appmain.c index bb733fef..681bba99 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -4,10 +4,14 @@ // Jonathan Westhues, Mar 2006 // Edits by Gerhard de Koning Gans, Sep 2007 (##) //----------------------------------------------------------------------------- + + #include #include "apps.h" +#ifdef WITH_LCD #include "fonts.h" #include "LCD.h" +#endif // The large multi-purpose buffer, typically used to hold A/D samples, // maybe pre-processed in some way. @@ -23,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; @@ -599,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); @@ -611,6 +626,10 @@ void UsbPacketReceived(BYTE *packet, int len) case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443: AcquireRawAdcSamplesIso14443(c->ext1); break; + + case CMD_READ_SRI512_TAG: + ReadSRI512Iso14443(c->ext1); + break; case CMD_READER_ISO_14443a: ReaderIso14443a(c->ext1); @@ -649,10 +668,9 @@ void UsbPacketReceived(BYTE *packet, int len) break; case CMD_FPGA_MAJOR_MODE_OFF: // ## FPGA Control - LED_C_ON(); FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); SpinDelay(200); - LED_C_OFF(); + LED_D_OFF(); // LED D indicates field ON or OFF break; case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K: @@ -678,11 +696,11 @@ void UsbPacketReceived(BYTE *packet, int len) SimulateTagLowFrequency(c->ext1); LED_A_OFF(); break; - +#ifdef WITH_LCD case CMD_LCD_RESET: LCDReset(); break; - +#endif case CMD_SWEEP_LF: SweepLFrange(); break; @@ -690,13 +708,14 @@ void UsbPacketReceived(BYTE *packet, int len) case CMD_SET_LF_DIVISOR: FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->ext1); break; - +#ifdef WITH_LCD case CMD_LCD: LCDSend(c->ext1); break; - +#endif case CMD_SETUP_WRITE: case CMD_FINISH_WRITE: + case CMD_HARDWARE_RESET: USB_D_PLUS_PULLUP_OFF(); SpinDelay(1000); SpinDelay(1000); @@ -706,6 +725,7 @@ void UsbPacketReceived(BYTE *packet, int len) } break; + default: DbpString("unknown command"); break; @@ -741,6 +761,8 @@ void AppMain(void) // Load the FPGA image, which we have stored in our flash. FpgaDownloadAndGo(); +#ifdef WITH_LCD + LCDInit(); // test text on different colored backgrounds @@ -763,6 +785,8 @@ void AppMain(void) LCDFill(0, 1+8*14, 132, 8, CYAN); LCDFill(0, 1+8*15, 132, 8, MAGENTA); +#endif + for(;;) { UsbPoll(FALSE); WDT_HIT();