diff --git a/armsrc/Standalone/hf_colin.c b/armsrc/Standalone/hf_colin.c index d2075f38f..0656d1186 100644 --- a/armsrc/Standalone/hf_colin.c +++ b/armsrc/Standalone/hf_colin.c @@ -81,12 +81,12 @@ */ -uint8_t cjuid[10]; -uint32_t cjcuid; -iso14a_card_select_t p_card; -int currline; -int currfline; -int curlline; +static uint8_t cjuid[10]; +static uint32_t cjcuid; +static iso14a_card_select_t p_card; +static int currline; +static int currfline; +static int curlline; // TODO : Implement fast read of KEYS like in RFIdea // also http://ext.delaat.net/rp/2015-2016/p04/report.pdf @@ -162,7 +162,7 @@ static void scan_keys(const char *str, int len, uint64_t *user_data) { } } -MFC1KSchema Schemas[MAX_SCHEMAS]; +static MFC1KSchema Schemas[MAX_SCHEMAS]; /*MFC1KSchema Noralsy = { .name = "Noralsy", @@ -196,7 +196,7 @@ MFC1KSchema InfiHexact = {.name = "Infineon/Hexact", 0x8829da9daf76, 0x8829da9daf76, 0x8829da9daf76, 0x8829da9daf76}}; */ -int total_schemas = 0; +static int total_schemas = 0; static void add_schema(MFC1KSchema *p, MFC1KSchema a, int *schemas_counter) { if (*schemas_counter < MAX_SCHEMAS) { diff --git a/armsrc/Standalone/hf_mattyrun.c b/armsrc/Standalone/hf_mattyrun.c index ae81eb408..1ffa321a3 100644 --- a/armsrc/Standalone/hf_mattyrun.c +++ b/armsrc/Standalone/hf_mattyrun.c @@ -49,19 +49,19 @@ on a blank card. #include "mifaresim.h" // mifare1ksim #include "mifareutil.h" -uint8_t uid[10]; -uint32_t cuid; -iso14a_card_select_t p_card; +static uint8_t uid[10]; +static uint32_t cuid; +static iso14a_card_select_t p_card; /* Pseudo-configuration block. */ -bool printKeys = false; // Prints keys -bool transferToEml = true; // Transfer keys to emulator memory -bool ecfill = true; // Fill emulator memory with cards content. -bool simulation = true; // Simulates an exact copy of the target tag -bool fillFromEmulator = false; // Dump emulator memory. -uint8_t stKeyBlock = 20; // Set the quantity of keys in the block. +static bool printKeys = false; // Prints keys +static bool transferToEml = true; // Transfer keys to emulator memory +static bool ecfill = true; // Fill emulator memory with cards content. +static bool simulation = true; // Simulates an exact copy of the target tag +static bool fillFromEmulator = false; // Dump emulator memory. +static uint8_t stKeyBlock = 20; // Set the quantity of keys in the block. //----------------------------------------------------------------------------- // Matt's StandAlone mod. diff --git a/armsrc/Standalone/hf_msdsal.c b/armsrc/Standalone/hf_msdsal.c index e890818d2..e9f700a01 100644 --- a/armsrc/Standalone/hf_msdsal.c +++ b/armsrc/Standalone/hf_msdsal.c @@ -52,7 +52,7 @@ void ModInfo(void) { * technologies. Be brave enough to share your knowledge & inspire others. Salvador Mendoza. */ -uint8_t ppdol [255] = {0x80, 0xA8, 0x00, 0x00, 0x02, 0x83, 0x00}; // Default GET PROCESSING +static uint8_t ppdol [255] = {0x80, 0xA8, 0x00, 0x00, 0x02, 0x83, 0x00}; // Default GET PROCESSING static uint8_t treatPDOL(uint8_t *apdu) { //Generate GET PROCESSING uint8_t plen = 7; diff --git a/armsrc/Standalone/lf_em4100emul.c b/armsrc/Standalone/lf_em4100emul.c index 6ad2580a4..e6ac2f6ff 100644 --- a/armsrc/Standalone/lf_em4100emul.c +++ b/armsrc/Standalone/lf_em4100emul.c @@ -25,11 +25,9 @@ // low & high - array for storage IDs. Its length must be equal. // Predefined IDs must be stored in low[]. -// In high[] must be nulls -uint64_t low[] = {0x565A1140BE, 0x365A398149, 0x5555555555, 0xFFFFFFFFFF}; -uint32_t high[] = {0, 0, 0, 0}; -uint8_t *bba, slots_count; -int buflen; +static uint64_t low[] = {0x565A1140BE, 0x365A398149, 0x5555555555, 0xFFFFFFFFFF}; +static uint8_t *bba, slots_count; +static int buflen; void ModInfo(void) { DbpString(" LF EM4100 simulator standalone mode"); diff --git a/armsrc/Standalone/lf_em4100rswb.c b/armsrc/Standalone/lf_em4100rswb.c index dd9fafd6a..ac470ce29 100644 --- a/armsrc/Standalone/lf_em4100rswb.c +++ b/armsrc/Standalone/lf_em4100rswb.c @@ -68,16 +68,16 @@ // Predefined bruteforce speed // avg: 1s, 1.2s, 1.5s, 2s -int bruteforceSpeedCurrent = 1; -int bruteforceSpeed[] = {10, 12, 14, 16}; +static int bruteforceSpeedCurrent = 1; +static int bruteforceSpeed[] = {10, 12, 14, 16}; // low & high - array for storage IDs. Its length must be equal. // Predefined IDs must be stored in low[]. // In high[] must be nulls -uint64_t low[] = {0, 0, 0, 0}; -uint32_t high[] = {0, 0, 0, 0}; -uint8_t *bba; -int buflen; +static uint64_t low[] = {0, 0, 0, 0}; +static uint32_t high[] = {0, 0, 0, 0}; +static uint8_t *bba; +static int buflen; void ModInfo(void) { DbpString(" LF EM4100 read/sim/write/brute mode"); diff --git a/armsrc/Standalone/lf_em4100rwc.c b/armsrc/Standalone/lf_em4100rwc.c index ce96dd824..f69820513 100644 --- a/armsrc/Standalone/lf_em4100rwc.c +++ b/armsrc/Standalone/lf_em4100rwc.c @@ -39,10 +39,10 @@ // low & high - array for storage IDs. Its length must be equal. // Predefined IDs must be stored in low[]. // In high[] must be nulls -uint64_t low[] = {0x565AF781C7, 0x540053E4E2, 0x1234567890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -uint32_t high[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -uint8_t *bba, slots_count; -int buflen; +static uint64_t low[] = {0x565AF781C7, 0x540053E4E2, 0x1234567890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static uint32_t high[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static uint8_t *bba, slots_count; +static int buflen; void ModInfo(void) { DbpString(" LF EM4100 read/write/clone mode"); diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 87b3dd0df..fa9aaf0f6 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -70,9 +70,11 @@ #define TOSEND_BUFFER_SIZE (9*MAX_FRAME_SIZE + 1 + 1 + 2) // 8 data bits and 1 parity bit per payload byte, 1 correction bit, 1 SOC bit, 2 EOC bits uint8_t ToSend[TOSEND_BUFFER_SIZE]; int ToSendMax = -1; + + static int ToSendBit; struct common_area common_area __attribute__((section(".commonarea"))); -int button_status = BUTTON_NO_CLICK; +static int button_status = BUTTON_NO_CLICK; static bool allow_send_wtx = false; inline void send_wtx(uint16_t wtx) { diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index 499932f0a..c39576c27 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -67,7 +67,7 @@ static uint8_t iso14_pcb_blocknum = 0; #define DELAY_ARM2AIR_AS_READER (4*16 + 8*16 + 8 + 8 + 1) // The FPGA will report its internal sending delay in -uint16_t FpgaSendQueueDelay; +static uint16_t FpgaSendQueueDelay; // the 5 first bits are the number of bits buffered in mod_sig_buf // the last three bits are the remaining ticks/2 after the mod_sig_buf shift #define DELAY_FPGA_QUEUE (FpgaSendQueueDelay<<1) diff --git a/armsrc/lfadc.c b/armsrc/lfadc.c index 078745dd8..cec945b20 100644 --- a/armsrc/lfadc.c +++ b/armsrc/lfadc.c @@ -51,8 +51,8 @@ bool lf_test_periods(size_t expected, size_t count) { ////////////////////////////////////////////////////////////////////////////// // Low frequency (LF) adc passthrough functionality ////////////////////////////////////////////////////////////////////////////// -uint8_t previous_adc_val = 0; -uint8_t adc_avg = 0; +static uint8_t previous_adc_val = 0; +static uint8_t adc_avg = 0; void lf_sample_mean(void) { uint8_t periods = 0; diff --git a/armsrc/lfops.c b/armsrc/lfops.c index 7eececdc9..9ef3a34a8 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -2289,10 +2289,10 @@ void WriteEM410x(uint32_t card, uint32_t id_hi, uint32_t id_lo) { #define FWD_CMD_READ 0x9 #define FWD_CMD_DISABLE 0x5 -uint8_t forwardLink_data[64]; //array of forwarded bits -uint8_t *forward_ptr; //ptr for forward message preparation -uint8_t fwd_bit_sz; //forwardlink bit counter -uint8_t *fwd_write_ptr; //forwardlink bit pointer +static uint8_t forwardLink_data[64]; //array of forwarded bits +static uint8_t *forward_ptr; //ptr for forward message preparation +static uint8_t fwd_bit_sz; //forwardlink bit counter +static uint8_t *fwd_write_ptr; //forwardlink bit pointer //==================================================================== // prepares command bits diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 79efc8b9f..b98526726 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -2008,9 +2008,9 @@ out: // bit 6 - wipe tag. //----------------------------------------------------------------------------- // magic uid card generation 1 commands -uint8_t wupC1[] = { MIFARE_MAGICWUPC1 }; -uint8_t wupC2[] = { MIFARE_MAGICWUPC2 }; -uint8_t wipeC[] = { MIFARE_MAGICWIPEC }; +static uint8_t wupC1[] = { MIFARE_MAGICWUPC1 }; +static uint8_t wupC2[] = { MIFARE_MAGICWUPC2 }; +static uint8_t wipeC[] = { MIFARE_MAGICWIPEC }; void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) { diff --git a/armsrc/thinfilm.c b/armsrc/thinfilm.c index d84c2711a..a77a70744 100644 --- a/armsrc/thinfilm.c +++ b/armsrc/thinfilm.c @@ -49,7 +49,7 @@ void ReadThinFilm(void) { #define SEC_D 0xf0 #define SEC_E 0x0f #define SEC_F 0x00 -uint16_t FpgaSendQueueDelay; +static uint16_t FpgaSendQueueDelay; static uint16_t ReadReaderField(void) { #if defined RDV4