From e2116960ba298bd47e7515204b3b6a6a18fbd02e Mon Sep 17 00:00:00 2001 From: TT Date: Tue, 16 Jan 2018 23:10:18 +0900 Subject: [PATCH] skip rfgain as agc is active --- ui.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ui.c b/ui.c index 4f3c1b9..b9a79b0 100644 --- a/ui.c +++ b/ui.c @@ -258,7 +258,10 @@ ui_process(void) int tick = fetch_encoder_tick(); int n; if (status & EVT_BUTTON_SINGLE_CLICK) { - uistat.mode = (uistat.mode + 1) % MODE_MAX; + uistat.mode++; + if (uistat.agcmode != 0 && uistat.mode == RFGAIN) + uistat.mode++; + uistat.mode %= MODE_MAX; disp_update(); } if (tick != 0) { @@ -279,10 +282,16 @@ ui_process(void) uistat.mode++; } } else { - if (tick < 0) + if (tick < 0) { uistat.mode--; - if (tick > 0) + if (uistat.agcmode != 0 && uistat.mode == RFGAIN) + uistat.mode--; + } + if (tick > 0) { uistat.mode++; + if (uistat.agcmode != 0 && uistat.mode == RFGAIN) + uistat.mode++; + } uistat.mode = uistat.mode % MODE_MAX; } disp_update();