diff --git a/armsrc/epa.c b/armsrc/epa.c index 2a0025610..b2a1b5ec5 100644 --- a/armsrc/epa.c +++ b/armsrc/epa.c @@ -22,10 +22,12 @@ #include "commonutil.h" #include "ticks.h" +#ifdef WITH_ISO14443a // Protocol and Parameter Selection Request for ISO 14443 type A cards // use regular (1x) speed in both directions // CRC is already included static const uint8_t pps[] = {0xD0, 0x11, 0x00, 0x52, 0xA6}; +#endif // APDUs for communication with German Identification Card @@ -116,9 +118,25 @@ static char iso_type = 0; static int EPA_APDU(uint8_t *apdu, size_t length, uint8_t *response, uint16_t respmaxlen) { switch (iso_type) { case 'a': +#ifdef WITH_ISO14443a return iso14_apdu(apdu, (uint16_t) length, false, response, NULL); +#else + (void) apdu; + (void) length; + (void) response; + (void) respmaxlen; + return PM3_ENOTIMPL; +#endif case 'b': +#ifdef WITH_ISO14443b return iso14443b_apdu(apdu, length, false, response, respmaxlen, NULL); +#else + (void) apdu; + (void) length; + (void) response; + (void) respmaxlen; + return PM3_ENOTIMPL; +#endif default: return 0; } @@ -522,7 +540,10 @@ void EPA_PACE_Replay(PacketCommandNG *c) { //----------------------------------------------------------------------------- int EPA_Setup(void) { +#ifdef WITH_ISO14443a +{ // first, look for type A cards + FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); // power up the field iso14443a_setup(FPGA_HF_ISO14443A_READER_MOD); iso14a_card_select_t card_a_info; @@ -541,20 +562,24 @@ int EPA_Setup(void) { iso_type = 'a'; return 0; } - - FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); - +} +#endif +#ifdef WITH_ISO14443b +{ // if we're here, there is no type A card, so we look for type B + FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); // power up the field iso14443b_setup(); iso14b_card_select_t card_b_info; - return_code = iso14443b_select_card(&card_b_info); + int return_code = iso14443b_select_card(&card_b_info); if (return_code == 0) { Dbprintf("ISO 14443 Type B"); iso_type = 'b'; return 0; } +} +#endif Dbprintf("No card found"); return 1; } diff --git a/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md b/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md index a61fcaf10..7b4ae12d4 100644 --- a/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md +++ b/doc/md/Use_of_Proxmark/4_Advanced-compilation-parameters.md @@ -141,6 +141,8 @@ SKIP_FELICA=1 ``` Situation might change when the firmware is growing of course, requiring to skip more elements. +Last note: if you skip a tech, be careful not to use a standalone mode which requires that same tech, else the firmware size reduction won't be much. + ## Next step See [Compilation instructions](/doc/md/Use_of_Proxmark/0_Compilation-Instructions.md)