From 8cd5d682b8beff65c1cc48388e4a8290e5b8723c Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Sun, 12 Dec 2021 13:29:25 -0700 Subject: [PATCH] default to the last specified frequency range This was supposed to be the default, but there was a bug that looked past the last range. --- firmware/common/operacake.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/common/operacake.c b/firmware/common/operacake.c index f4acd306..3a19c4cd 100644 --- a/firmware/common/operacake.c +++ b/firmware/common/operacake.c @@ -313,6 +313,10 @@ uint8_t operacake_set_range(uint32_t freq_mhz) { break; } } + /* Use the last range if there was no match. */ + if (range == range_idx) { + range--; + } if(range == current_range) { return 1; }