mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-15 20:50:28 +00:00
Add open file focus and changing the way send and loop works (#1548)
This commit is contained in:
parent
0681117af6
commit
f67fe262bb
@ -160,7 +160,7 @@ static std::uint64_t get_freq_by_channel_number(uint8_t channel_number) {
|
|||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
void BLETxView::focus() {
|
void BLETxView::focus() {
|
||||||
field_frequency.focus();
|
button_open.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BLETxView::is_active() const {
|
bool BLETxView::is_active() const {
|
||||||
@ -233,12 +233,19 @@ void BLETxView::stop() {
|
|||||||
|
|
||||||
void BLETxView::on_tx_progress(const bool done) {
|
void BLETxView::on_tx_progress(const bool done) {
|
||||||
if (done) {
|
if (done) {
|
||||||
if (check_loop.value() && is_active()) {
|
if (is_active()) {
|
||||||
// Reached end of current packet repeats.
|
// Reached end of current packet repeats.
|
||||||
if (packet_counter == 0) {
|
if (packet_counter == 0) {
|
||||||
// Done sending all packets.
|
// Done sending all packets.
|
||||||
if (current_packet == (num_packets - 1)) {
|
if (current_packet == (num_packets - 1)) {
|
||||||
|
// 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();
|
stop();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
current_packet++;
|
current_packet++;
|
||||||
packet_counter = packets[current_packet].packet_count;
|
packet_counter = packets[current_packet].packet_count;
|
||||||
@ -249,14 +256,10 @@ void BLETxView::on_tx_progress(const bool done) {
|
|||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (is_active()) {
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
timer_count++;
|
timer_count++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BLETxView::BLETxView(NavigationView& nav)
|
BLETxView::BLETxView(NavigationView& nav)
|
||||||
|
Loading…
Reference in New Issue
Block a user