From e419719731e515866f5077da7b13e4ad8be8b2b4 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sun, 28 Apr 2019 15:16:58 +0800 Subject: [PATCH] Minimal polyfill to support building against both bladeRF1 & bladeRF2 libraries --- sdr_bladerf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdr_bladerf.c b/sdr_bladerf.c index 8577b9d..65ef2a8 100644 --- a/sdr_bladerf.c +++ b/sdr_bladerf.c @@ -23,6 +23,11 @@ #include #include +// Polyfill for the older bladerf API +#if defined(LIBBLADERF_API_VERSION) && (LIBBLADERF_API_VERSION < 0x02000000) +typedef unsigned int bladerf_frequency; +#endif + static struct { const char *device_str; const char *fpga_path; @@ -102,7 +107,7 @@ static void show_config() int status; unsigned rate; - unsigned freq; + bladerf_frequency freq; bladerf_lpf_mode lpf_mode; unsigned lpf_bw; bladerf_lna_gain lna_gain;