Skip to content

Commit

Permalink
skip rfgain as agc is active
Browse files Browse the repository at this point in the history
  • Loading branch information
edy555 committed Jan 16, 2018
1 parent 2f7ccca commit e211696
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down

0 comments on commit e211696

Please sign in to comment.