diff --git a/firmware/application/CMakeLists.txt b/firmware/application/CMakeLists.txt index 36f6607b5..29b38df83 100644 --- a/firmware/application/CMakeLists.txt +++ b/firmware/application/CMakeLists.txt @@ -285,7 +285,6 @@ set(CPPSRC apps/capture_app.cpp apps/pocsag_app.cpp apps/ui_about_simple.cpp - apps/ui_aprs_tx.cpp apps/ui_battinfo.cpp apps/ui_bmp_file_viewer.cpp apps/ui_btle_rx.cpp diff --git a/firmware/application/external/aprs_tx/main.cpp b/firmware/application/external/aprs_tx/main.cpp new file mode 100644 index 000000000..309817122 --- /dev/null +++ b/firmware/application/external/aprs_tx/main.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2026 PortaPack Mayhem + * + * 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_aprs_tx.hpp" +#include "ui_navigation.hpp" +#include "external_app.hpp" + +namespace ui::external_app::aprs_tx { + +void initialize_app(ui::NavigationView& nav) { + nav.push(); +} + +} // namespace ui::external_app::aprs_tx + +extern "C" { + +__attribute__((section(".external_app.app_aprs_tx.application_information"), used)) application_information_t _application_information_aprs_tx = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::aprs_tx::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, + + /*.app_name = */ "APRS TX", + /*.bitmap_data = */ { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, + 0x4C, 0x32, 0xFE, 0x7F, 0x25, 0xA4, 0x25, 0xA4, + 0xFF, 0xFF, 0x25, 0xA4, 0x25, 0xA4, 0xFE, 0x7F, + 0x4C, 0x32, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, + }, + /*.icon_color = */ ui::Color::green().v, + /*.menu_location = */ app_location_t::TX, + /*.desired_menu_position = */ -1, + + /*.m4_app_tag = portapack::spi_flash::image_tag_afsk */ {'P', 'A', 'F', 'T'}, + /*.m4_app_offset = */ 0x00000000, +}; + +} // extern "C" diff --git a/firmware/application/apps/ui_aprs_tx.cpp b/firmware/application/external/aprs_tx/ui_aprs_tx.cpp similarity index 98% rename from firmware/application/apps/ui_aprs_tx.cpp rename to firmware/application/external/aprs_tx/ui_aprs_tx.cpp index 939ceab12..c8f5267b8 100644 --- a/firmware/application/apps/ui_aprs_tx.cpp +++ b/firmware/application/external/aprs_tx/ui_aprs_tx.cpp @@ -37,7 +37,7 @@ using namespace aprs; using namespace portapack; -namespace ui { +namespace ui::external_app::aprs_tx { void APRSTXView::focus() { tx_view.focus(); @@ -242,4 +242,4 @@ APRSTXView::APRSTXView(NavigationView& nav) { // process_coordinates(last_lat, last_lon); //don't load last, so won't confuse users } -} /* namespace ui */ +} // namespace ui::external_app::aprs_tx diff --git a/firmware/application/apps/ui_aprs_tx.hpp b/firmware/application/external/aprs_tx/ui_aprs_tx.hpp similarity index 98% rename from firmware/application/apps/ui_aprs_tx.hpp rename to firmware/application/external/aprs_tx/ui_aprs_tx.hpp index 769a0bcf8..c07c8aa3c 100644 --- a/firmware/application/apps/ui_aprs_tx.hpp +++ b/firmware/application/external/aprs_tx/ui_aprs_tx.hpp @@ -33,7 +33,7 @@ #include "radio_state.hpp" #include "portapack.hpp" -namespace ui { +namespace ui::external_app::aprs_tx { class APRSTXView : public View { public: @@ -161,4 +161,4 @@ class APRSTXView : public View { }}; }; -} /* namespace ui */ +} // namespace ui::external_app::aprs_tx diff --git a/firmware/application/external/external.cmake b/firmware/application/external/external.cmake index bdcf023d7..9a300561b 100644 --- a/firmware/application/external/external.cmake +++ b/firmware/application/external/external.cmake @@ -403,6 +403,10 @@ set(EXTCPPSRC external/aprs_rx/main.cpp external/aprs_rx/ui_aprs_rx.cpp + #aprs tx + external/aprs_tx/main.cpp + external/aprs_tx/ui_aprs_tx.cpp + ) set(EXTAPPLIST @@ -500,6 +504,7 @@ set(EXTAPPLIST adsbrx ais_rx aprs_rx + aprs_tx ) # sdusb has type conflicts with PRALINE (HackRF Pro) - add only for non-PRALINE builds diff --git a/firmware/application/external/external.ld b/firmware/application/external/external.ld index b370bdcaf..965f6c027 100644 --- a/firmware/application/external/external.ld +++ b/firmware/application/external/external.ld @@ -118,6 +118,7 @@ MEMORY ram_external_app_adsbrx (rwx) : org = 0xAE0D0000, len = 32k ram_external_app_ais_rx (rwx) : org = 0xAE0E0000, len = 32k ram_external_app_aprs_rx (rwx) : org = 0xAE0F0000, len = 32k + ram_external_app_aprs_tx (rwx) : org = 0xAE100000, len = 32k } SECTIONS @@ -692,6 +693,12 @@ SECTIONS *(*ui*external_app*aprs_rx*); } > ram_external_app_aprs_rx + .external_app_aprs_tx : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.external_app.app_aprs_tx.application_information)); + *(*ui*external_app*aprs_tx*); + } > ram_external_app_aprs_tx + } diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index ca5440d36..ab6fc1e47 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -30,7 +30,6 @@ #include "portapack.hpp" #include "ui_about_simple.hpp" -#include "ui_aprs_tx.hpp" #include "ui_btle_rx.hpp" #include "ui_debug.hpp" #include "ui_encoders.hpp" @@ -104,7 +103,6 @@ const NavigationView::AppList NavigationView::appList = { {"subghzd", "SubGhzD", RX, Color::yellow(), &bitmap_icon_remote, new ViewFactory()}, {"weather", "Weather", RX, Color::green(), &bitmap_icon_thermometer, new ViewFactory()}, /* TX ********************************************************************/ - {"aprstx", "APRS TX", TX, ui::Color::green(), &bitmap_icon_aprs, new ViewFactory()}, {"bletx", "BLE Tx", TX, ui::Color::green(), &bitmap_icon_btle, new ViewFactory()}, {"ooktx", "OOK", TX, ui::Color::yellow(), &bitmap_icon_remote, new ViewFactory()}, {"rdstx", "RDS", TX, ui::Color::green(), &bitmap_icon_rds, new ViewFactory()}, diff --git a/firmware/tools/external_app_info.py b/firmware/tools/external_app_info.py index dab932f97..ba62fe808 100644 --- a/firmware/tools/external_app_info.py +++ b/firmware/tools/external_app_info.py @@ -24,4 +24,4 @@ # external app address ranges below must match those in linker file "external.ld" maximum_application_size = 32*1024 external_apps_address_start = 0xADB00000 -external_apps_address_end = 0xAE100000 +external_apps_address_end = 0xAE110000