From 2a82a62ffd4a921113d960e74d67408def7a47b4 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Sun, 30 Aug 2026 17:39:43 +0200 Subject: [PATCH] Preserve MAIN VFO selection in Triple VFO --- App/apps/app_overlay.c | 7 ++++--- App/apps/trivfo/trivfo_app.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/App/apps/app_overlay.c b/App/apps/app_overlay.c index fad7ba2c..499ea1d0 100644 --- a/App/apps/app_overlay.c +++ b/App/apps/app_overlay.c @@ -225,8 +225,9 @@ static uint16_t app_trivfo_enter(uint16_t c_channel) app_trivfo_load_memory(&app_trivfo_c, c_channel); } - app_trivfo_selected = 0; - app_trivfo_pre_rx_selected = 0; + const uint8_t initial_vfo = gEeprom.TX_VFO < 2u ? gEeprom.TX_VFO : 0u; + app_trivfo_selected = initial_vfo; + app_trivfo_pre_rx_selected = initial_vfo; app_trivfo_restore_selection = false; app_trivfo_hold = 0; app_trivfo_running = true; @@ -234,7 +235,7 @@ static uint16_t app_trivfo_enter(uint16_t c_channel) app_trivfo_onepush_stop_armed = false; app_trivfo_ab_dirty = false; app_trivfo_freq_dirty = 0; - app_trivfo_tune(0); + app_trivfo_tune(initial_vfo); return c_channel; } diff --git a/App/apps/trivfo/trivfo_app.c b/App/apps/trivfo/trivfo_app.c index c5c36142..668ea3a3 100644 --- a/App/apps/trivfo/trivfo_app.c +++ b/App/apps/trivfo/trivfo_app.c @@ -200,7 +200,7 @@ static void saveCfg(void){ uint8_t c[3]={CFG_MAGIC,(uint8_t)cChannel,(uint8_t)(c __attribute__((section(".text.entry"),used)) void app_main(const app_api_t *api){ A=api; running=true; fArm=false; txDenied=false; channelLabelOn=true; showFrequency=false; selected=batteryTicks=0; loadCfg(); - cChannel=A->trivfo_enter(cChannel); A->trivfo_select(0); A->backlight_on(); + cChannel=A->trivfo_enter(cChannel); A->backlight_on(); draw(); uint8_t held=APP_KEY_INVALID, blinkTicks=0; uint16_t heldMs=0; bool longDone=false, ptt=false; while(running){