mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-21 12:37:21 +08:00
style spaces
This commit is contained in:
parent
d17191d0a4
commit
aaedeafbb1
6 changed files with 44 additions and 32 deletions
|
@ -375,17 +375,28 @@ void printUSBSpeed(void) {
|
||||||
uint32_t start_time = end_time = GetTickCount();
|
uint32_t start_time = end_time = GetTickCount();
|
||||||
uint32_t bytes_transferred = 0;
|
uint32_t bytes_transferred = 0;
|
||||||
|
|
||||||
|
uint32_t counter = 0, good = 0, res;
|
||||||
LED_B_ON();
|
LED_B_ON();
|
||||||
while (end_time < start_time + USB_SPEED_TEST_MIN_TIME) {
|
while (end_time < start_time + USB_SPEED_TEST_MIN_TIME) {
|
||||||
cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K, 0, USB_CMD_DATA_SIZE, 0, test_data, USB_CMD_DATA_SIZE);
|
res = cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K, 0, USB_CMD_DATA_SIZE, 0, test_data, USB_CMD_DATA_SIZE);
|
||||||
end_time = GetTickCount();
|
end_time = GetTickCount();
|
||||||
bytes_transferred += USB_CMD_DATA_SIZE;
|
bytes_transferred += USB_CMD_DATA_SIZE;
|
||||||
|
if (res == 0)
|
||||||
|
counter++;
|
||||||
|
else
|
||||||
|
good++;
|
||||||
}
|
}
|
||||||
LED_B_OFF();
|
LED_B_OFF();
|
||||||
|
|
||||||
Dbprintf(" Time elapsed............%dms", end_time - start_time);
|
Dbprintf(" Time elapsed............%dms", end_time - start_time);
|
||||||
Dbprintf(" Bytes transferred.......%d", bytes_transferred);
|
Dbprintf(" Bytes transferred.......%d", bytes_transferred);
|
||||||
Dbprintf(" USB Transfer Speed PM3 -> Client = %d Bytes/s", 1000 * bytes_transferred / (end_time - start_time));
|
Dbprintf(" USB Transfer Speed PM3 -> Client = %d Bytes/s", 1000 * bytes_transferred / (end_time - start_time));
|
||||||
|
if (counter > 0)
|
||||||
|
Dbprintf(" Number of errors %u", counter);
|
||||||
|
if (good > 0) {
|
||||||
|
bytes_transferred = USB_CMD_DATA_SIZE * good;
|
||||||
|
Dbprintf(" Number of good %u / bytes %u, true Speed PM3 -> Client = %d Bytes/s", good, bytes_transferred, 1000 * bytes_transferred / (end_time - start_time));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -449,33 +449,34 @@ void FpgaWriteConfWord(uint8_t v) {
|
||||||
// the samples from the ADC always flow through the FPGA.
|
// the samples from the ADC always flow through the FPGA.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void SetAdcMuxFor(uint32_t whichGpio) {
|
void SetAdcMuxFor(uint32_t whichGpio) {
|
||||||
|
/*
|
||||||
|
#ifndef WITH_FPC
|
||||||
|
// When compiled without FPC support
|
||||||
|
AT91C_BASE_PIOA->PIO_OER =
|
||||||
|
GPIO_MUXSEL_HIPKD |
|
||||||
|
GPIO_MUXSEL_LOPKD |
|
||||||
|
GPIO_MUXSEL_LORAW |
|
||||||
|
GPIO_MUXSEL_HIRAW;
|
||||||
|
|
||||||
#ifndef WITH_FPC
|
AT91C_BASE_PIOA->PIO_PER =
|
||||||
// When compiled without FPC support
|
GPIO_MUXSEL_HIPKD |
|
||||||
AT91C_BASE_PIOA->PIO_OER =
|
GPIO_MUXSEL_LOPKD |
|
||||||
GPIO_MUXSEL_HIPKD |
|
GPIO_MUXSEL_LORAW |
|
||||||
GPIO_MUXSEL_LOPKD |
|
GPIO_MUXSEL_HIRAW;
|
||||||
GPIO_MUXSEL_LORAW |
|
|
||||||
GPIO_MUXSEL_HIRAW;
|
|
||||||
|
|
||||||
AT91C_BASE_PIOA->PIO_PER =
|
LOW(GPIO_MUXSEL_HIPKD);
|
||||||
GPIO_MUXSEL_HIPKD |
|
LOW(GPIO_MUXSEL_LOPKD);
|
||||||
GPIO_MUXSEL_LOPKD |
|
LOW(GPIO_MUXSEL_HIRAW);
|
||||||
GPIO_MUXSEL_LORAW |
|
LOW(GPIO_MUXSEL_LORAW);
|
||||||
GPIO_MUXSEL_HIRAW;
|
|
||||||
|
|
||||||
LOW(GPIO_MUXSEL_HIPKD);
|
#else
|
||||||
LOW(GPIO_MUXSEL_LOPKD);
|
*/
|
||||||
LOW(GPIO_MUXSEL_HIRAW);
|
|
||||||
LOW(GPIO_MUXSEL_LORAW);
|
|
||||||
|
|
||||||
#else
|
|
||||||
// FPC serial uses HIRAW/LOWRAW pins, so they are excluded here.
|
// FPC serial uses HIRAW/LOWRAW pins, so they are excluded here.
|
||||||
AT91C_BASE_PIOA->PIO_OER = GPIO_MUXSEL_HIPKD | GPIO_MUXSEL_LOPKD;
|
AT91C_BASE_PIOA->PIO_OER = GPIO_MUXSEL_HIPKD | GPIO_MUXSEL_LOPKD;
|
||||||
AT91C_BASE_PIOA->PIO_PER = GPIO_MUXSEL_HIPKD | GPIO_MUXSEL_LOPKD;
|
AT91C_BASE_PIOA->PIO_PER = GPIO_MUXSEL_HIPKD | GPIO_MUXSEL_LOPKD;
|
||||||
LOW(GPIO_MUXSEL_HIPKD);
|
LOW(GPIO_MUXSEL_HIPKD);
|
||||||
LOW(GPIO_MUXSEL_LOPKD);
|
LOW(GPIO_MUXSEL_LOPKD);
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
HIGH(whichGpio);
|
HIGH(whichGpio);
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,7 +262,7 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res
|
||||||
switch (endian) {
|
switch (endian) {
|
||||||
case 'b': /* b big-endian (RefIn = false, RefOut = false ) */
|
case 'b': /* b big-endian (RefIn = false, RefOut = false ) */
|
||||||
model.flags &= ~P_REFIN;
|
model.flags &= ~P_REFIN;
|
||||||
//rflags |= R_HAVERI;
|
//rflags |= R_HAVERI;
|
||||||
/* fall through: */
|
/* fall through: */
|
||||||
case 'B': /* B big-endian output (RefOut = false) */
|
case 'B': /* B big-endian output (RefOut = false) */
|
||||||
model.flags &= ~P_REFOUT;
|
model.flags &= ~P_REFOUT;
|
||||||
|
@ -274,7 +274,7 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res
|
||||||
break;
|
break;
|
||||||
case 'l': /* l little-endian input and output */
|
case 'l': /* l little-endian input and output */
|
||||||
model.flags |= P_REFIN;
|
model.flags |= P_REFIN;
|
||||||
//rflags |= R_HAVERI;
|
//rflags |= R_HAVERI;
|
||||||
/* fall through: */
|
/* fall through: */
|
||||||
case 'L': /* L little-endian output */
|
case 'L': /* L little-endian output */
|
||||||
model.flags |= P_REFOUT;
|
model.flags |= P_REFOUT;
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
static ssize_t emv_pk_read_bin(char *buf, unsigned char *bin, size_t size, size_t *read) {
|
static ssize_t emv_pk_read_bin(char *buf, unsigned char *bin, size_t size, size_t *read) {
|
||||||
|
|
||||||
if ( buf == NULL )
|
if (buf == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
size_t left = size;
|
size_t left = size;
|
||||||
|
@ -84,7 +84,7 @@ static ssize_t emv_pk_read_bin(char *buf, unsigned char *bin, size_t size, size_
|
||||||
|
|
||||||
static ssize_t emv_pk_read_ymv(char *buf, unsigned *ymv) {
|
static ssize_t emv_pk_read_ymv(char *buf, unsigned *ymv) {
|
||||||
|
|
||||||
if ( buf == NULL )
|
if (buf == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
@ -124,7 +124,7 @@ static ssize_t emv_pk_read_ymv(char *buf, unsigned *ymv) {
|
||||||
|
|
||||||
static ssize_t emv_pk_read_string(char *buf, char *str, size_t size) {
|
static ssize_t emv_pk_read_string(char *buf, char *str, size_t size) {
|
||||||
|
|
||||||
if ( buf == NULL )
|
if (buf == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
char *p = buf;
|
char *p = buf;
|
||||||
|
|
|
@ -100,8 +100,8 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile, bool hardn
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Input files too big (total > %li bytes). These are probably not PM3 FPGA config files.\n"
|
"Input files too big (total > %li bytes). These are probably not PM3 FPGA config files.\n"
|
||||||
, num_infiles * FPGA_CONFIG_SIZE);
|
, num_infiles * FPGA_CONFIG_SIZE);
|
||||||
}
|
}
|
||||||
for (uint16_t j = 0; j < num_infiles; j++) {
|
for (uint16_t j = 0; j < num_infiles; j++) {
|
||||||
fclose(infile[j]);
|
fclose(infile[j]);
|
||||||
|
|
|
@ -467,7 +467,7 @@ int main(int argc, char *argv[]) {
|
||||||
usb_present = OpenProxmark(port, waitCOMPort, 20, false, speed);
|
usb_present = OpenProxmark(port, waitCOMPort, 20, false, speed);
|
||||||
|
|
||||||
if (TestProxmark() == 0)
|
if (TestProxmark() == 0)
|
||||||
usb_present = false;
|
usb_present = false;
|
||||||
if (!usb_present)
|
if (!usb_present)
|
||||||
PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Check \"%s -h\" if it's not what you want.\n", exec_name);
|
PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Check \"%s -h\" if it's not what you want.\n", exec_name);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue