From ec62bda31af662a516a777d567696399e7584632 Mon Sep 17 00:00:00 2001 From: marco <49691247+marcoSchr@users.noreply.github.com> Date: Wed, 28 Jun 2023 19:52:53 +0200 Subject: [PATCH] Fix CTCSS tone not correctly set when decreasing --- openrtx/src/ui/default/ui.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index a6107d1e..77ccfb1d 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -872,7 +872,15 @@ static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) case 1: if(state.channel.mode == OPMODE_FM) { - state.channel.fm.txTone--; + if(state.channel.fm.txTone == 0) + { + state.channel.fm.txTone = MAX_TONE_INDEX-1; + } + else + { + state.channel.fm.txTone--; + } + state.channel.fm.txTone %= MAX_TONE_INDEX; state.channel.fm.rxTone = state.channel.fm.txTone; *sync_rtx = true;