mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-08 14:42:33 -04:00
Add 1ms hop option to hopper app + 0ms (freeze UI) (#2692)
This commit is contained in:
parent
fb2e576b34
commit
ea38a0fe48
2 changed files with 30 additions and 13 deletions
|
@ -78,7 +78,7 @@ void HopperView::set_hopper_channel(uint32_t i, uint32_t width, uint64_t center,
|
|||
hopper_channels[i].enabled = true;
|
||||
hopper_channels[i].width = (width * 0xFFFFFFULL) / 1536000;
|
||||
hopper_channels[i].center = center;
|
||||
hopper_channels[i].duration = 30720 * duration;
|
||||
hopper_channels[i].duration = duration ? 3072 * duration : 10;
|
||||
}
|
||||
|
||||
void HopperView::start_tx() {
|
||||
|
@ -274,7 +274,7 @@ HopperView::HopperView(
|
|||
|
||||
options_type.set_selected_index(3); // Rand CW
|
||||
options_speed.set_selected_index(3); // 10kHz
|
||||
options_hop.set_selected_index(1); // 50ms
|
||||
options_hop.set_selected_index(3); // 50ms
|
||||
button_transmit.set_style(&style_val);
|
||||
|
||||
field_timetx.set_value(30);
|
||||
|
@ -327,10 +327,25 @@ HopperView::HopperView(
|
|||
};
|
||||
|
||||
button_transmit.on_select = [this](Button&) {
|
||||
if (jamming || cooling)
|
||||
if (jamming || cooling) {
|
||||
stop_tx();
|
||||
else
|
||||
start_tx();
|
||||
} else {
|
||||
// if hop speed is 0, alert the user that this will cause a freeze on UI
|
||||
if (options_hop.selected_index_value() == 0) {
|
||||
nav_.display_modal(
|
||||
"Warning", "Hopping set to 0ms (fastest).\n\nTHIS WILL FREEZE THE HACKRF,\npress RESET button to stop\n\nAre you sure?", YESNO, [this](bool choice) {
|
||||
if (choice) {
|
||||
// Wait for UI update before the freeze
|
||||
chThdSleepMilliseconds(50);
|
||||
start_tx();
|
||||
}
|
||||
},
|
||||
TRUE);
|
||||
} else {
|
||||
// if hop speed is not 0, just start the transmission
|
||||
start_tx();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
menu_freq_list.on_left = [this]() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue