mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 09:09:29 +00:00
for app jammer failure fix (#3303)
* for app jammer failure * copy hup warning code from hopper to jammer * remove my PR RECORD FILE * copy hup warning code from hopper to jammer
This commit is contained in:
+8
-5
@@ -330,19 +330,22 @@ HopperView::HopperView(
|
|||||||
if (jamming || cooling) {
|
if (jamming || cooling) {
|
||||||
stop_tx();
|
stop_tx();
|
||||||
} else {
|
} else {
|
||||||
// if hop speed is 0, alert the user that this will cause a freeze on UI
|
if (options_hop.selected_index_value() < 50) {
|
||||||
if (options_hop.selected_index_value() == 0) {
|
|
||||||
nav_.display_modal(
|
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) {
|
"Warning",
|
||||||
|
"Hopping interval is\nbelow 50ms.\n\n"
|
||||||
|
"THIS WILL FREEZE\nTHE HACKRF.\n"
|
||||||
|
"Press RESET button\nto stop.\n\n"
|
||||||
|
"Are you sure?",
|
||||||
|
YESNO,
|
||||||
|
[this](bool choice) {
|
||||||
if (choice) {
|
if (choice) {
|
||||||
// Wait for UI update before the freeze
|
|
||||||
chThdSleepMilliseconds(50);
|
chThdSleepMilliseconds(50);
|
||||||
start_tx();
|
start_tx();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
TRUE);
|
TRUE);
|
||||||
} else {
|
} else {
|
||||||
// if hop speed is not 0, just start the transmission
|
|
||||||
start_tx();
|
start_tx();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-2
@@ -407,8 +407,26 @@ JammerView::JammerView(NavigationView& nav)
|
|||||||
button_transmit.on_select = [this](Button&) {
|
button_transmit.on_select = [this](Button&) {
|
||||||
if (jamming || cooling)
|
if (jamming || cooling)
|
||||||
stop_tx();
|
stop_tx();
|
||||||
else
|
else {
|
||||||
start_tx();
|
if (options_hop.selected_index_value() * 10 < 50) {
|
||||||
|
nav_.display_modal(
|
||||||
|
"Warning",
|
||||||
|
"Hopping interval is\nbelow 50ms.\n\n"
|
||||||
|
"THIS WILL FREEZE\nTHE HACKRF.\n"
|
||||||
|
"Press RESET button\nto stop.\n\n"
|
||||||
|
"Are you sure?",
|
||||||
|
YESNO,
|
||||||
|
[this](bool choice) {
|
||||||
|
if (choice) {
|
||||||
|
chThdSleepMilliseconds(50);
|
||||||
|
start_tx();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
TRUE);
|
||||||
|
} else {
|
||||||
|
start_tx();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user