From f67fe262bb8fa48d1085cc55085fdc131bbdc812 Mon Sep 17 00:00:00 2001 From: Netro <146584182+iNetro@users.noreply.github.com> Date: Thu, 2 Nov 2023 14:47:34 -0400 Subject: [PATCH] Add open file focus and changing the way send and loop works (#1548) --- firmware/application/apps/ble_tx_app.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/firmware/application/apps/ble_tx_app.cpp b/firmware/application/apps/ble_tx_app.cpp index bad77bb9..50db581f 100644 --- a/firmware/application/apps/ble_tx_app.cpp +++ b/firmware/application/apps/ble_tx_app.cpp @@ -160,7 +160,7 @@ static std::uint64_t get_freq_by_channel_number(uint8_t channel_number) { namespace ui { void BLETxView::focus() { - field_frequency.focus(); + button_open.focus(); } bool BLETxView::is_active() const { @@ -233,12 +233,19 @@ void BLETxView::stop() { void BLETxView::on_tx_progress(const bool done) { if (done) { - if (check_loop.value() && is_active()) { + if (is_active()) { // Reached end of current packet repeats. if (packet_counter == 0) { // Done sending all packets. if (current_packet == (num_packets - 1)) { - stop(); + // If looping, restart from beginning. + if (check_loop.value()) { + current_packet = 0; + packet_counter = packets[current_packet].packet_count; + update_packet_display(packets[current_packet]); + } else { + stop(); + } } else { current_packet++; packet_counter = packets[current_packet].packet_count; @@ -249,13 +256,9 @@ void BLETxView::on_tx_progress(const bool done) { start(); } } - } else { - if (is_active()) { - stop(); - } - } - timer_count++; + timer_count++; + } } }