diff --git a/firmware/application/bitmap.hpp b/firmware/application/bitmap.hpp index 1b801caab..fb36688a3 100644 --- a/firmware/application/bitmap.hpp +++ b/firmware/application/bitmap.hpp @@ -29,6 +29,98 @@ namespace ui { // Use firmware/tools/make_bitmap.py ! +static constexpr uint8_t bitmap_icon_audiotx_data[] = { + 0x00, 0x70, + 0x00, 0x7F, + 0xC0, 0x4F, + 0xC0, 0x60, + 0x40, 0x5E, + 0xC0, 0x41, + 0x40, 0x40, + 0x40, 0x40, + 0x40, 0x40, + 0x40, 0x70, + 0x70, 0x7C, + 0x7C, 0x7E, + 0x7E, 0x3E, + 0x3E, 0x1C, + 0x1C, 0x00, + 0x00, 0x00, +}; + +static constexpr Bitmap bitmap_icon_audiotx { + { 16, 16 }, bitmap_icon_audiotx_data +}; + +static constexpr uint8_t bitmap_icon_capture_data[] = { + 0xEF, 0x29, + 0xEF, 0x69, + 0xEF, 0xE9, + 0xEF, 0xE9, + 0xEF, 0xEF, + 0x1F, 0xF0, + 0xFF, 0xFF, + 0xFF, 0xFF, + 0x03, 0xC0, + 0xFB, 0xDF, + 0x0B, 0xD9, + 0xFB, 0xDF, + 0x4B, 0xDE, + 0xFB, 0xDF, + 0x03, 0xC0, + 0xFE, 0x7F, +}; + +static constexpr Bitmap bitmap_icon_capture { + { 16, 16 }, bitmap_icon_capture_data +}; + +static constexpr uint8_t bitmap_icon_codetx_data[] = { + 0x00, 0x00, + 0xF0, 0x07, + 0x0C, 0x18, + 0x03, 0x60, + 0xE0, 0x83, + 0x18, 0x0C, + 0x04, 0x10, + 0xC0, 0x01, + 0x20, 0x02, + 0x00, 0x00, + 0x00, 0x00, + 0xBB, 0x6D, + 0x2A, 0x49, + 0x2A, 0x49, + 0x3A, 0x49, + 0x00, 0x00, +}; + +static constexpr Bitmap bitmap_icon_codetx { + { 16, 16 }, bitmap_icon_codetx_data +}; + +static constexpr uint8_t bitmap_icon_receiver_data[] = { + 0xC0, 0x07, + 0x30, 0x18, + 0x10, 0x10, + 0x88, 0x23, + 0x48, 0x24, + 0x40, 0x24, + 0x80, 0x10, + 0x80, 0x10, + 0xC0, 0x08, + 0xE0, 0x08, + 0x60, 0x04, + 0x08, 0x04, + 0x08, 0x02, + 0x10, 0x01, + 0xE0, 0x00, + 0x00, 0x00, +}; + +static constexpr Bitmap bitmap_icon_receiver { + { 16, 16 }, bitmap_icon_receiver_data +}; + static constexpr uint8_t bitmap_icon_adsb_data[] = { 0x80, 0x01, 0xC0, 0x03, @@ -282,6 +374,29 @@ static constexpr Bitmap bitmap_icon_nuoptix { { 16, 16 }, bitmap_icon_nuoptix_data }; +static constexpr uint8_t bitmap_icon_playdead_data[] = { + 0x80, 0x01, + 0x80, 0x01, + 0xE0, 0x07, + 0xE0, 0x07, + 0x80, 0x01, + 0x80, 0x01, + 0x80, 0x01, + 0xE0, 0x07, + 0xB0, 0x0A, + 0x50, 0x0D, + 0xA8, 0x1A, + 0x58, 0x15, + 0xAC, 0x2A, + 0x54, 0x35, + 0x04, 0x20, + 0xF8, 0x1F, +}; + +static constexpr Bitmap bitmap_icon_playdead { + { 16, 16 }, bitmap_icon_playdead_data +}; + static constexpr uint8_t bitmap_icon_rds_data[] = { 0x00, 0x00, 0x00, 0x00, diff --git a/firmware/application/ui_bht_tx.cpp b/firmware/application/ui_bht_tx.cpp index 9859ae198..907105d27 100644 --- a/firmware/application/ui_bht_tx.cpp +++ b/firmware/application/ui_bht_tx.cpp @@ -44,7 +44,7 @@ BHTView::~BHTView() { void BHTView::generate_message() { if (!_mode) { text_message.set( - gen_message_xy(header_code_a.value(), header_code_b.value(), city_code_xy.value(), subfamily_code.value(), + gen_message_xy(header_code_a.value(), header_code_b.value(), city_code_xy.value(), family_code_xy.value(), checkbox_wcsubfamily.value(), subfamily_code.value(), checkbox_wcid.value(), receiver_code.value(), relay_states[0].selected_index(), relay_states[1].selected_index(), relay_states[2].selected_index(), relay_states[3].selected_index()) @@ -82,7 +82,7 @@ void BHTView::start_tx() { } audio::set_rate(audio::Rate::Hz_24000); - baseband::set_tones_data(6000, CCIR_SILENCE, 20, false, checkbox_speaker.value()); + baseband::set_tones_data(field_bw.value() * 20, CCIR_SILENCE, 20, false, checkbox_speaker.value()); } void BHTView::on_tx_progress(const int progress, const bool done) { @@ -104,7 +104,7 @@ void BHTView::on_tx_progress(const int progress, const bool done) { chThdSleepMilliseconds(tempo_cligno.value() * 1000); // Dirty :( // Invert all relay states - for (c = 0; c < 4; c++) { + for (c = 0; c < 1; c++) { sr = relay_states[c].selected_index(); if (sr > 0) relay_states[c].set_selected_index(sr ^ 3); } @@ -144,6 +144,7 @@ BHTView::BHTView(NavigationView& nav) { &checkbox_wcid, &text_freq, &options_freq, + &field_bw, &text_relais, &progressbar, &text_message, @@ -156,7 +157,7 @@ BHTView::BHTView(NavigationView& nav) { options_mode.set_selected_index(0); // Start up in Xy mode header_code_a.set_value(0); header_code_b.set_value(0); - city_code_xy.set_value(18); + city_code_xy.set_value(10); city_code_ep.set_value(220); family_code_xy.set_value(1); family_code_ep.set_selected_index(2); @@ -167,6 +168,8 @@ BHTView::BHTView(NavigationView& nav) { progressbar.set_max(20); relay_states[0].set_selected_index(1); // R1 OFF + field_bw.set_value(10); + options_mode.on_change = [this](size_t mode, OptionsField::value_t) { _mode = mode; @@ -297,8 +300,10 @@ BHTView::BHTView(NavigationView& nav) { button_transmit.on_select = [this, &nav](Button&) { if ((tx_mode == IDLE) && (!_mode)) { // DEBUG - if (speaker_enabled && _mode) - audio::headphone::set_volume(volume_t::decibel(90 - 99) + audio::headphone::volume_range().max); + if (speaker_enabled) + chThdSleepMilliseconds(40 * 1000); // DEBUG 40s + //if (speaker_enabled && _mode) + // audio::headphone::set_volume(volume_t::decibel(90 - 99) + audio::headphone::volume_range().max); tx_mode = SINGLE; button_transmit.set_style(&style_cancel); button_transmit.set_text("Wait"); diff --git a/firmware/application/ui_bht_tx.hpp b/firmware/application/ui_bht_tx.hpp index 67a7eb570..192117506 100644 --- a/firmware/application/ui_bht_tx.hpp +++ b/firmware/application/ui_bht_tx.hpp @@ -197,11 +197,11 @@ private: }; Text text_freq { - { 6 * 8, 8 * 16, 10 * 8, 16 }, + { 1 * 8, 8 * 16, 10 * 8, 16 }, "Frequence:" }; OptionsField options_freq { - { 17 * 8, 8 * 16}, + { 12 * 8, 8 * 16}, 7, { { "31.3250", 0 }, @@ -214,6 +214,14 @@ private: } }; + NumberField field_bw { + { 20 * 8, 8 * 16 }, + 2, + { 0, 99 }, + 1, + ' ' + }; + Text text_relais { { 8, 19 * 8, 13 * 8, 16 }, "Etats relais:" diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index d68d43b18..37297c72d 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -338,11 +338,11 @@ void SystemMenuView::hackrf_mode(NavigationView& nav) { SystemMenuView::SystemMenuView(NavigationView& nav) { add_items<11>({ { - { "Play dead", ui::Color::red(), nullptr, [&nav](){ nav.push(); } }, - { "Receivers", ui::Color::cyan(), nullptr, [&nav](){ nav.push(); } }, - { "Capture", ui::Color::cyan(), nullptr, [&nav](){ nav.push(); } }, - { "Code transmitters", ui::Color::green(), nullptr, [&nav](){ nav.push(); } }, - { "Audio transmitters", ui::Color::green(), nullptr, [&nav](){ nav.push(); } }, + { "Play dead", ui::Color::red(), &bitmap_icon_playdead, [&nav](){ nav.push(); } }, + { "Receivers", ui::Color::cyan(), &bitmap_icon_receiver, [&nav](){ nav.push(); } }, + { "Capture", ui::Color::cyan(), &bitmap_icon_capture, [&nav](){ nav.push(); } }, + { "Code transmitters", ui::Color::green(), &bitmap_icon_codetx, [&nav](){ nav.push(); } }, + { "Audio transmitters", ui::Color::green(), &bitmap_icon_audiotx, [&nav](){ nav.push(); } }, { "Close Call", ui::Color::orange(),&bitmap_icon_closecall, [&nav](){ nav.push(); } }, { "Jammer", ui::Color::orange(),&bitmap_icon_jammer, [&nav](){ nav.push(); } }, { "Utilities", ui::Color::purple(),nullptr, [&nav](){ nav.push(); } }, diff --git a/firmware/application/ui_setup.cpp b/firmware/application/ui_setup.cpp index 928949d18..1bf5b46a4 100644 --- a/firmware/application/ui_setup.cpp +++ b/firmware/application/ui_setup.cpp @@ -452,7 +452,7 @@ SetupMenuView::SetupMenuView(NavigationView& nav) { { "Frequency correction", ui::Color::white(), nullptr, [&nav](){ nav.push(); } }, { "Antenna Bias Voltage", ui::Color::white(), nullptr, [&nav](){ nav.push(); } }, { "Touch screen", ui::Color::white(), nullptr, [&nav](){ nav.push(); } }, - { "Play dead", ui::Color::red(), nullptr, [&nav](){ nav.push(); } } + { "Play dead", ui::Color::red(), &bitmap_icon_playdead, [&nav](){ nav.push(); } } } }); on_left = [&nav](){ nav.pop(); }; } diff --git a/firmware/portapack-h1-havoc.bin b/firmware/portapack-h1-havoc.bin index 6b2d6b3e6..f7849f834 100644 Binary files a/firmware/portapack-h1-havoc.bin and b/firmware/portapack-h1-havoc.bin differ diff --git a/graphics/PP_AUDIOTX.png b/graphics/PP_AUDIOTX.png new file mode 100644 index 000000000..fd37510b7 Binary files /dev/null and b/graphics/PP_AUDIOTX.png differ diff --git a/graphics/PP_CAPTURE.png b/graphics/PP_CAPTURE.png new file mode 100644 index 000000000..4c87b741b Binary files /dev/null and b/graphics/PP_CAPTURE.png differ diff --git a/graphics/PP_CODETX.png b/graphics/PP_CODETX.png new file mode 100644 index 000000000..e8f373583 Binary files /dev/null and b/graphics/PP_CODETX.png differ diff --git a/graphics/PP_PLAYDEAD.png b/graphics/PP_PLAYDEAD.png new file mode 100644 index 000000000..21978d487 Binary files /dev/null and b/graphics/PP_PLAYDEAD.png differ diff --git a/graphics/PP_RECEIVER.png b/graphics/PP_RECEIVER.png new file mode 100644 index 000000000..03077c3d5 Binary files /dev/null and b/graphics/PP_RECEIVER.png differ