From 3b1a21519b946fe85c1a6d444b3a4e2539d8f8ef Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Sat, 4 Feb 2017 10:07:17 -0700 Subject: [PATCH] consolidated a little code in hackrf_sweep --- host/hackrf-tools/src/hackrf_sweep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 399799b9..5a93daea 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -242,16 +242,16 @@ int rx_callback(hackrf_transfer* transfer) { time_now = time(NULL); fft_time = localtime(&time_now); strftime(time_str, 50, "%Y-%m-%d, %H:%M:%S", fft_time); - printf("%s, %" PRIu64 ", %" PRIu64 ", %.2f, %d, ", + printf("%s, %" PRIu64 ", %" PRIu64 ", %.2f, %d", time_str, (uint64_t)((FREQ_ONE_MHZ*frequency)-(DEFAULT_SAMPLE_RATE_HZ/2)), (uint64_t)((FREQ_ONE_MHZ*frequency)+(DEFAULT_SAMPLE_RATE_HZ/2)), (float)STEP_SIZE_IN_HZ, FFT_SIZE); - for(i=0; i < (fftSize - 1); i++) { - printf("%.2f, ", pwr[i]); + for(i=0; i < fftSize; i++) { + printf(", %.2f", pwr[i]); } - printf("%.2f\n", pwr[fftSize - 1]); + printf("\n"); } } return 0;