diff --git a/firmware/common/hackrf_core.c b/firmware/common/hackrf_core.c index 6b792a2f..50e2b7ae 100644 --- a/firmware/common/hackrf_core.c +++ b/firmware/common/hackrf_core.c @@ -600,6 +600,7 @@ void cpu_clock_init(void) CGU_BASE_SSP1_CLK = CGU_BASE_SSP1_CLK_AUTOBLOCK(1) | CGU_BASE_SSP1_CLK_CLK_SEL(CGU_SRC_PLL1); +#if (defined JAWBREAKER || defined HACKRF_ONE) /* Disable unused clocks */ /* Start with PLLs */ CGU_PLL0AUDIO_CTRL = CGU_PLL0AUDIO_CTRL_PD(1); @@ -665,6 +666,13 @@ void cpu_clock_init(void) // CCU2_CLK_APB2_USART3_CFG = 0; // CCU2_CLK_APLL_CFG = 0; // CCU2_CLK_SDIO_CFG = 0; +#endif + +#ifdef RAD1O + /* Disable unused clock outputs. They generate noise. */ + scu_pinmux(CLK0, SCU_CLK_IN | SCU_CONF_FUNCTION7); + scu_pinmux(CLK2, SCU_CLK_IN | SCU_CONF_FUNCTION7); +#endif } diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 6a9d0f19..3d400942 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -98,13 +98,14 @@ int gettimeofday(struct timeval *tv, void* ignored) { #define TUNE_STEP (DEFAULT_SAMPLE_RATE_HZ / FREQ_ONE_MHZ) #define OFFSET 7500000 -#define DEFAULT_SAMPLE_COUNT 0x2000 #define BLOCKS_PER_TRANSFER 16 +#define THROWAWAY_BLOCKS 2 #if defined _WIN32 #define sleep(a) Sleep( (a*1000) ) #endif +uint32_t num_samples = SAMPLES_PER_BLOCK; int num_ranges = 0; uint16_t frequencies[MAX_SWEEP_RANGES*2]; @@ -202,11 +203,13 @@ int rx_callback(hackrf_transfer* transfer) { int i, j; struct tm *fft_time; char time_str[50]; + struct timeval usb_transfer_time; if(NULL == fd) { return -1; } + gettimeofday(&usb_transfer_time, NULL); byte_count += transfer->valid_length; buf = (int8_t*) transfer->buffer; for(j=0; j