sgpio_if (top.vhd) CPLD VHDL fix for IQ/aliasing problems for ADC. (cpldjtagprog => sgpio_if_xsvf.h updated to rebuild).

usb_performance.c SGPIO IQ fix for ADC (QI->IQ) for new CPLD (use usb_performance_rom_to_ram version else there is some packet lost even at 10Mhz sampling rate => make -f Makefile_rom_to_ram.)
This commit is contained in:
TitanMKD
2013-04-04 19:43:30 +02:00
parent 118953b451
commit 294e958472
8 changed files with 5089 additions and 3493 deletions

File diff suppressed because it is too large Load Diff

View File

@ -808,20 +808,28 @@ void sgpio_irqhandler() {
if( transceiver_mode == TRANSCEIVER_MODE_RX ) {
__asm__(
"ldr r0, [%[SGPIO_REG_SS], #44]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #0]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #20]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #4]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #40]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #8]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #8]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #12]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #36]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #16]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #16]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #20]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #32]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #24]\n\t"
"ldr r0, [%[SGPIO_REG_SS], #0]\n\t"
"rev16 r0, r0\n\t" /* Swap QI -> IQ */
"str r0, [%[p], #28]\n\t"
:
: [SGPIO_REG_SS] "l" (SGPIO_PORT_BASE + 0x100),

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
Programmer Jedec Bit Map
Date Extracted: Wed Apr 03 20:29:28 2013
Date Extracted: Thu Apr 04 19:23:47 2013
QF25812*
QP100*
@ -16,21 +16,21 @@ L000000 1111111111111111*
L000016 1111111111111111*
L000032 1111111111111111*
L000048 1111111111111111*
L000064 1111111010110111*
L000080 1111111011010111*
L000096 1111111010110111*
L000112 1110011011111111*
L000128 1111111010110111*
L000144 1111111010110111*
L000160 1111111010110111*
L000176 1111111011010111*
L000192 1111111011010111*
L000064 1111111111111111*
L000080 1111111111111111*
L000096 1111111111111111*
L000112 1111111111111111*
L000128 1111111111111111*
L000144 1111111111111111*
L000160 1111111111111111*
L000176 1111111111111111*
L000192 1111111111111111*
L000208 1111111111111111*
L000224 1111111111111111*
L000240 1111111011010111*
L000240 1111111111111111*
L000256 1111111111111111*
L000272 1111111111111111*
L000288 1111111011110011*
L000288 1111111111111111*
L000304 1111111111111111*
L000320 1111111111111111*
L000336 1111111111111111*
@ -44,7 +44,7 @@ L000448 1111111111111111*
L000464 1111111111111111*
L000480 1111111111111111*
L000496 1111111111111111*
L000512 1111111011100111*
L000512 1111111111111111*
L000528 1111111111111111*
L000544 1111111111111111*
L000560 1111111111111111*
@ -61,7 +61,7 @@ L000880 111111111111111111111111111111111111111111111111111111111111111111111111
L000960 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L001040 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L001120 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L001200 11111111111011111111111111111111111111111111111111111111111111111111111111111111*
L001200 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L001280 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L001360 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L001440 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -79,37 +79,37 @@ L002320 111111111111111111111111111111111111111111111111111111111111111111111111
L002400 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002480 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002560 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002640 11111111111111011111111111111111111111111111111111111111111111111111111111111111*
L002640 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002720 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002800 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002880 11111111111111111111111111111111111111111111111111111111111111111011111111111111*
L002880 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L002960 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003040 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003120 11111111111111111111111111111111111101111111111111111111111111111111111111111111*
L003120 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003200 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003280 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003360 11111111111111111101111111111111111111111111111111111111111111111111111111111111*
L003360 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003440 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003520 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003600 11111111111101111111111111111111111111111111111111111111111111111111111111111111*
L003600 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003680 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003760 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003840 11111111011111111111111111111111111111111111111111111111111111111111111111111111*
L003840 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L003920 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004000 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004080 11111111111111110111111111111111111111111111111111111111111111111111111111111111*
L004080 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004160 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004240 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004320 11111111111111111111011111111111111111111111111111111111111111111111111111111111*
L004320 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004400 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004480 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004560 11111111111111111111110111111111111111111111111111111111111111111111111111111111*
L004560 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004640 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004720 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004800 11111111111111111111111111111101111111111111111111111111111111111111111111111111*
L004800 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004880 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L004960 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L005040 11111111111111111111111101111111111111111111111111111111111111111111111111111111*
L005040 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
Note Block 0 PLA OR array *
L005120 1111111111111111*
@ -140,7 +140,7 @@ L005504 1111111111111111*
L005520 1111111111111111*
L005536 1111111111111111*
L005552 1111111111111111*
L005568 1111101111111111*
L005568 1111111111111111*
L005584 1111111111111111*
L005600 1111111111111111*
L005616 1111111111111111*
@ -176,37 +176,37 @@ L006043 000001111001111100010000001*
L006070 000001111001111100010000001*
L006097 000001111001111100010000001*
L006124 000001111001111100010000001*
L006151 000101111111111100000000001*
L006178 000001111001111101010000001*
L006205 000001111001111101010000001*
L006232 000101111000011101001000101*
L006259 000101111000011101001000101*
L006286 000101111000011101001000101*
L006313 000101111000011101001000101*
L006340 000101111000011101001000101*
L006367 000101111000011101001000101*
L006394 000101111000011101001000101*
L006421 000101111000011101001000101*
L006151 000001111001111100010000001*
L006178 000001111001111100010000001*
L006205 000001111001111100010000001*
L006232 000001111001111100010000001*
L006259 000001111001111100010000001*
L006286 000001111001111100010000001*
L006313 000001111001111100010000001*
L006340 000001111001111100010000001*
L006367 000001111001111100010000001*
L006394 000001111001111100010000001*
L006421 000001111001111100010000001*
Note Block 1 *
Note Block 1 ZIA *
L006448 1111111011110101*
L006464 1111111011110101*
L006480 1111111011110011*
L006496 1111111011110101*
L006512 1111111111111111*
L006448 1111111111111111*
L006464 1111111011010111*
L006480 1111111011010111*
L006496 1111111011010111*
L006512 1111111011010111*
L006528 1111111011010111*
L006544 1111111011110101*
L006544 1111111111111111*
L006560 1111111111111111*
L006576 1111111011110101*
L006592 1111111011110101*
L006608 1111111111111111*
L006576 1111111111111111*
L006592 1111111011010111*
L006608 1111111011100111*
L006624 1111111111111111*
L006640 1111111111111111*
L006656 1111111111111111*
L006672 1111111011110110*
L006688 1111111011110110*
L006704 1111111111111111*
L006672 1111111011100111*
L006688 1111111011110011*
L006704 1111111011100111*
L006720 1111111111111111*
L006736 1111111111111111*
L006752 1111111111111111*
@ -232,8 +232,8 @@ L007056 1111111111111111*
L007072 1111111111111111*
Note Block 1 PLA AND array *
L007088 11110111110111111111111111111111111111111111111111111111111111111111111111111111*
L007168 11111011111011111111111111111111111111111111111111111111111111111111111111111111*
L007088 11111111110111111111111111111101111111111111111111111111111111111111111111111111*
L007168 11111111111011111111111111111110111111111111111111111111111111111111111111111111*
L007248 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007328 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L007408 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -251,13 +251,13 @@ L008288 111111111111111111111111111111111111111111111111111111111111111111111111
L008368 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008448 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008528 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008608 11111110110111111111111111111111111111111111111111111111111111111111111111111111*
L008608 11111111110111111111111111111011111111111111111111111111111111111111111111111111*
L008688 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008768 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L008848 11111111110111110111111111111111111111111111111111111111111111111111111111111111*
L008848 11011111110111111111111111111111111111111111111111111111111111111111111111111111*
L008928 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009008 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009088 11111111110111111101111111111111111111111111111111111111111111111111111111111111*
L009088 11110111110111111111111111111111111111111111111111111111111111111111111111111111*
L009168 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009248 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009328 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -266,22 +266,22 @@ L009488 111111111111111111111111111111111111111111111111111111111111111111111111
L009568 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009648 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009728 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009808 11011111110111111111111111111111111111111111111111111111111111111111111111111111*
L009808 11111111010111111111111111111111111111111111111111111111111111111111111111111111*
L009888 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L009968 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010048 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010128 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010208 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010288 01111111110111111111111111111111111111111111111111111111111111111111111111111111*
L010288 11111101110111111111111111111111111111111111111111111111111111111111111111111111*
L010368 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010448 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010528 11111111110101111111111111111111111111111111111111111111111111111111111111111111*
L010528 11111111110111111101111111111111111111111111111111111111111111111111111111111111*
L010608 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010688 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010768 11111111110111111111111111110111111111111111111111111111111111111111111111111111*
L010768 11111111110111111111011111111111111111111111111111111111111111111111111111111111*
L010848 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L010928 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011008 11111111110111111111111111111101111111111111111111111111111111111111111111111111*
L011008 11111111110111111111111111111111011111111111111111111111111111111111111111111111*
L011088 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011168 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L011248 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -358,7 +358,7 @@ L012599 000101111001111101000000001*
L012626 000001111001111110011111100*
L012653 000001111000011100011111100*
L012680 000101111001111101000000001*
L012707 000001111000000100011111101*
L012707 000001111001100100011111101*
L012734 000101111001111101000000001*
L012761 000101111001111101000000001*
L012788 000101111001111101000000001*
@ -368,22 +368,22 @@ L012869 000001111001111100010000001*
Note Block 2 *
Note Block 2 ZIA *
L012896 1111111011110101*
L012912 1111111011110101*
L012896 1111111111111111*
L012912 1111111111111111*
L012928 1111111111111111*
L012944 1111111011110101*
L012960 1111111111111111*
L012976 1111111111111111*
L012992 1111111011100111*
L012944 1111111111111111*
L012960 1111111010110111*
L012976 1111111011010111*
L012992 1111111010110111*
L013008 1110011011111111*
L013024 1111111011110101*
L013040 1111111011110101*
L013056 1111111111111111*
L013072 1111111111111111*
L013088 1111111111111111*
L013104 1111111011110101*
L013120 1111111011110110*
L013136 1111111011110110*
L013024 1111111010110111*
L013040 1111111010110111*
L013056 1111111010110111*
L013072 1111111011010111*
L013088 1111111011010111*
L013104 1111111111111111*
L013120 1111111111111111*
L013136 1111111011010111*
L013152 1111111111111111*
L013168 1111111111111111*
L013184 1111111111111111*
@ -400,7 +400,7 @@ L013344 1111111111111111*
L013360 1111111111111111*
L013376 1111111111111111*
L013392 1111111111111111*
L013408 1111111111111111*
L013408 1111111011100111*
L013424 1111111111111111*
L013440 1111111111111111*
L013456 1111111111111111*
@ -410,14 +410,14 @@ L013504 1111111111111111*
L013520 1111111111111111*
Note Block 2 PLA AND array *
L013536 11111111111110111111111111111111111111111111111111111111111111111111111111111111*
L013536 11111111111111111111111111111111111111111111111111111111111111111011111111111111*
L013616 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L013696 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L013776 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L013856 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L013936 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014016 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014096 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014096 11111111111011111111111111111111111111111111111111111111111111111111111111111111*
L014176 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014256 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014336 11111111111111011111111111111111111111111111111111111111111111111111111111111111*
@ -426,28 +426,28 @@ L014496 111111111111111111111111111111111111111111111111111111111111111111111111
L014576 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014656 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014736 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014816 11111111111111111111111111111101111111111111111111111111111111111111111111111111*
L014816 11111111111111111101111111111111111111111111111111111111111111111111111111111111*
L014896 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L014976 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015056 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015136 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015216 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015296 11111111111111111111111111110111111111111111111111111111111111111111111111111111*
L015296 11111111111101111111111111111111111111111111111111111111111111111111111111111111*
L015376 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015456 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015536 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015616 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015696 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015776 11111101111111111111111111111111111111111111111111111111111111111111111111111111*
L015776 11111111111111111111111101111111111111111111111111111111111111111111111111111111*
L015856 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L015936 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016016 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016096 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016176 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016256 11111111111111111111111111011111111111111111111111111111111111111111111111111111*
L016256 11111111011111111111111111111111111111111111111111111111111111111111111111111111*
L016336 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016416 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016496 01111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016496 11111111111111110111111111111111111111111111111111111111111111111111111111111111*
L016576 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016656 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L016736 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
@ -459,13 +459,13 @@ L017136 111111111111111111111111111111111111111111111111111111111111111111111111
L017216 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017296 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017376 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017456 11011111111111111111111111111111111111111111111111111111111111111111111111111111*
L017456 11111111111111111111011111111111111111111111111111111111111111111111111111111111*
L017536 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017616 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017696 11111111111111111101111111111111111111111111111111111111111111111111111111111111*
L017696 11111111111111111111110111111111111111111111111111111111111111111111111111111111*
L017776 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017856 11111111111111111111111111111111111111111111111111111111111111111111111111111111*
L017936 11111111111111110111111111111111111111111111111111111111111111111111111111111111*
L017936 11111111111111111111111111111101111111111111111111111111111111111111111111111111*
Note Block 2 PLA OR array *
L018016 0111111111111111*
@ -529,20 +529,20 @@ Note Block 2 I/O Macrocell Configuration 27 bits *
N Aclk ClkOp Clk:2 ClkFreq R:2 P:2 RegMod:2 INz:2 FB:2 InReg St XorIn:2 RegCom Oe:4 Tm Slw Pu*
L018912 000101111111111100000000001*
L018939 000001111001111110011111100*
L018966 000001111001111101010000001*
L018966 000101111000011101001000101*
L018993 000001111001111110011111100*
L019020 000001111001111101010000001*
L019020 000101111000011101001000101*
L019047 000001111001111110011111100*
L019074 000001111001111101010000001*
L019074 000101111000011101001000101*
L019101 000001111000011100011111100*
L019128 000001111001111101010000001*
L019155 000001111001111101010000001*
L019128 000101111000011101001000101*
L019155 000101111000011101001000101*
L019182 000001111000011100011111100*
L019209 000001111001111110011111100*
L019236 000001111001111110011111100*
L019263 000001111001111101010000001*
L019290 000001111001111101010000001*
L019317 000001111001111101010000001*
L019263 000101111000011101001000101*
L019290 000101111000011101001000101*
L019317 000101111000011101001000101*
Note Block 3 *
Note Block 3 ZIA *
@ -753,5 +753,5 @@ L025810 0*
Note I/O Bank 1 Vcco *
L025811 0*
CFE0C*
D09F
C09A6*
D0A4

View File

@ -63,7 +63,7 @@ architecture Behavioral of top is
begin
B1AUX <= (others => '0');
--B2AUX <= (others => '0');
B2AUX <= (others => '0');
------------------------------------------------
-- Codec interface
@ -94,7 +94,6 @@ begin
transfer_direction_i <= to_dac when HOST_DIRECTION = '1'
else from_adc;
B2AUX <= HOST_DATA & host_clk_i & host_data_enable_i & host_data_capture_o & "00000";
------------------------------------------------
process(host_clk_i)
@ -118,15 +117,15 @@ begin
process(host_clk_i, codec_clk_i)
begin
if rising_edge(host_clk_i) then
if transfer_direction_i = to_dac then
if codec_clk_i = '1' then
host_data_capture_o <= host_data_enable_i;
end if;
else
if codec_clk_i = '0' then
host_data_capture_o <= host_data_enable_i;
end if;
end if;
if transfer_direction_i = to_dac then
if codec_clk_i = '1' then
host_data_capture_o <= host_data_enable_i;
end if;
else
if codec_clk_i = '0' then
host_data_capture_o <= host_data_enable_i;
end if;
end if;
end if;
end process;

View File

@ -280,7 +280,7 @@ static void usage() {
printf("\t-t <filename> # Transmit data from file.\n");
printf("\t[-f set_freq_hz] # Set Freq in Hz between [%lluMHz, %lluMHz[.\n", FREQ_MIN_HZ/FREQ_ONE_MHZ, FREQ_MAX_HZ/FREQ_ONE_MHZ);
printf("\t[-a set_amp] # Set Amp 1=Enable, 0=Disable.\n");
printf("\t[-s sample_rate_hz] # Set sample rate in Hz (5/10/12.5/16/20MHz, default %dMHz).\n", DEFAULT_SAMPLE_RATE_HZ/FREQ_ONE_MHZ);
printf("\t[-s sample_rate_hz] # Set sample rate in Hz (5/10/12.5/16/20MHz, default %lldMHz).\n", DEFAULT_SAMPLE_RATE_HZ/FREQ_ONE_MHZ);
printf("\t[-n num_samples] # Number of samples to transfer (default is unlimited).\n");
printf("\t[-b baseband_filter_bw_hz] # Set baseband filter bandwidth in MHz.\n\tPossible values: 1.75/2.5/3.5/5/5.5/6/7/8/9/10/12/14/15/20/24/28MHz, default < sample_rate_hz.\n" );
}

View File

@ -252,8 +252,8 @@ int ADDCALL hackrf_open(hackrf_device** device) {
lib_device->transfer_count = 1024;
lib_device->buffer_size = 16384;
*/
lib_device->transfer_count = 32;
lib_device->buffer_size = 16384; //262144; /* 1048576; */
lib_device->transfer_count = 4;
lib_device->buffer_size = 262144; /* 1048576; */
lib_device->streaming = false;
do_exit = false;
@ -692,7 +692,7 @@ int ADDCALL hackrf_board_partid_serialno_read(hackrf_device* device, read_partid
static void* transfer_threadproc(void* arg) {
hackrf_device* device = (hackrf_device*)arg;
struct timeval timeout = { 1, 000000 };
struct timeval timeout = { 0, 500000 };
while( (device->streaming) && (do_exit == false) )
{
@ -708,23 +708,43 @@ static void* transfer_threadproc(void* arg) {
static void hackrf_libusb_transfer_callback(struct libusb_transfer* usb_transfer) {
hackrf_device* device = (hackrf_device*)usb_transfer->user_data;
if( usb_transfer->status == LIBUSB_TRANSFER_COMPLETED ) {
hackrf_transfer transfer = {
transfer.device = device,
transfer.buffer = usb_transfer->buffer,
transfer.buffer_length = usb_transfer->length,
transfer.valid_length = usb_transfer->actual_length,
transfer.rx_ctx = device->rx_ctx,
transfer.tx_ctx = device->tx_ctx
};
switch(usb_transfer->status)
{
case LIBUSB_TRANSFER_COMPLETED:
{
hackrf_transfer transfer = {
transfer.device = device,
transfer.buffer = usb_transfer->buffer,
transfer.buffer_length = usb_transfer->length,
transfer.valid_length = usb_transfer->actual_length,
transfer.rx_ctx = device->rx_ctx,
transfer.tx_ctx = device->tx_ctx
};
if( device->callback(&transfer) == 0 ) {
libusb_submit_transfer(usb_transfer);
return;
if( device->callback(&transfer) == 0 )
{
libusb_submit_transfer(usb_transfer);
return;
}else
{
device->streaming = false;
}
}
break;
case LIBUSB_TRANSFER_NO_DEVICE:
device->streaming = false; /* Fatal error stop transfer */
break;
case LIBUSB_TRANSFER_ERROR:
case LIBUSB_TRANSFER_TIMED_OUT:
case LIBUSB_TRANSFER_STALL:
case LIBUSB_TRANSFER_OVERFLOW:
case LIBUSB_TRANSFER_CANCELLED:
default:
/* Do nothing and continue */
break;
}
device->streaming = false;
}
static int kill_transfer_thread(hackrf_device* device) {