From 2570f35260e0351df56e271260797687b2c3b6d5 Mon Sep 17 00:00:00 2001 From: Chris Kuethe Date: Mon, 25 May 2015 17:38:24 -0700 Subject: [PATCH] vga gain must be a multiple of 2, not 8 allow both args to be checked before bailing out --- host/hackrf-tools/src/hackrf_transfer.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_transfer.c b/host/hackrf-tools/src/hackrf_transfer.c index 36b53abc..61be1b2a 100644 --- a/host/hackrf-tools/src/hackrf_transfer.c +++ b/host/hackrf-tools/src/hackrf_transfer.c @@ -582,14 +582,12 @@ int main(int argc, char** argv) { } } - if (lna_gain % 8) { - printf("argument error: lna_gain (-l) must be a multiple of 8\n"); - usage(); - return EXIT_FAILURE; - } + if ((lna_gain % 8) || (vga_gain % 2)) { + if (lna_gain % 8) + printf("argument error: lna_gain (-l) must be a multiple of 8\n"); + if (vga_gain % 2) + printf("argument error: vga_gain (-g) must be a multiple of 2\n"); - if (vga_gain % 8) { - printf("argument error: vga_gain (-g) must be a multiple of 2\n"); usage(); return EXIT_FAILURE; }