diff --git a/Makefile b/Makefile index cf327d95f..a474fadd3 100644 --- a/Makefile +++ b/Makefile @@ -35,9 +35,10 @@ endif include common/Makefile.hal $(info ===================================================================) -$(info PLATFORM: $(PLATFORM)) -$(info $(PLTNAME)) -$(info Included supports: $(PLATFORM_DEFS)) +$(info PLATFORM: $(PLATFORM)) +$(info Platform name: $(PLTNAME)) +$(info Included options: $(PLATFORM_DEFS_INFO)) +$(info Standalone mode: $(PLATFORM_DEFS_INFO_STANDALONE)) $(info ===================================================================) all clean: %: client/% bootrom/% armsrc/% recovery/% mfkey/% nonce2key/% diff --git a/armsrc/Makefile b/armsrc/Makefile index 7292b7f9b..705cbb021 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -18,9 +18,10 @@ ifeq ($(PLTNAME),) endif include ../common/Makefile.hal $(info ===================================================================) - $(info PLATFORM: $(PLATFORM)) - $(info $(PLTNAME)) - $(info Included supports: $(PLATFORM_DEFS)) + $(info PLATFORM: $(PLATFORM)) + $(info Platform name: $(PLTNAME)) + $(info Included options: $(PLATFORM_DEFS_INFO)) + $(info Standalone mode: $(PLATFORM_DEFS_INFO_STANDALONE)) $(info ===================================================================) endif @@ -29,34 +30,8 @@ endif # NO space,TABs after the "\" sign. APP_CFLAGS = $(PLATFORM_DEFS) \ -DON_DEVICE \ - -DWITH_LF \ - -DWITH_HITAG \ - -DWITH_ISO15693 \ - -DWITH_LEGICRF \ - -DWITH_ISO14443b \ - -DWITH_ISO14443a \ - -DWITH_ICLASS \ - -DWITH_FELICA \ - -DWITH_HFSNIFF \ - -DWITH_LF_SAMYRUN \ -fno-strict-aliasing -ffunction-sections -fdata-sections -### IMPORTANT - move the commented variable below this line -# -DWITH_FPC \ -# -DWITH_LCD \ -# -DWITH_EMV \ -# -# Standalone Mods -#------------------------------------------------------- -# -DWITH_LF_ICERUN -# -DWITH_LF_SAMYRUN -# -DWITH_LF_PROXBRUTE -# -DWITH_LF_HIDBRUTE -# -DWITH_HF_YOUNG -# -DWITH_HF_MATTYRUN -# -DWITH_HF_COLIN -# -DWITH_HF_BOG - SRC_LF = lfops.c lfsampling.c pcf7931.c lfdemod.c SRC_ISO15693 = iso15693.c iso15693tools.c SRC_ISO14443a = iso14443a.c mifareutil.c mifarecmd.c epa.c mifaresim.c @@ -100,37 +75,39 @@ else endif # Generic standalone Mode injection of source code -SRC_STANDALONE = -# WITH_LF_ICERUN -ifneq (,$(findstring WITH_LF_ICERUN,$(APP_CFLAGS))) - SRC_STANDALONE = + + +SRC_STANDALONE = placeholder.c +# WITH_STANDALONE_LF_ICERUN +ifneq (,$(findstring WITH_STANDALONE_LF_ICERUN,$(APP_CFLAGS))) + SRC_STANDALONE = lf_icerun.c endif -# WITH_LF_SAMYRUN -ifneq (,$(findstring WITH_LF_SAMYRUN,$(APP_CFLAGS))) +# WITH_STANDALONE_LF_SAMYRUN +ifneq (,$(findstring WITH_STANDALONE_LF_SAMYRUN,$(APP_CFLAGS))) SRC_STANDALONE = lf_samyrun.c endif -# WITH_LF_PROXBRUTE -ifneq (,$(findstring WITH_LF_PROXBRUTE,$(APP_CFLAGS))) +# WITH_STANDALONE_LF_PROXBRUTE +ifneq (,$(findstring WITH_STANDALONE_LF_PROXBRUTE,$(APP_CFLAGS))) SRC_STANDALONE = lf_proxbrute.c endif -# WITH_LF_HIDBRUTE -ifneq (,$(findstring WITH_LF_HIDBRUTE,$(APP_CFLAGS))) +# WITH_STANDALONE_LF_HIDBRUTE +ifneq (,$(findstring WITH_STANDALONE_LF_HIDBRUTE,$(APP_CFLAGS))) SRC_STANDALONE = lf_hidbrute.c endif -# WITH_HF_YOUNG -ifneq (,$(findstring WITH_HF_YOUNG,$(APP_CFLAGS))) +# WITH_STANDALONE_HF_YOUNG +ifneq (,$(findstring WITH_STANDALONE_HF_YOUNG,$(APP_CFLAGS))) SRC_STANDALONE = hf_young.c endif -# WITH_HF_MATTYRUN -ifneq (,$(findstring WITH_HF_MATTYRUN,$(APP_CFLAGS))) +# WITH_STANDALONE_HF_MATTYRUN +ifneq (,$(findstring WITH_STANDALONE_HF_MATTYRUN,$(APP_CFLAGS))) SRC_STANDALONE = hf_mattyrun.c endif -# WITH_HF_COLIN -ifneq (,$(findstring WITH_HF_COLIN,$(APP_CFLAGS))) +# WITH_STANDALONE_HF_COLIN +ifneq (,$(findstring WITH_STANDALONE_HF_COLIN,$(APP_CFLAGS))) SRC_STANDALONE = vtsend.c hf_colin.c endif -# WITH_HF_BOG -ifneq (,$(findstring WITH_HF_BOG,$(APP_CFLAGS))) +# WITH_STANDALONE_HF_BOG +ifneq (,$(findstring WITH_STANDALONE_HF_BOG,$(APP_CFLAGS))) SRC_STANDALONE = hf_bog.c endif diff --git a/armsrc/Standalone/hf_bog.c b/armsrc/Standalone/hf_bog.c index 36e600392..151282f3a 100644 --- a/armsrc/Standalone/hf_bog.c +++ b/armsrc/Standalone/hf_bog.c @@ -281,6 +281,10 @@ void RAMFUNC SniffAndStore(uint8_t param) { } } +void ModInfo(void) { + DbpString(" HF 14a sniff standalone with ULC/ULEV1/NTAG auth storing in flashmem - aka BogitoRun (Bogito)"); +} + void RunMod() { StandAloneMode(); diff --git a/armsrc/Standalone/hf_colin.c b/armsrc/Standalone/hf_colin.c index 3eb2ddfe6..ff8ca8970 100644 --- a/armsrc/Standalone/hf_colin.c +++ b/armsrc/Standalone/hf_colin.c @@ -195,6 +195,10 @@ void WriteTagToFlash(uint8_t index, size_t size) { return; } +void ModInfo(void) { + DbpString(" HF Mifare ultra fast sniff/sim/clone - aka VIGIKPWN (Colin Brigato)"); +} + void RunMod() { StandAloneMode(); FpgaDownloadAndGo(FPGA_BITSTREAM_HF); diff --git a/armsrc/Standalone/hf_mattyrun.c b/armsrc/Standalone/hf_mattyrun.c index de22d11f9..9bcfd63d3 100644 --- a/armsrc/Standalone/hf_mattyrun.c +++ b/armsrc/Standalone/hf_mattyrun.c @@ -191,6 +191,10 @@ static int saMifareChkKeys(uint8_t blockNo, uint8_t keyType, bool clearTrace, ui return -1; } +void ModInfo(void) { + DbpString(" HF Mifare sniff/clone - aka MattyRun (Matías A. Ré Medina)"); +} + void RunMod() { StandAloneMode(); Dbprintf(">> Matty mifare chk/dump/sim a.k.a MattyRun Started <<"); diff --git a/armsrc/Standalone/hf_young.c b/armsrc/Standalone/hf_young.c index 95f12da2a..c9f89da7e 100644 --- a/armsrc/Standalone/hf_young.c +++ b/armsrc/Standalone/hf_young.c @@ -18,6 +18,10 @@ typedef struct { } __attribute__((__packed__)) card_clone_t; +void ModInfo(void) { + DbpString(" HF Mifare sniff/simulation - (Craig Young)"); +} + void RunMod() { StandAloneMode(); Dbprintf(">> Craig Young Mifare sniff UID/clone uid 2 magic/sim a.k.a YoungRun Started <<"); diff --git a/armsrc/Standalone/lf_hidbrute.c b/armsrc/Standalone/lf_hidbrute.c index 8571c0ce1..fbd71a704 100644 --- a/armsrc/Standalone/lf_hidbrute.c +++ b/armsrc/Standalone/lf_hidbrute.c @@ -26,6 +26,10 @@ //----------------------------------------------------------------------------------- #include "lf_hidbrute.h" +void ModInfo(void) { + DbpString(" LF HID corporate 1000 bruteforce - aka Corporatebrute (Federico dotta & Maurizio Agazzini)"); +} + // samy's sniff and repeat routine for LF void RunMod() { StandAloneMode(); diff --git a/armsrc/Standalone/lf_icerun.c b/armsrc/Standalone/lf_icerun.c new file mode 100644 index 000000000..b9a87e397 --- /dev/null +++ b/armsrc/Standalone/lf_icerun.c @@ -0,0 +1,41 @@ +//----------------------------------------------------------------------------- +// Christian Herrmann, 2019 +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// main code for skeleton aka IceRun by Iceman +//----------------------------------------------------------------------------- +#include "lf_icerun.h" + +void ModInfo(void) { + DbpString(" LF skeleton mode - aka IceRun (iceman)"); +} + +// samy's sniff and repeat routine for LF +void RunMod() { + StandAloneMode(); + Dbprintf("[=] LF skeleton code a.k.a IceRun started"); + FpgaDownloadAndGo(FPGA_BITSTREAM_LF); + + // the main loop for your standalone mode + for (;;) { + WDT_HIT(); + + // exit from IceRun, send a usbcommand. + if (usb_poll_validate_length()) break; + + // Was our button held down or pressed? + int button_pressed = BUTTON_HELD(1000); + + Dbprintf("button %d", button_pressed); + + if ( button_pressed ) + break; + } + +out: + DbpString("[=] exiting"); + LEDsoff(); +} diff --git a/armsrc/Standalone/lf_icerun.h b/armsrc/Standalone/lf_icerun.h new file mode 100644 index 000000000..50427320a --- /dev/null +++ b/armsrc/Standalone/lf_icerun.h @@ -0,0 +1,17 @@ +//----------------------------------------------------------------------------- +// Iceman, Christian Herrmann, 2019 +// +// This code is licensed to you under the terms of the GNU GPL, version 2 or, +// at your option, any later version. See the LICENSE.txt file for the text of +// the license. +//----------------------------------------------------------------------------- +// StandAlone Mod +//----------------------------------------------------------------------------- + +#ifndef __LF_ICERUN_H +#define __LF_ICERUN_H + +#include "standalone.h" // standalone definitions +#include "apps.h" // debugstatements, lfops? + +#endif /* __LF_ICERUN_H */ diff --git a/armsrc/Standalone/lf_proxbrute.c b/armsrc/Standalone/lf_proxbrute.c index 178ce98fb..c9fce3ac6 100644 --- a/armsrc/Standalone/lf_proxbrute.c +++ b/armsrc/Standalone/lf_proxbrute.c @@ -11,6 +11,10 @@ //----------------------------------------------------------------------------- #include "lf_proxbrute.h" +void ModInfo(void) { + DbpString(" LF HID ProxII bruteforce - aka Proxbrute (Brad Antoniewicz)"); +} + // samy's sniff and repeat routine for LF void RunMod() { StandAloneMode(); diff --git a/armsrc/Standalone/lf_samyrun.c b/armsrc/Standalone/lf_samyrun.c index b4530fa2f..8b3ae5360 100644 --- a/armsrc/Standalone/lf_samyrun.c +++ b/armsrc/Standalone/lf_samyrun.c @@ -10,6 +10,10 @@ //----------------------------------------------------------------------------- #include "lf_samyrun.h" +void ModInfo(void) { + DbpString(" LF HID26 standalone - aka SamyRun (Samy Kamkar)"); +} + // samy's sniff and repeat routine for LF void RunMod() { StandAloneMode(); diff --git a/armsrc/Standalone/placeholder.c b/armsrc/Standalone/placeholder.c new file mode 100644 index 000000000..e179bc876 --- /dev/null +++ b/armsrc/Standalone/placeholder.c @@ -0,0 +1,9 @@ +#include "standalone.h" // standalone definitions +#include "apps.h" // debug statements + +void ModInfo(void) { + DbpString(" No standalone mode present"); +} + +void RunMod() { +} diff --git a/armsrc/Standalone/readme.md b/armsrc/Standalone/readme.md index 21eadc45f..85cbdb1ca 100644 --- a/armsrc/Standalone/readme.md +++ b/armsrc/Standalone/readme.md @@ -3,14 +3,19 @@ This contains functionality for different StandAlone modes. The fullimage will be built given the correct compiler flags used. Build targets for these files are contained in `armsrc/Makefile`. If you want to implement a new standalone mode, you need to implement the methods provided in `standalone.h`. +Have a look at the skeleton standalone mode called IceRun, in the files `lf_icerun.c lf_icerun.h`. ## Implementing a standalone mode -Each standalone mod needs to have its own compiler flag to be added in `armsrc\makefile` and inside the function `AppMain` inside AppMain.c. Inside Appmain a call to RunMod is needed. It looks strange because of what kinds of dependencies your mode will have. +Each standalone mod needs to have its own compiler flag to be added in `armsrc\makefile`. The RunMod function is your "main" function when running. You need to check for Usb commands, in order to let the pm3 client break the standalone mode. See this basic skeleton of main function RunMod(). ```` -void RunMod() { +void ModInfo(void) { + DbpString(" HF good description of your mode - (my name)"); +} + +void RunMod(void) { // led show StandAloneMode(); FpgaDownloadAndGo(FPGA_BITSTREAM_LF); @@ -32,21 +37,23 @@ As it is now, you can only have one standalone mode installed at the time. Use HF/LF to denote which frequence your mod is targeting. Use you own github name/similar for perpetual honour to denote your mod -Samples of directive flag used in the `armsrc\makefile`: +Samples of directive flag used in the `common/Makefile.hal`: ``` -### -DWITH_LF_ICERUN -### -DWITH_LF_SAMYRUN -### -DWITH_LF_PROXBRUTE -### -DWITH_LF_HIDBRUTE -### -DWITH_HF_COLIN -### -DWITH_HF_YOUNG -### -DWITH_HF_MATTYRUN +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_ICERUN +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_PROXBRUTE +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_HIDBRUTE +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_YOUNG +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_MATTYRUN +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_COLIN +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_BOG ``` -Add your source code file like the following sample in the `armsrc\makefile` +Add your source code file like the following sample in the `armsrc/Makefile` ``` -# WITH_HF_COLIN -ifneq (,$(findstring WITH_HF_COLIN,$(APP_CFLAGS))) +# WITH_STANDALONE_HF_COLIN +ifneq (,$(findstring WITH_STANDALONE_HF_COLIN,$(APP_CFLAGS))) SRC_STANDALONE = hf_colin.c vtsend.c else SRC_STANDALONE = @@ -54,48 +61,12 @@ endif ``` ## Adding identification of your mode -Do please add a identification string in the function `printStandAloneModes` inside `armsrc\appmain.c` +Do please add a identification string in a function called `ModInfo` inside your source code file. This will enable an easy way to detect on client side which standalone mods has been installed on the device. + +## Compiling your standalone mode +Once all this is done, you and others can now easily compile different standalone modes by just selecting one of the standalone modes in `common/Makefile.hal`, e.g.: + +``` +PLATFORM_DEFS += -DWITH_STANDALONE_HF_COLIN ``` -#if defined(WITH_HF_COLIN) - DbpString(" HF Mifare ultra fast sniff/sim/clone - aka VIGIKPWN (Colin Brigato)"); -#endif -```` - -Once all this is done, you and others can now easily compile different standalone modes by just swapping the -D directive in `armsrc\makefile` - -```` -#remove one of the following defines and comment out the relevant line -#in the next section to remove that particular feature from compilation. -# NO space,TABs after the "\" sign. -APP_CFLAGS = -DON_DEVICE \ - -DWITH_LF \ - -DWITH_HITAG \ - -DWITH_ISO15693 \ - -DWITH_LEGICRF \ - -DWITH_ISO14443b \ - -DWITH_ISO14443a \ - -DWITH_ICLASS \ - -DWITH_FELICA \ - -DWITH_FLASH \ - -DWITH_SMARTCARD \ - -DWITH_HFSNOOP \ - -DWITH_HF_COLIN \ - -DWITH_FPC \ - -fno-strict-aliasing -ffunction-sections -fdata-sections - -### IMPORTANT - move the commented variable below this line -# -DWITH_LCD \ -# -DWITH_EMV \ -# -DWITH_FPC \ -# -# Standalone Mods -#------------------------------------------------------- -# -DWITH_LF_ICERUN -# -DWITH_LF_SAMYRUN -# -DWITH_LF_PROXBRUTE -# -DWITH_LF_HIDBRUTE -# -DWITH_HF_YOUNG -# -DWITH_HF_MATTYRUN -# -DWITH_HF_COLIN -```` diff --git a/armsrc/Standalone/standalone.h b/armsrc/Standalone/standalone.h index 334bbc2b4..217c7b4cf 100644 --- a/armsrc/Standalone/standalone.h +++ b/armsrc/Standalone/standalone.h @@ -15,5 +15,6 @@ #include // PRIu64 void RunMod(); +void ModInfo(); #endif /* __STANDALONE_H */ diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 9e730dc08..60f667e21 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -417,7 +417,15 @@ void SendStatus(void) { Dbprintf(" ToSendMax...............%d", ToSendMax); Dbprintf(" ToSendBit...............%d", ToSendBit); Dbprintf(" ToSend BUFFERSIZE.......%d", TOSEND_BUFFER_SIZE); - printStandAloneModes(); + DbpString("Installed StandAlone Mode"); + ModInfo(); + + //DbpString("Running "); + //Dbprintf(" Is Device attached to USB| %s", USB_ATTACHED() ? "Yes" : "No"); + //Dbprintf(" Is Device attached to FPC| %s", send_using_0 ? "Yes" : "No"); + //Dbprintf(" Is USB_reconnect value | %d", GetUSBreconnect() ); + //Dbprintf(" Is USB_configured value | %d", GetUSBconfigured() ); + reply_old(CMD_ACK, 1, 0, 0, 0, 0); } @@ -433,48 +441,6 @@ void StandAloneMode(void) { SpinDown(50); SpinDelay(500); } -// detection of which Standalone Modes is installed -// (iceman) -void printStandAloneModes(void) { - - DbpString("Installed StandAlone Mode"); - -#if defined(WITH_LF_ICERUN) - DbpString(" LF sniff/clone/simulation - aka IceRun (iceman)"); -#endif -#if defined(WITH_HF_YOUNG) - DbpString(" HF Mifare sniff/simulation - (Craig Young)"); -#endif -#if defined(WITH_LF_SAMYRUN) - DbpString(" LF HID26 standalone - aka SamyRun (Samy Kamkar)"); -#endif -#if defined(WITH_LF_PROXBRUTE) - DbpString(" LF HID ProxII bruteforce - aka Proxbrute (Brad Antoniewicz)"); -#endif -#if defined(WITH_LF_HIDBRUTE) - DbpString(" LF HID corporate 1000 bruteforce - aka Corporatebrute (Federico dotta & Maurizio Agazzini)"); -#endif -#if defined(WITH_HF_MATTYRUN) - DbpString(" HF Mifare sniff/clone - aka MattyRun (Matías A. Ré Medina)"); -#endif -#if defined(WITH_HF_COLIN) - DbpString(" HF Mifare ultra fast sniff/sim/clone - aka VIGIKPWN (Colin Brigato)"); -#endif -#if defined(WITH_HF_BOG) - DbpString(" HF 14a sniff standalone with ULC/ULEV1/NTAG auth storing in flashmem - aka BogitoRun (Bogito)"); -#endif - - //DbpString("Running "); - //Dbprintf(" Is Device attached to USB| %s", USB_ATTACHED() ? "Yes" : "No"); - //Dbprintf(" Is Device attached to FPC| %s", 0 ? "Yes" : "No"); - //Dbprintf(" Is USB_reconnect value | %d", GetUSBreconnect() ); - //Dbprintf(" Is USB_configured value | %d", GetUSBconfigured() ); - - //.. add your own standalone detection based on with compiler directive you are used. - // don't "reuse" the already taken ones, this will make things easier when trying to detect the different modes - // 2017-08-06 must adapt the makefile and have individual compilation flags for all mods - // -} /* OBJECTIVE @@ -1584,16 +1550,8 @@ void __attribute__((noreturn)) AppMain(void) { /* * So this is the trigger to execute a standalone mod. Generic entrypoint by following the standalone/standalone.h headerfile * All standalone mod "main loop" should be the RunMod() function. - * Since the standalone is either LF or HF, the somewhat bisarr defines below exists. */ -#if defined (WITH_LF) && ( defined (WITH_LF_SAMYRUN) || defined (WITH_LF_HIDBRUTE) || defined (WITH_LF_PROXBRUTE) ) RunMod(); -#endif - -#if defined (WITH_ISO14443a) && ( defined (WITH_HF_YOUNG) || defined(WITH_HF_COLIN) || defined(WITH_HF_MATTYRUN) || defined(WITH_HF_BOG) ) - RunMod(); -#endif - } } } diff --git a/client/Makefile b/client/Makefile index 24fa22018..d6f25156e 100644 --- a/client/Makefile +++ b/client/Makefile @@ -14,9 +14,10 @@ ifeq ($(PLTNAME),) endif include ../common/Makefile.hal $(info ===================================================================) - $(info PLATFORM: $(PLATFORM)) - $(info $(PLTNAME)) - $(info Included supports: $(PLATFORM_DEFS)) + $(info PLATFORM: $(PLATFORM)) + $(info Platform name: $(PLTNAME)) + $(info Included options: $(PLATFORM_DEFS_INFO)) + $(info Standalone mode: $(PLATFORM_DEFS_INFO_STANDALONE)) $(info ===================================================================) endif diff --git a/common/Makefile.hal b/common/Makefile.hal index 717d59110..d6f87a2e6 100644 --- a/common/Makefile.hal +++ b/common/Makefile.hal @@ -56,12 +56,62 @@ else $(error Invalid or empty PLATFORM: $(PLATFORM). Known platforms: $(KNOWN_PLATFORMS)) endif -# Add flags dependencies +# common LF support +PLATFORM_DEFS += \ + -DWITH_LF \ + -DWITH_HITAG + +# common HF support +PLATFORM_DEFS += \ + -DWITH_ISO15693 \ + -DWITH_LEGICRF \ + -DWITH_ISO14443b \ + -DWITH_ISO14443a \ + -DWITH_ICLASS \ + -DWITH_FELICA \ + -DWITH_HFSNIFF + +# Standalone mode +# !! Choose only one !! +PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_ICERUN +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_SAMYRUN +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_PROXBRUTE +#PLATFORM_DEFS += -DWITH_STANDALONE_LF_HIDBRUTE +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_YOUNG +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_MATTYRUN +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_COLIN +#PLATFORM_DEFS += -DWITH_STANDALONE_HF_BOG + +$(info $(findstring WITH_STANDALONE_*,$(PLATFORM_DEFS))) + +# Misc +#PLATFORM_DEFS += -DWITH_LCD + + +# Add flags dependencies : + +# WITH_FPC_* needs WITH_FPC : ifneq (,$(findstring WITH_FPC_,$(PLATFORM_DEFS))) PLATFORM_DEFS += -DWITH_FPC endif +# WITH_EMV possible if WITH_ISO14443a : +ifneq (,$(findstring WITH_ISO14443a,$(PLATFORM_DEFS))) + PLATFORM_DEFS += -DWITH_EMV +endif + +PLATFORM_DEFS_INFO = $(strip $(filter-out STANDALONE%, $(subst -DWITH_,,$(PLATFORM_DEFS)))) +PLATFORM_DEFS_INFO_STANDALONE = $(strip $(subst STANDALONE_,, $(filter STANDALONE%, $(subst -DWITH_,,$(PLATFORM_DEFS))))) + +# Check that only one Standalone mode has been chosen +ifneq (,$(word 2, $(PLATFORM_DEFS_INFO_STANDALONE))) + $(error You must choose only one Standalone mode!: $(PLATFORM_DEFS_INFO_STANDALONE)) +endif + export PLATFORM export PLTNAME export MCU export PLATFORM_DEFS +export PLATFORM_DEFS_INFO +export PLATFORM_DEFS_INFO_STANDALONE