style spaces

This commit is contained in:
iceman1001 2019-04-16 16:56:56 +02:00
parent d17191d0a4
commit aaedeafbb1
6 changed files with 44 additions and 32 deletions

View file

@ -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));
}
} }
/** /**

View file

@ -449,7 +449,7 @@ 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 #ifndef WITH_FPC
// When compiled without FPC support // When compiled without FPC support
AT91C_BASE_PIOA->PIO_OER = AT91C_BASE_PIOA->PIO_OER =
@ -470,12 +470,13 @@ void SetAdcMuxFor(uint32_t whichGpio) {
LOW(GPIO_MUXSEL_LORAW); LOW(GPIO_MUXSEL_LORAW);
#else #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);
} }