From 31b25a445b166b13101ea4c6546f78b84dcc6499 Mon Sep 17 00:00:00 2001 From: qwer123 <56971466+opensourcesdr99@users.noreply.github.com> Date: Wed, 2 Sep 2026 20:42:57 +0800 Subject: [PATCH] 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 --- .../application/external/hopper/ui_hopper.cpp | 13 ++++++----- .../application/external/jammer/ui_jammer.cpp | 22 +++++++++++++++++-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/firmware/application/external/hopper/ui_hopper.cpp b/firmware/application/external/hopper/ui_hopper.cpp index 3ef927305..cdc6e618a 100644 --- a/firmware/application/external/hopper/ui_hopper.cpp +++ b/firmware/application/external/hopper/ui_hopper.cpp @@ -330,19 +330,22 @@ HopperView::HopperView( if (jamming || cooling) { stop_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) { + if (options_hop.selected_index_value() < 50) { 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) { - // 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(); } } diff --git a/firmware/application/external/jammer/ui_jammer.cpp b/firmware/application/external/jammer/ui_jammer.cpp index 372680d89..64af639c2 100644 --- a/firmware/application/external/jammer/ui_jammer.cpp +++ b/firmware/application/external/jammer/ui_jammer.cpp @@ -407,8 +407,26 @@ JammerView::JammerView(NavigationView& nav) button_transmit.on_select = [this](Button&) { if (jamming || cooling) stop_tx(); - else - start_tx(); + else { + 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(); + } + } }; }