From c095a88cb3cff51512f2ebe93991366e2ef9cac8 Mon Sep 17 00:00:00 2001 From: VasylSamoilov <20946668+VasylSamoilov@users.noreply.github.com> Date: Mon, 13 Apr 2026 10:57:31 +0300 Subject: [PATCH] FLEX TX: fix stop button not stopping transmission (fixes #3135) (#3137) Reset tx_phase_ to 0 on stop so on_tx_progress does not restart the next phase. Reset progress bar and repaint capcode info. --- firmware/application/external/flex_tx/ui_flex_tx.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/application/external/flex_tx/ui_flex_tx.cpp b/firmware/application/external/flex_tx/ui_flex_tx.cpp index 2160bd763..5ad893c6c 100644 --- a/firmware/application/external/flex_tx/ui_flex_tx.cpp +++ b/firmware/application/external/flex_tx/ui_flex_tx.cpp @@ -673,6 +673,7 @@ void FlexTXView::on_serial_msg(const FlexTosendMessage data) { void FlexTXView::on_tx_progress(const uint32_t progress, const bool done) { if (done) { + if (tx_phase_ == 0) return; // stopped by user int ers_n = tx_steps_total_ - 2; if (tx_phase_ == 1 && ers_remaining_ > 0) { tx_step_++; @@ -705,7 +706,8 @@ void FlexTXView::on_tx_progress(const uint32_t progress, const bool done) { set_dirty(); // repaint capcode info } } else { - progressbar.set_value(progress); + if (tx_phase_ != 0) + progressbar.set_value(progress); } } @@ -890,8 +892,11 @@ FlexTXView::FlexTXView(NavigationView& nav) }; tx_view.on_stop = [this]() { + tx_phase_ = 0; tx_view.set_transmitting(false); transmitter_model.disable(); + progressbar.set_value(0); + set_dirty(); // repaint capcode info }; }