From e0c1f7b45e921208d8bcc58d1e6ff22f67a51dc1 Mon Sep 17 00:00:00 2001 From: GullCode Date: Sun, 20 Nov 2022 19:46:01 +0100 Subject: [PATCH] Retune after delete fix --- firmware/application/apps/ui_recon.cpp | 40 +++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/firmware/application/apps/ui_recon.cpp b/firmware/application/apps/ui_recon.cpp index 5cb8ea1a..781c6e84 100644 --- a/firmware/application/apps/ui_recon.cpp +++ b/firmware/application/apps/ui_recon.cpp @@ -1000,23 +1000,31 @@ namespace ui { delete_file( "FREQMAN/"+output_file+".TXT" ); } - if( recon_thread ) - { - recon_thread->set_freq_index( current_index ); - timer = 0 ; + if( recon_thread ) + { + recon_thread->set_freq_index( current_index ); + timer = 0 ; - if( previous_userpause ) - { - user_pause(); - } - else - { - user_resume(); - } - recon_thread->set_recon( previous_is_recon ); - recon_thread->set_freq_delete(false); - chThdSleepMilliseconds( recon_lock_duration ); // give some time to Thread::Run to pause - } + if( previous_userpause ) + { + user_pause(); + } + else + { + user_resume(); + } + + RetuneMessage message { }; + receiver_model.set_tuning_frequency( frequency_list[ current_index ] . frequency_a ); // Retune + message.freq = frequency_list[ current_index ] . frequency_a ; + message.range = current_index ; + EventDispatcher::send_message(message); + + chThdSleepMilliseconds( recon_lock_duration ); // give some time to Thread::Run to pause + + recon_thread->set_recon( previous_is_recon ); + recon_thread->set_freq_delete(false); + } }; button_remove.on_change = [this]() {