From 7643ae7f7d83a5b89b5108cada1ded527b66dad2 Mon Sep 17 00:00:00 2001 From: gullradriel Date: Sun, 26 Jan 2025 15:10:52 +0100 Subject: [PATCH 1/4] externalize antenna calc and wav view --- firmware/application/CMakeLists.txt | 2 - firmware/application/bitmap.hpp | 114 ++++++------------ .../external/antenna_length/main.cpp | 83 +++++++++++++ .../antenna_length}/ui_whipcalc.cpp | 0 .../antenna_length}/ui_whipcalc.hpp | 0 firmware/application/external/external.cmake | 12 +- firmware/application/external/external.ld | 15 +++ .../application/external/wav_view/main.cpp | 83 +++++++++++++ .../wav_view}/ui_view_wav.cpp | 0 .../wav_view}/ui_view_wav.hpp | 0 firmware/application/ui_navigation.cpp | 7 +- 11 files changed, 232 insertions(+), 84 deletions(-) create mode 100644 firmware/application/external/antenna_length/main.cpp rename firmware/application/{apps => external/antenna_length}/ui_whipcalc.cpp (100%) rename firmware/application/{apps => external/antenna_length}/ui_whipcalc.hpp (100%) create mode 100644 firmware/application/external/wav_view/main.cpp rename firmware/application/{apps => external/wav_view}/ui_view_wav.cpp (100%) rename firmware/application/{apps => external/wav_view}/ui_view_wav.hpp (100%) diff --git a/firmware/application/CMakeLists.txt b/firmware/application/CMakeLists.txt index 1efc3f3f4..d6762f218 100644 --- a/firmware/application/CMakeLists.txt +++ b/firmware/application/CMakeLists.txt @@ -317,9 +317,7 @@ set(CPPSRC apps/ui_text_editor.cpp apps/ui_touch_calibration.cpp apps/ui_touchtunes.cpp - apps/ui_view_wav.cpp apps/ui_weatherstation.cpp - apps/ui_whipcalc.cpp protocols/aprs.cpp protocols/ax25.cpp protocols/bht.cpp diff --git a/firmware/application/bitmap.hpp b/firmware/application/bitmap.hpp index a55e994cb..10b0d804b 100644 --- a/firmware/application/bitmap.hpp +++ b/firmware/application/bitmap.hpp @@ -987,43 +987,6 @@ static constexpr Bitmap bitmap_icon_previous{ {16, 16}, bitmap_icon_previous_data}; -static constexpr uint8_t bitmap_icon_tools_antenna_data[] = { - 0x38, - 0x3E, - 0x10, - 0x22, - 0x10, - 0x26, - 0x10, - 0x22, - 0x10, - 0x2E, - 0x10, - 0x22, - 0x10, - 0x26, - 0x10, - 0x22, - 0x38, - 0x2E, - 0x38, - 0x22, - 0x38, - 0x26, - 0x38, - 0x22, - 0x38, - 0x2E, - 0x38, - 0x22, - 0x38, - 0x3E, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_tools_antenna{ - {16, 16}, - bitmap_icon_tools_antenna_data}; static constexpr uint8_t bitmap_icon_batt_text_data[] = { 0x00, @@ -1799,6 +1762,45 @@ static constexpr uint8_t bitmap_icon_lge_data[] = { 0x00, 0x00, }; + +static constexpr uint8_t bitmap_icon_file_iq_data[] = { + 0xFC, + 0x03, + 0x04, + 0x06, + 0x04, + 0x0E, + 0x04, + 0x1E, + 0x04, + 0x3E, + 0x04, + 0x20, + 0x04, + 0x20, + 0x04, + 0x21, + 0x44, + 0x25, + 0x54, + 0x25, + 0xF4, + 0x2F, + 0xA4, + 0x2A, + 0x84, + 0x22, + 0x04, + 0x22, + 0x04, + 0x20, + 0xFC, + 0x3F, +}; +static constexpr Bitmap bitmap_icon_file_iq{ + {16, 16}, + bitmap_icon_file_iq_data}; + static constexpr Bitmap bitmap_icon_lge{ {16, 16}, bitmap_icon_lge_data}; @@ -2713,44 +2715,6 @@ static constexpr Bitmap bitmap_icon_touchtunes{ {16, 16}, bitmap_icon_touchtunes_data}; -static constexpr uint8_t bitmap_icon_file_iq_data[] = { - 0xFC, - 0x03, - 0x04, - 0x06, - 0x04, - 0x0E, - 0x04, - 0x1E, - 0x04, - 0x3E, - 0x04, - 0x20, - 0x04, - 0x20, - 0x04, - 0x21, - 0x44, - 0x25, - 0x54, - 0x25, - 0xF4, - 0x2F, - 0xA4, - 0x2A, - 0x84, - 0x22, - 0x04, - 0x22, - 0x04, - 0x20, - 0xFC, - 0x3F, -}; -static constexpr Bitmap bitmap_icon_file_iq{ - {16, 16}, - bitmap_icon_file_iq_data}; - static constexpr uint8_t bitmap_icon_sd_data[] = { 0x00, 0x00, diff --git a/firmware/application/external/antenna_length/main.cpp b/firmware/application/external/antenna_length/main.cpp new file mode 100644 index 000000000..a1ff34fa0 --- /dev/null +++ b/firmware/application/external/antenna_length/main.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui.hpp" +#include "ui_whipcalc.hpp" +#include "ui_navigation.hpp" +#include "external_app.hpp" + +namespace ui::external_app::antenna_length { + void initialize_app(ui::NavigationView& nav) { + nav.push(); + } +} // namespace ui::external_app::antenna_length + +extern "C" { + + __attribute__((section(".external_app.app_antenna_length.application_information"), used)) application_information_t _application_information_antenna_length = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::antenna_length::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, + + /*.app_name = */ "Antenna Length", + /*.bitmap_data = */ { + 0x38, + 0x3E, + 0x10, + 0x22, + 0x10, + 0x26, + 0x10, + 0x22, + 0x10, + 0x2E, + 0x10, + 0x22, + 0x10, + 0x26, + 0x10, + 0x22, + 0x38, + 0x2E, + 0x38, + 0x22, + 0x38, + 0x26, + 0x38, + 0x22, + 0x38, + 0x2E, + 0x38, + 0x22, + 0x38, + 0x3E, + 0x00, + 0x00 + }, + /*.icon_color = */ ui::Color::cyan().v, + /*.menu_location = */ app_location_t::SETTINGS, + /*.desired_menu_position = */ -1, + + /*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0}, + /*.m4_app_offset = */ 0x00000000, // will be filled at compile time + }; +} diff --git a/firmware/application/apps/ui_whipcalc.cpp b/firmware/application/external/antenna_length/ui_whipcalc.cpp similarity index 100% rename from firmware/application/apps/ui_whipcalc.cpp rename to firmware/application/external/antenna_length/ui_whipcalc.cpp diff --git a/firmware/application/apps/ui_whipcalc.hpp b/firmware/application/external/antenna_length/ui_whipcalc.hpp similarity index 100% rename from firmware/application/apps/ui_whipcalc.hpp rename to firmware/application/external/antenna_length/ui_whipcalc.hpp diff --git a/firmware/application/external/external.cmake b/firmware/application/external/external.cmake index 87fbaf05d..0aca5875d 100644 --- a/firmware/application/external/external.cmake +++ b/firmware/application/external/external.cmake @@ -150,6 +150,14 @@ set(EXTCPPSRC #app_manager external/app_manager/main.cpp external/app_manager/ui_app_manager.cpp + + # whip calculator + external/antenna_length/main.cpp + external/antenna_length/ui_whipcalc.cpp + + # wav viewer + external/wav_view/main.cpp + external/wav_view/ui_view_wav.cpp ) set(EXTAPPLIST @@ -189,4 +197,6 @@ set(EXTAPPLIST tuner metronome app_manager -) \ No newline at end of file + antenna_length + view_wav +) diff --git a/firmware/application/external/external.ld b/firmware/application/external/external.ld index 17acd87ea..5c571c434 100644 --- a/firmware/application/external/external.ld +++ b/firmware/application/external/external.ld @@ -59,6 +59,8 @@ MEMORY ram_external_app_tuner(rwx) : org = 0xADD20000, len = 32k ram_external_app_metronome(rwx) : org = 0xADD30000, len = 32k ram_external_app_app_manager(rwx) : org = 0xADD40000, len = 32k + ram_external_app_antenna_length(rwx) : org = 0xADD50000, len = 32k + ram_external_app_view_wav(rwx) : org = 0xADD60000, len = 32k } SECTIONS @@ -279,4 +281,17 @@ SECTIONS KEEP(*(.external_app.app_app_manager.application_information)); *(*ui*external_app*app_manager*); } > ram_external_app_app_manager + + .external_app_antenna_length : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.external_app.app_antenna_length.application_information)); + *(*ui*external_app*antenna_length*); + } > ram_external_app_antenna_length + + .external_app_view_wav : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.external_app.app_view_wav.application_information)); + *(*ui*external_app*view_wav*); + } > ram_external_app_view_wav + } diff --git a/firmware/application/external/wav_view/main.cpp b/firmware/application/external/wav_view/main.cpp new file mode 100644 index 000000000..e8c901a66 --- /dev/null +++ b/firmware/application/external/wav_view/main.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui.hpp" +#include "ui_view_wav.hpp" +#include "ui_navigation.hpp" +#include "external_app.hpp" + +namespace ui::external_app::view_wav { + void initialize_app(ui::NavigationView& nav) { + nav.push(); + } +} // namespace ui::external_app::view_wav + +extern "C" { + + __attribute__((section(".external_app.app_view_wav.application_information"), used)) application_information_t _application_information_view_wav = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::view_wav::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, + + /*.app_name = */ "WAV Viewer", + /*.bitmap_data = */ { + 0xF0, + 0x0F, + 0x1C, + 0x18, + 0x17, + 0x38, + 0x15, + 0x78, + 0x15, + 0xF8, + 0x15, + 0x82, + 0x15, + 0x8B, + 0xD5, + 0x83, + 0xD5, + 0xBB, + 0xD5, + 0x83, + 0x15, + 0x8B, + 0x15, + 0x92, + 0x15, + 0xA0, + 0x17, + 0x80, + 0x1C, + 0x80, + 0xF0, + 0xFF + }, + /*.icon_color = */ ui::Color::green().v, + /*.menu_location = */ app_location_t::SETTINGS, + /*.desired_menu_position = */ -1, + + /*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0}, + /*.m4_app_offset = */ 0x00000000, // will be filled at compile time + }; +} diff --git a/firmware/application/apps/ui_view_wav.cpp b/firmware/application/external/wav_view/ui_view_wav.cpp similarity index 100% rename from firmware/application/apps/ui_view_wav.cpp rename to firmware/application/external/wav_view/ui_view_wav.cpp diff --git a/firmware/application/apps/ui_view_wav.hpp b/firmware/application/external/wav_view/ui_view_wav.hpp similarity index 100% rename from firmware/application/apps/ui_view_wav.hpp rename to firmware/application/external/wav_view/ui_view_wav.hpp diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index c44e01fb1..5b2a04e8d 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -63,10 +63,8 @@ // #include "ui_test.hpp" #include "ui_text_editor.hpp" #include "ui_touchtunes.hpp" -#include "ui_view_wav.hpp" #include "ui_weatherstation.hpp" #include "ui_subghzd.hpp" -#include "ui_whipcalc.hpp" #include "ui_battinfo.hpp" #include "ui_external_items_menu_loader.hpp" @@ -163,16 +161,13 @@ const NavigationView::AppList NavigationView::appList = { {"soundbrd", "Soundbrd", TX, ui::Color::green(), &bitmap_icon_soundboard, new ViewFactory()}, {"touchtune", "TouchTune", TX, ui::Color::green(), &bitmap_icon_touchtunes, new ViewFactory()}, /* UTILITIES *************************************************************/ - {"antennalength", "Antenna Length", UTILITIES, Color::green(), &bitmap_icon_tools_antenna, new ViewFactory()}, {"filemanager", "File Manager", UTILITIES, Color::green(), &bitmap_icon_dir, new ViewFactory()}, {"freqman", "Freq. Manager", UTILITIES, Color::green(), &bitmap_icon_freqman, new ViewFactory()}, - {"notepad", "Notepad", UTILITIES, Color::dark_cyan(), &bitmap_icon_notepad, new ViewFactory()}, {"iqtrim", "IQ Trim", UTILITIES, Color::orange(), &bitmap_icon_trim, new ViewFactory()}, + {"notepad", "Notepad", UTILITIES, Color::dark_cyan(), &bitmap_icon_notepad, new ViewFactory()}, {nullptr, "SD Over USB", UTILITIES, Color::yellow(), &bitmap_icon_hackrf, new ViewFactory()}, {"signalgen", "Signal Gen", UTILITIES, Color::green(), &bitmap_icon_cwgen, new ViewFactory()}, //{"testapp", "Test App", UTILITIES, Color::dark_grey(), nullptr, new ViewFactory()}, - - {"wavview", "Wav View", UTILITIES, Color::yellow(), &bitmap_icon_soundboard, new ViewFactory()}, // Dangerous apps. {nullptr, "Flash Utility", UTILITIES, Color::red(), &bitmap_icon_peripherals_details, new ViewFactory()}, {nullptr, "Wipe SD card", UTILITIES, Color::red(), &bitmap_icon_tools_wipesd, new ViewFactory()}, From 4c73b2e1bccac4975b7b545bb909ed2d3e32d8b9 Mon Sep 17 00:00:00 2001 From: gullradriel Date: Sun, 26 Jan 2025 15:23:10 +0100 Subject: [PATCH 2/4] clang --- firmware/application/bitmap.hpp | 1 - .../external/antenna_length/main.cpp | 65 +++++-------------- .../application/external/wav_view/main.cpp | 65 +++++-------------- 3 files changed, 32 insertions(+), 99 deletions(-) diff --git a/firmware/application/bitmap.hpp b/firmware/application/bitmap.hpp index 10b0d804b..96ca86ac8 100644 --- a/firmware/application/bitmap.hpp +++ b/firmware/application/bitmap.hpp @@ -987,7 +987,6 @@ static constexpr Bitmap bitmap_icon_previous{ {16, 16}, bitmap_icon_previous_data}; - static constexpr uint8_t bitmap_icon_batt_text_data[] = { 0x00, 0x00, diff --git a/firmware/application/external/antenna_length/main.cpp b/firmware/application/external/antenna_length/main.cpp index a1ff34fa0..89aca60ab 100644 --- a/firmware/application/external/antenna_length/main.cpp +++ b/firmware/application/external/antenna_length/main.cpp @@ -25,59 +25,26 @@ #include "external_app.hpp" namespace ui::external_app::antenna_length { - void initialize_app(ui::NavigationView& nav) { - nav.push(); - } +void initialize_app(ui::NavigationView& nav) { + nav.push(); +} } // namespace ui::external_app::antenna_length extern "C" { - __attribute__((section(".external_app.app_antenna_length.application_information"), used)) application_information_t _application_information_antenna_length = { - /*.memory_location = */ (uint8_t*)0x00000000, - /*.externalAppEntry = */ ui::external_app::antenna_length::initialize_app, - /*.header_version = */ CURRENT_HEADER_VERSION, - /*.app_version = */ VERSION_MD5, +__attribute__((section(".external_app.app_antenna_length.application_information"), used)) application_information_t _application_information_antenna_length = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::antenna_length::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, - /*.app_name = */ "Antenna Length", - /*.bitmap_data = */ { - 0x38, - 0x3E, - 0x10, - 0x22, - 0x10, - 0x26, - 0x10, - 0x22, - 0x10, - 0x2E, - 0x10, - 0x22, - 0x10, - 0x26, - 0x10, - 0x22, - 0x38, - 0x2E, - 0x38, - 0x22, - 0x38, - 0x26, - 0x38, - 0x22, - 0x38, - 0x2E, - 0x38, - 0x22, - 0x38, - 0x3E, - 0x00, - 0x00 - }, - /*.icon_color = */ ui::Color::cyan().v, - /*.menu_location = */ app_location_t::SETTINGS, - /*.desired_menu_position = */ -1, + /*.app_name = */ "Antenna Length", + /*.bitmap_data = */ {0x38, 0x3E, 0x10, 0x22, 0x10, 0x26, 0x10, 0x22, 0x10, 0x2E, 0x10, 0x22, 0x10, 0x26, 0x10, 0x22, 0x38, 0x2E, 0x38, 0x22, 0x38, 0x26, 0x38, 0x22, 0x38, 0x2E, 0x38, 0x22, 0x38, 0x3E, 0x00, 0x00}, + /*.icon_color = */ ui::Color::cyan().v, + /*.menu_location = */ app_location_t::SETTINGS, + /*.desired_menu_position = */ -1, - /*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0}, - /*.m4_app_offset = */ 0x00000000, // will be filled at compile time - }; + /*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0}, + /*.m4_app_offset = */ 0x00000000, // will be filled at compile time +}; } diff --git a/firmware/application/external/wav_view/main.cpp b/firmware/application/external/wav_view/main.cpp index e8c901a66..fefc6be7f 100644 --- a/firmware/application/external/wav_view/main.cpp +++ b/firmware/application/external/wav_view/main.cpp @@ -25,59 +25,26 @@ #include "external_app.hpp" namespace ui::external_app::view_wav { - void initialize_app(ui::NavigationView& nav) { - nav.push(); - } +void initialize_app(ui::NavigationView& nav) { + nav.push(); +} } // namespace ui::external_app::view_wav extern "C" { - __attribute__((section(".external_app.app_view_wav.application_information"), used)) application_information_t _application_information_view_wav = { - /*.memory_location = */ (uint8_t*)0x00000000, - /*.externalAppEntry = */ ui::external_app::view_wav::initialize_app, - /*.header_version = */ CURRENT_HEADER_VERSION, - /*.app_version = */ VERSION_MD5, +__attribute__((section(".external_app.app_view_wav.application_information"), used)) application_information_t _application_information_view_wav = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::view_wav::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, - /*.app_name = */ "WAV Viewer", - /*.bitmap_data = */ { - 0xF0, - 0x0F, - 0x1C, - 0x18, - 0x17, - 0x38, - 0x15, - 0x78, - 0x15, - 0xF8, - 0x15, - 0x82, - 0x15, - 0x8B, - 0xD5, - 0x83, - 0xD5, - 0xBB, - 0xD5, - 0x83, - 0x15, - 0x8B, - 0x15, - 0x92, - 0x15, - 0xA0, - 0x17, - 0x80, - 0x1C, - 0x80, - 0xF0, - 0xFF - }, - /*.icon_color = */ ui::Color::green().v, - /*.menu_location = */ app_location_t::SETTINGS, - /*.desired_menu_position = */ -1, + /*.app_name = */ "WAV Viewer", + /*.bitmap_data = */ {0xF0, 0x0F, 0x1C, 0x18, 0x17, 0x38, 0x15, 0x78, 0x15, 0xF8, 0x15, 0x82, 0x15, 0x8B, 0xD5, 0x83, 0xD5, 0xBB, 0xD5, 0x83, 0x15, 0x8B, 0x15, 0x92, 0x15, 0xA0, 0x17, 0x80, 0x1C, 0x80, 0xF0, 0xFF}, + /*.icon_color = */ ui::Color::green().v, + /*.menu_location = */ app_location_t::SETTINGS, + /*.desired_menu_position = */ -1, - /*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0}, - /*.m4_app_offset = */ 0x00000000, // will be filled at compile time - }; + /*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0}, + /*.m4_app_offset = */ 0x00000000, // will be filled at compile time +}; } From afec15a458c29da7a35020e285e1b8f5fa87eb8b Mon Sep 17 00:00:00 2001 From: gullradriel Date: Sun, 26 Jan 2025 20:56:19 +0100 Subject: [PATCH 3/4] fix namespace --- .../application/external/antenna_length/ui_whipcalc.cpp | 5 +++-- .../application/external/antenna_length/ui_whipcalc.hpp | 7 +++++-- firmware/application/external/wav_view/ui_view_wav.cpp | 5 +++-- firmware/application/external/wav_view/ui_view_wav.hpp | 6 ++++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/firmware/application/external/antenna_length/ui_whipcalc.cpp b/firmware/application/external/antenna_length/ui_whipcalc.cpp index 8285e66fc..72604f1c5 100644 --- a/firmware/application/external/antenna_length/ui_whipcalc.cpp +++ b/firmware/application/external/antenna_length/ui_whipcalc.cpp @@ -32,8 +32,9 @@ #include using namespace portapack; +using namespace ui; -namespace ui { +namespace ui::external_app::antenna_length { void WhipCalcView::focus() { field_frequency.focus(); @@ -176,4 +177,4 @@ void WhipCalcView::load_antenna_db() { void WhipCalcView::add_default_antenna() { antenna_db.push_back({"ANT500", {185, 315, 450, 586, 724, 862}}); // store a default ant500 } -} // namespace ui +} // namespace ui::external_app::antenna_length diff --git a/firmware/application/external/antenna_length/ui_whipcalc.hpp b/firmware/application/external/antenna_length/ui_whipcalc.hpp index 0f807c5f7..42520fd87 100644 --- a/firmware/application/external/antenna_length/ui_whipcalc.hpp +++ b/firmware/application/external/antenna_length/ui_whipcalc.hpp @@ -31,7 +31,10 @@ #include "string_format.hpp" #include -namespace ui { +using namespace ui; + +namespace ui::external_app::antenna_length { + class WhipCalcView : public View { public: WhipCalcView(NavigationView& nav); @@ -90,6 +93,6 @@ class WhipCalcView : public View { "Back"}; }; -} /* namespace ui */ +} // namespace ui::external_app::antenna_length #endif /*__UI_WHIPCALC__*/ diff --git a/firmware/application/external/wav_view/ui_view_wav.cpp b/firmware/application/external/wav_view/ui_view_wav.cpp index 1272ca8ed..1594c1d96 100644 --- a/firmware/application/external/wav_view/ui_view_wav.cpp +++ b/firmware/application/external/wav_view/ui_view_wav.cpp @@ -28,8 +28,9 @@ #include "string_format.hpp" using namespace portapack; +using namespace ui; -namespace ui { +namespace ui::external_app::view_wav { void ViewWavView::update_scale(int32_t new_scale) { scale = new_scale; @@ -345,4 +346,4 @@ ViewWavView::~ViewWavView() { baseband::shutdown(); } -} /* namespace ui */ +} /* namespace ui::external_app::view_wav */ diff --git a/firmware/application/external/wav_view/ui_view_wav.hpp b/firmware/application/external/wav_view/ui_view_wav.hpp index b460855a8..688b0163b 100644 --- a/firmware/application/external/wav_view/ui_view_wav.hpp +++ b/firmware/application/external/wav_view/ui_view_wav.hpp @@ -28,7 +28,9 @@ #include "ui_receiver.hpp" #include "replay_thread.hpp" -namespace ui { +using namespace ui; + +namespace ui::external_app::view_wav { class ViewWavView : public View { public: @@ -202,4 +204,4 @@ class ViewWavView : public View { }}; }; -} /* namespace ui */ +} /* namespace ui::external_app::view_wav */ From 070aeca8947bf99a781fd5f1e32bf9697b39bc68 Mon Sep 17 00:00:00 2001 From: gullradriel Date: Sun, 26 Jan 2025 20:57:04 +0100 Subject: [PATCH 4/4] Added a tool to check if all the pictures in graphics are used in internal apps --- firmware/tools/check_bitmap_usage.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 firmware/tools/check_bitmap_usage.sh diff --git a/firmware/tools/check_bitmap_usage.sh b/firmware/tools/check_bitmap_usage.sh new file mode 100755 index 000000000..82564c619 --- /dev/null +++ b/firmware/tools/check_bitmap_usage.sh @@ -0,0 +1,10 @@ +#!/bin/bash +for fname in $(ls ../graphics/); do + fname=$(echo "$fname" | awk -F'.' '{print $1}') + out=$(grep -r --exclude="bitmap.hpp" "$fname" ../* ) + ret=$? + if [[ "$ret" -ne 0 ]]; then + echo "$fname not found" + fi +done +