Skip to content

Commit

Permalink
make style
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Aug 13, 2020
1 parent 8a602ed commit 4ed57c7
Show file tree
Hide file tree
Showing 57 changed files with 883 additions and 883 deletions.
8 changes: 4 additions & 4 deletions armsrc/BigBuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ void BigBuf_print_status(void) {
Dbprintf(" traceLen ...............%d", trace_len);

Dbprintf(" dma8 memory.............%d", dma_8.buf - BigBuf_get_addr());
Dbprintf(" dma16 memory............%d", (uint8_t*)dma_16.buf - BigBuf_get_addr());
Dbprintf(" toSend memory...........%d", toSend.buf - BigBuf_get_addr() );
Dbprintf(" dma16 memory............%d", (uint8_t *)dma_16.buf - BigBuf_get_addr());
Dbprintf(" toSend memory...........%d", toSend.buf - BigBuf_get_addr());
}

// return the maximum trace length (i.e. the unallocated size of BigBuf)
Expand Down Expand Up @@ -229,7 +229,7 @@ bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_
*/
duration = 0;
}

hdr->timestamp = timestamp_start;
hdr->duration = duration & 0xFFFF;
hdr->data_len = iLen;
Expand Down Expand Up @@ -309,7 +309,7 @@ void tosend_stuffbit(int b) {

dmabuf16_t *get_dma16(void) {
if (dma_16.buf == NULL)
dma_16.buf = (uint16_t*)BigBuf_malloc(DMA_BUFFER_SIZE * sizeof(uint16_t));
dma_16.buf = (uint16_t *)BigBuf_malloc(DMA_BUFFER_SIZE * sizeof(uint16_t));

return &dma_16;
}
Expand Down
2 changes: 1 addition & 1 deletion armsrc/BigBuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define DMA_BUFFER_SIZE 256

// 8 data bits and 1 parity bit per payload byte, 1 correction bit, 1 SOC bit, 2 EOC bits
#define TOSEND_BUFFER_SIZE (9 * MAX_FRAME_SIZE + 1 + 1 + 2)
#define TOSEND_BUFFER_SIZE (9 * MAX_FRAME_SIZE + 1 + 1 + 2)

uint8_t *BigBuf_get_addr(void);
uint32_t BigBuf_get_size(void);
Expand Down
2 changes: 1 addition & 1 deletion armsrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SRC_ISO14443b = iso14443b.c
SRC_FELICA = felica.c
SRC_CRAPTO1 = crypto1.c des.c desfire_crypto.c mifaredesfire.c aes.c platform_util.c
SRC_CRC = crc.c crc16.c crc32.c
SRC_ICLASS = iclass.c optimized_cipherutils.c optimized_ikeys.c optimized_elite.c optimized_cipher.c
SRC_ICLASS = iclass.c optimized_cipherutils.c optimized_ikeys.c optimized_elite.c optimized_cipher.c
SRC_LEGIC = legicrf.c legicrfsim.c legic_prng.c
SRC_NFCBARCODE = thinfilm.c

Expand Down
28 changes: 14 additions & 14 deletions armsrc/Standalone/hf_iceclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#define HF_ICLASS_CC_A "iceclass_cc_a.bin"
#define HF_ICLASS_CC_B "iceclass_cc_b.bin"
char* cc_files[] = { HF_ICLASS_CC_A, HF_ICLASS_CC_B };
char *cc_files[] = { HF_ICLASS_CC_A, HF_ICLASS_CC_B };



Expand All @@ -65,7 +65,7 @@ char* cc_files[] = { HF_ICLASS_CC_A, HF_ICLASS_CC_B };
#endif

// iclass card descriptors
char * card_types[] = {
char *card_types[] = {
"PicoPass 16K / 16", // 000
"PicoPass 32K with current book 16K / 16", // 001
"Unknown Card Type!", // 010
Expand Down Expand Up @@ -112,13 +112,13 @@ static uint8_t csns[8 * NUM_CSNS] = {

static void download_instructions(uint8_t t) {
DbpString("");
switch (t) {
switch (t) {
case ICE_STATE_FULLSIM: {
DbpString("The emulator memory was saved to SPIFFS");
DbpString("1. " _YELLOW_("mem spiffs dump o " HF_ICLASS_FULLSIM_MOD_BIN " f " HF_ICLASS_FULLSIM_MOD" e"));
DbpString("2. " _YELLOW_("hf iclass view f " HF_ICLASS_FULLSIM_MOD_BIN));
break;
}
}
case ICE_STATE_ATTACK: {
DbpString("The collected data was saved to SPIFFS. The file names below may differ");
DbpString("1. " _YELLOW_("mem spiffs tree"));
Expand All @@ -143,9 +143,9 @@ static void save_to_flash(uint8_t *data, uint16_t datalen) {

char fn[SPIFFS_OBJ_NAME_LEN];
sprintf(fn, "iclass-%02X%02X%02X%02X%02X%02X%02X%02X.bin",
data[0], data[1], data[2], data[3],
data[4], data[5], data[6], data[7]
);
data[0], data[1], data[2], data[3],
data[4], data[5], data[6], data[7]
);

int res;
if (exists_in_spiffs(fn) == false) {
Expand Down Expand Up @@ -185,7 +185,7 @@ static int fullsim_mode(void) {
Dbprintf("loaded " _GREEN_(HF_ICLASS_FULLSIM_ORIG_BIN) " (%u bytes)", fsize);
}

iclass_simulate(ICLASS_SIM_MODE_FULL, 0 , false, NULL, NULL, NULL);
iclass_simulate(ICLASS_SIM_MODE_FULL, 0, false, NULL, NULL, NULL);

LED_B_ON();
rdv40_spiffs_lazy_mount();
Expand Down Expand Up @@ -252,7 +252,7 @@ static int reader_attack_mode(void) {
rdv40_spiffs_lazy_unmount();
LED_B_OFF();
if (res == SPIFFS_OK) {
Dbprintf("saved to " _GREEN_("%s"), fn);
Dbprintf("saved to " _GREEN_("%s"), fn);
} else {
Dbprintf(_RED_("error") " writing %s to flash ( %d )", fn, res);
}
Expand Down Expand Up @@ -280,7 +280,7 @@ static int reader_dump_mode(void) {
break;
}

// setup authenticate AA1
// setup authenticate AA1
iclass_auth_req_t auth = {
.use_raw = false,
.use_elite = false,
Expand Down Expand Up @@ -334,7 +334,7 @@ static int reader_dump_mode(void) {
res = authenticate_iclass_tag(&auth, hdr, &start_time, &eof_time, NULL);
if (res == false) {
switch_off();
Dbprintf( _RED_("failed AA1 auth") ", skipping ");
Dbprintf(_RED_("failed AA1 auth") ", skipping ");
continue;
}

Expand Down Expand Up @@ -389,7 +389,7 @@ static int reader_dump_mode(void) {
}
}
switch_off();
save_to_flash(card_data, (start_block + dumped) * 8 );
save_to_flash(card_data, (start_block + dumped) * 8);
Dbprintf("%u bytes saved", (start_block + dumped) * 8);
}
DbpString("-=[ exiting " _CYAN_("`read & dump`") " mode ]=-");
Expand All @@ -409,7 +409,7 @@ static int config_sim_mode(void) {

if (res == SPIFFS_OK) {
Dbprintf("loaded " _GREEN_("%s") " (%u bytes) to emulator memory", cc_files[i], fsize);
iclass_simulate(ICLASS_SIM_MODE_FULL, 0 , false, NULL, NULL, NULL);
iclass_simulate(ICLASS_SIM_MODE_FULL, 0, false, NULL, NULL, NULL);
}
}

Expand Down Expand Up @@ -490,7 +490,7 @@ void RunMod(void) {

// Look for config cards
rdv40_spiffs_lazy_mount();
for (uint8_t i =0; i < 2; i++) {
for (uint8_t i = 0; i < 2; i++) {
if (exists_in_spiffs(cc_files[i]) == false) {
Dbprintf(_RED_("error") ", " _YELLOW_("%s") " file missing", cc_files[i]);
mode = ICE_STATE_NONE;
Expand Down
4 changes: 2 additions & 2 deletions armsrc/Standalone/lf_em4100rwc.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ static void fillbuff(uint8_t bit) {
}

static void construct_EM410x_emul(uint64_t id) {

int i, j;
int binary[4] = {0};
int parity[4] = {0};
buflen = 0;

for (i = 0; i < 9; i++)
fillbuff(1);

Expand Down
8 changes: 4 additions & 4 deletions armsrc/appmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static void TimingIntervalAcquisition(void) {

static void print_debug_level(void) {
char dbglvlstr[20] = {0};
switch(DBGLEVEL) {
switch (DBGLEVEL) {
case DBG_NONE:
sprintf(dbglvlstr, "NONE");
break;
Expand All @@ -308,7 +308,7 @@ static void print_debug_level(void) {
case DBG_DEBUG:
sprintf(dbglvlstr, "DEBUG");
break;
case DBG_EXTENDED:
case DBG_EXTENDED:
sprintf(dbglvlstr, "EXTENDED");
break;
}
Expand Down Expand Up @@ -362,9 +362,9 @@ static void SendStatus(void) {

print_stack_usage();
print_debug_level();

tosend_t *ts = get_tosend();
Dbprintf(" ToSendMax...............%d", ts->max );
Dbprintf(" ToSendMax...............%d", ts->max);
Dbprintf(" ToSend BUFFERSIZE.......%d", TOSEND_BUFFER_SIZE);
while ((AT91C_BASE_PMC->PMC_MCFR & AT91C_CKGR_MAINRDY) == 0); // Wait for MAINF value to become available...
uint16_t mainf = AT91C_BASE_PMC->PMC_MCFR & AT91C_CKGR_MAINF; // Get # main clocks within 16 slow clocks
Expand Down
Loading

0 comments on commit 4ed57c7

Please sign in to comment.