style
This commit is contained in:
@@ -101,7 +101,7 @@ int gLow = 0;
|
||||
static void init_tag(void) {
|
||||
|
||||
// iceman: memset(tag.sectors, 0x00, sizeof));
|
||||
|
||||
|
||||
// initialize global tag structure
|
||||
for (int i = 0; i < 34; i++)
|
||||
for (int j = 0; j < 7; j++)
|
||||
@@ -324,7 +324,7 @@ static uint32_t get_pulse_length(void) {
|
||||
while (sample > gLow && (timeout--)) {
|
||||
sample = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||
}
|
||||
|
||||
|
||||
if (timeout == 0)
|
||||
return 0;
|
||||
|
||||
@@ -346,7 +346,7 @@ static uint32_t get_pulse_length(void) {
|
||||
if (timeout == 0)
|
||||
return 0;
|
||||
|
||||
return (uint32_t)AT91C_BASE_TC1->TC_CV;
|
||||
return (uint32_t)AT91C_BASE_TC1->TC_CV;
|
||||
|
||||
}
|
||||
|
||||
@@ -836,7 +836,7 @@ void em4x50_read(em4x50_data_t *etd) {
|
||||
|
||||
// set gHigh and gLow
|
||||
if (get_signalproperties() && find_em4x50_tag()) {
|
||||
|
||||
|
||||
if (etd->addr_given) {
|
||||
|
||||
// selective read mode
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
#define ISO15693_READER_TIMEOUT 330 // 330/212kHz = 1558us
|
||||
#define ISO15693_READER_TIMEOUT_WRITE 4700 // 4700/212kHz = 22ms, nominal 20ms
|
||||
|
||||
// iceman: This defines below exists in the header file, just here for my easy reading
|
||||
// iceman: This defines below exists in the header file, just here for my easy reading
|
||||
// Delays in SSP_CLK ticks.
|
||||
// SSP_CLK runs at 13,56MHz / 32 = 423.75kHz when simulating a tag
|
||||
//#define DELAY_ISO15693_VCD_TO_VICC_SIM 132 // 132/423.75kHz = 311.5us from end of command EOF to start of tag response
|
||||
@@ -700,7 +700,7 @@ int GetIso15693AnswerFromTag(uint8_t *response, uint16_t max_len, uint16_t timeo
|
||||
AT91C_BASE_PDC_SSC->PDC_RNPR = (uint32_t) dma->buf;
|
||||
AT91C_BASE_PDC_SSC->PDC_RNCR = DMA_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
|
||||
WDT_HIT();
|
||||
if (BUTTON_PRESS()) {
|
||||
DbpString("stopped");
|
||||
@@ -725,7 +725,7 @@ int GetIso15693AnswerFromTag(uint8_t *response, uint16_t max_len, uint16_t timeo
|
||||
|
||||
// timeout
|
||||
if (samples > timeout && dt->state < STATE_TAG_RECEIVING_DATA) {
|
||||
ret = -3;
|
||||
ret = -3;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1735,7 +1735,7 @@ void SimTagIso15693(uint8_t *uid) {
|
||||
|
||||
if (button_pressed)
|
||||
DbpString("button pressed");
|
||||
|
||||
|
||||
reply_ng(CMD_HF_ISO15693_SIMULATE, PM3_SUCCESS, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -1880,7 +1880,7 @@ SLIx functions from official master forks.
|
||||
void LockPassSlixIso15693(uint32_t pass_id, uint32_t password) {
|
||||
|
||||
LED_A_ON();
|
||||
|
||||
|
||||
uint8_t cmd_inventory[] = {ISO15693_REQ_DATARATE_HIGH | ISO15693_REQ_INVENTORY | ISO15693_REQINV_SLOT1, 0x01, 0x00, 0x00, 0x00 };
|
||||
uint8_t cmd_get_rnd[] = {ISO15693_REQ_DATARATE_HIGH, 0xB2, 0x04, 0x00, 0x00 };
|
||||
uint8_t cmd_set_pass[] = {ISO15693_REQ_DATARATE_HIGH, 0xB3, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
@@ -1892,7 +1892,7 @@ void LockPassSlixIso15693(uint32_t pass_id, uint32_t password) {
|
||||
uint32_t start_time = 0;
|
||||
bool done = false;
|
||||
|
||||
// setup 'get random number' command
|
||||
// setup 'get random number' command
|
||||
crc = Iso15693Crc(cmd_get_rnd, 3);
|
||||
cmd_get_rnd[3] = crc & 0xff;
|
||||
cmd_get_rnd[4] = crc >> 8;
|
||||
@@ -1900,7 +1900,7 @@ void LockPassSlixIso15693(uint32_t pass_id, uint32_t password) {
|
||||
Dbprintf("LockPass: Press button lock password, long-press to terminate.");
|
||||
|
||||
while (!done) {
|
||||
|
||||
|
||||
LED_D_ON();
|
||||
switch(BUTTON_HELD(1000)) {
|
||||
case BUTTON_SINGLE_CLICK:
|
||||
@@ -2032,7 +2032,7 @@ void SetTag15693Uid(uint8_t *uid) {
|
||||
SendDataTag(cmd[i], sizeof(cmd[i]), i == 0 ? true : false, true, recvbuf, sizeof(recvbuf), start_time, ISO15693_READER_TIMEOUT_WRITE, &eof_time);
|
||||
start_time = eof_time + DELAY_ISO15693_VICC_TO_VCD_READER;
|
||||
}
|
||||
|
||||
|
||||
reply_ng(CMD_HF_ISO15693_CSETUID, PM3_SUCCESS, NULL, 0);
|
||||
switch_off();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -534,7 +534,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1
|
||||
while (!button_pushed && !finished) {
|
||||
|
||||
WDT_HIT();
|
||||
|
||||
|
||||
if (counter == 2000) {
|
||||
if (data_available()) {
|
||||
break;
|
||||
|
||||
@@ -56,7 +56,7 @@ static void usart_fill_rxfifo(void) {
|
||||
rxfifo_free = us_rxfifo_low - us_rxfifo_high;
|
||||
else
|
||||
rxfifo_free = sizeof(us_rxfifo) - us_rxfifo_high + us_rxfifo_low;
|
||||
|
||||
|
||||
uint16_t available = USART_BUFFLEN - usart_cur_inbuf_off;
|
||||
|
||||
if (available <= rxfifo_free) {
|
||||
|
||||
Reference in New Issue
Block a user