mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 00:59:28 +00:00
Reset tx_phase_ to 0 on stop so on_tx_progress does not restart the next phase. Reset progress bar and repaint capcode info.
This commit is contained in:
+6
-1
@@ -673,6 +673,7 @@ void FlexTXView::on_serial_msg(const FlexTosendMessage data) {
|
|||||||
|
|
||||||
void FlexTXView::on_tx_progress(const uint32_t progress, const bool done) {
|
void FlexTXView::on_tx_progress(const uint32_t progress, const bool done) {
|
||||||
if (done) {
|
if (done) {
|
||||||
|
if (tx_phase_ == 0) return; // stopped by user
|
||||||
int ers_n = tx_steps_total_ - 2;
|
int ers_n = tx_steps_total_ - 2;
|
||||||
if (tx_phase_ == 1 && ers_remaining_ > 0) {
|
if (tx_phase_ == 1 && ers_remaining_ > 0) {
|
||||||
tx_step_++;
|
tx_step_++;
|
||||||
@@ -705,7 +706,8 @@ void FlexTXView::on_tx_progress(const uint32_t progress, const bool done) {
|
|||||||
set_dirty(); // repaint capcode info
|
set_dirty(); // repaint capcode info
|
||||||
}
|
}
|
||||||
} else {
|
} 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_view.on_stop = [this]() {
|
||||||
|
tx_phase_ = 0;
|
||||||
tx_view.set_transmitting(false);
|
tx_view.set_transmitting(false);
|
||||||
transmitter_model.disable();
|
transmitter_model.disable();
|
||||||
|
progressbar.set_value(0);
|
||||||
|
set_dirty(); // repaint capcode info
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user