From 34547596b3c5b6099b00f19c87833eb15ca3e127 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 27 Jun 2013 08:26:53 +1000 Subject: [PATCH] Support all avalon frequencies on the command line. --- driver-avalon.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/driver-avalon.c b/driver-avalon.c index c2c8af43..778caa1b 100644 --- a/driver-avalon.c +++ b/driver-avalon.c @@ -436,20 +436,11 @@ static bool get_options(int this_option_offset, int *baud, int *miner_count, } if (colon4 && *colon4) { tmp = atoi(colon4); - switch (tmp) { - case 256: - case 270: - case 282: - case 300: - case 325: - case 350: - case 375: - *frequency = tmp; - break; - default: - quit(1, "Invalid avalon-options for " - "frequency must be 256/270/282/300/325/350/375"); + if (tmp < AVALON_MIN_FREQUENCY || tmp > AVALON_MAX_FREQUENCY) { + quit(1, "Invalid avalon-options for frequency, must be %d <= frequency <= %d", + AVALON_MIN_FREQUENCY, AVALON_MAX_FREQUENCY); } + *frequency = tmp; } } }