From 065d01b59158495f15d42f74e1065152f8eef28e Mon Sep 17 00:00:00 2001 From: Sandbox <143267209+Win-Sandbox@users.noreply.github.com> Date: Tue, 24 Feb 2026 04:37:03 +0800 Subject: [PATCH] Move POCSAG Tx to Ext. (#3033) * Disable POCSAG TX in menu Comment out POCSAG TX related code in ui_navigation.cpp * Comment out ui_pocsag_tx.cpp in CMakeLists Comment out the ui_pocsag_tx.cpp file in CMakeLists. * Move POCSAG Tx to Ext. * Update external.cmake * Delete firmware/application/apps/ui_pocsag_tx.hpp * Delete firmware/application/apps/ui_pocsag_tx.cpp * Update main.cpp * Update main.cpp * Update external.ld * fix namespace * deleted commented out entry * delete commented entries * fix: correct baseband for pocsag tx * run prepared --------- Co-authored-by: gullradriel --- firmware/application/CMakeLists.txt | 1 - firmware/application/external/external.cmake | 5 ++ firmware/application/external/external.ld | 7 ++ .../application/external/pocsag_tx/main.cpp | 83 +++++++++++++++++++ .../pocsag_tx}/ui_pocsag_tx.cpp | 6 +- .../pocsag_tx}/ui_pocsag_tx.hpp | 4 +- firmware/application/ui_navigation.cpp | 6 -- 7 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 firmware/application/external/pocsag_tx/main.cpp rename firmware/application/{apps => external/pocsag_tx}/ui_pocsag_tx.cpp (97%) rename firmware/application/{apps => external/pocsag_tx}/ui_pocsag_tx.hpp (98%) diff --git a/firmware/application/CMakeLists.txt b/firmware/application/CMakeLists.txt index 40f06eca2..85466ef63 100644 --- a/firmware/application/CMakeLists.txt +++ b/firmware/application/CMakeLists.txt @@ -305,7 +305,6 @@ set(CPPSRC apps/ui_mictx.cpp apps/ui_modemsetup.cpp apps/ui_playlist.cpp - apps/ui_pocsag_tx.cpp apps/ui_rds.cpp apps/ui_recon_settings.cpp apps/ui_recon.cpp diff --git a/firmware/application/external/external.cmake b/firmware/application/external/external.cmake index 19cda4d2d..064d397f5 100644 --- a/firmware/application/external/external.cmake +++ b/firmware/application/external/external.cmake @@ -308,6 +308,10 @@ set(EXTCPPSRC external/rtty_tx/main.cpp external/rtty_tx/ui_rtty_tx.cpp external/rtty_tx/baudot.cpp + + #pocsag_tx + external/pocsag_tx/main.cpp + external/pocsag_tx/ui_pocsag_tx.cpp ) set(EXTAPPLIST @@ -385,6 +389,7 @@ set(EXTAPPLIST keeloqtx rtty_rx rtty_tx + pocsag_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 e82df4179..0673473cb 100644 --- a/firmware/application/external/external.ld +++ b/firmware/application/external/external.ld @@ -98,6 +98,7 @@ MEMORY ram_external_app_rtty_rx (rwx) : org = 0xADF90000, len = 32k ram_external_app_rtty_tx (rwx) : org = 0xADFA0000, len = 32k ram_external_app_tpmstx (rwx) : org = 0xADFB0000, len = 32k + ram_external_app_pocsag_tx (rwx) : org = 0xADFC0000, len = 32k } SECTIONS @@ -552,5 +553,11 @@ SECTIONS KEEP(*(.external_app.app_rtty_tx.application_information)); *(*ui*external_app*rtty_tx*); } > ram_external_app_rtty_tx + + .external_app_pocsag_tx : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.external_app.app_pocsag_tx.application_information)); + *(*ui*external_app*pocsag_tx*); + } > ram_external_app_pocsag_tx } diff --git a/firmware/application/external/pocsag_tx/main.cpp b/firmware/application/external/pocsag_tx/main.cpp new file mode 100644 index 000000000..dc2a95fcf --- /dev/null +++ b/firmware/application/external/pocsag_tx/main.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2023 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_pocsag_tx.hpp" +#include "ui_navigation.hpp" +#include "external_app.hpp" + +namespace ui::external_app::pocsag_tx { +void initialize_app(ui::NavigationView& nav) { + nav.push(); +} +} // namespace ui::external_app::pocsag_tx + +extern "C" { + +__attribute__((section(".external_app.app_pocsag_tx.application_information"), used)) application_information_t _application_information_pocsag_tx = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::pocsag_tx::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, + + /*.app_name = */ "POCSG TX", + /*.bitmap_data = */ { + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0xFC, + 0x3F, + 0xFE, + 0x7F, + 0x02, + 0x40, + 0xBA, + 0x45, + 0x02, + 0x40, + 0xFE, + 0x7F, + 0xFE, + 0x7F, + 0x92, + 0x7C, + 0x92, + 0x7C, + 0xFC, + 0x3F, + 0x00, + 0x00, + 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_fsktx */ {'P', 'F', 'S', 'K'}, + /*.m4_app_offset = */ 0x00000000, // will be filled at compile time +}; +} diff --git a/firmware/application/apps/ui_pocsag_tx.cpp b/firmware/application/external/pocsag_tx/ui_pocsag_tx.cpp similarity index 97% rename from firmware/application/apps/ui_pocsag_tx.cpp rename to firmware/application/external/pocsag_tx/ui_pocsag_tx.cpp index b71aca63f..739404c5f 100644 --- a/firmware/application/apps/ui_pocsag_tx.cpp +++ b/firmware/application/external/pocsag_tx/ui_pocsag_tx.cpp @@ -31,7 +31,7 @@ using namespace portapack; using namespace pocsag; -namespace ui { +namespace ui::external_app::pocsag_tx { #define MAX_POCSAG_LENGTH 80 @@ -159,7 +159,7 @@ void POCSAGTXView::on_set_text(NavigationView& nav) { POCSAGTXView::POCSAGTXView( NavigationView& nav) : nav_(nav) { - baseband::run_image(portapack::spi_flash::image_tag_fsktx); + baseband::run_prepared_image(portapack::memory::map::m4_code.base()); add_children({&labels, &options_bitrate, @@ -205,4 +205,4 @@ POCSAGTXView::POCSAGTXView( }; } -} /* namespace ui */ +} /* namespace ui::external_app::pocsag_tx */ diff --git a/firmware/application/apps/ui_pocsag_tx.hpp b/firmware/application/external/pocsag_tx/ui_pocsag_tx.hpp similarity index 98% rename from firmware/application/apps/ui_pocsag_tx.hpp rename to firmware/application/external/pocsag_tx/ui_pocsag_tx.hpp index daafb574e..4b70099f7 100644 --- a/firmware/application/apps/ui_pocsag_tx.hpp +++ b/firmware/application/external/pocsag_tx/ui_pocsag_tx.hpp @@ -37,7 +37,7 @@ using namespace pocsag; -namespace ui { +namespace ui::external_app::pocsag_tx { class POCSAGTXView : public View { public: @@ -155,6 +155,6 @@ class POCSAGTXView : public View { }}; }; -} /* namespace ui */ +} /* namespace ui::external_app::pocsag_tx */ #endif /*__POCSAG_TX_H__*/ diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 22489189f..556410071 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -45,11 +45,8 @@ #include "ui_mictx.hpp" #include "ui_playlist.hpp" -#include "ui_pocsag_tx.hpp" #include "ui_rds.hpp" #include "ui_recon.hpp" -// #include "ui_scanner.hpp" -// #include "ui_sd_over_usb.hpp" #include "ui_search.hpp" #include "ui_settings.hpp" #include "ui_sonde.hpp" @@ -64,7 +61,6 @@ #include "ais_app.hpp" #include "analog_audio_app.hpp" -// #include "ble_comm_app.hpp" #include "ble_rx_app.hpp" #include "ble_tx_app.hpp" #include "capture_app.hpp" @@ -136,7 +132,6 @@ const NavigationView::AppList NavigationView::appList = { {"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()}, - {"pocsagtx", "POCSAG TX", TX, ui::Color::green(), &bitmap_icon_pocsag, new ViewFactory()}, {"rdstx", "RDS", TX, ui::Color::green(), &bitmap_icon_rds, new ViewFactory()}, {"touchtune", "TouchTune", TX, ui::Color::green(), &bitmap_icon_touchtunes, new ViewFactory()}, /* TRX ********************************************************************/ @@ -146,7 +141,6 @@ const NavigationView::AppList NavigationView::appList = { {"freqman", "Freq. Manager", UTILITIES, Color::green(), &bitmap_icon_freqman, 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()}, {nullptr, "Debug", UTILITIES, Color::light_grey(), &bitmap_icon_debug, new ViewFactory()}, //{"testapp", "Test App", UTILITIES, Color::dark_grey(), nullptr, new ViewFactory()}, // Dangerous apps.