diff --git a/firmware/application/CMakeLists.txt b/firmware/application/CMakeLists.txt index 9026e3509..8f1ea9281 100644 --- a/firmware/application/CMakeLists.txt +++ b/firmware/application/CMakeLists.txt @@ -299,7 +299,6 @@ set(CPPSRC apps/ui_sd_over_usb.cpp apps/ui_search.cpp apps/ui_settings.cpp - apps/ui_siggen.cpp apps/ui_sonde.cpp apps/ui_ss_viewer.cpp apps/ui_standalone_view.cpp diff --git a/firmware/application/external/external.cmake b/firmware/application/external/external.cmake index b0b33d87d..fc80b3a98 100644 --- a/firmware/application/external/external.cmake +++ b/firmware/application/external/external.cmake @@ -276,6 +276,11 @@ set(EXTCPPSRC #subcarrx external/subcarrx/main.cpp external/subcarrx/ui_subcar.cpp + + #siggen + external/siggen/main.cpp + external/siggen/ui_siggen.cpp + ) set(EXTAPPLIST @@ -345,4 +350,5 @@ set(EXTAPPLIST adult_toys_controller flex_rx subcarrx + siggen ) diff --git a/firmware/application/external/external.ld b/firmware/application/external/external.ld index 6ee5cc178..090027d8b 100644 --- a/firmware/application/external/external.ld +++ b/firmware/application/external/external.ld @@ -89,6 +89,7 @@ MEMORY ram_external_app_flex_rx (rwx) : org = 0xADF00000, len = 32k ram_external_app_sstvrx (rwx) : org = 0xADF10000, len = 32k ram_external_app_subcarrx (rwx) : org = 0xADF20000, len = 32k + ram_external_app_siggen (rwx) : org = 0xADF30000, len = 32k } @@ -492,6 +493,12 @@ SECTIONS *(*ui*external_app*subcarrx*); } > ram_external_app_subcarrx + .external_app_siggen : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.external_app.app_siggen.application_information)); + *(*ui*external_app*siggen*); + } > ram_external_app_siggen + } diff --git a/firmware/application/external/siggen/main.cpp b/firmware/application/external/siggen/main.cpp new file mode 100644 index 000000000..d4c62a968 --- /dev/null +++ b/firmware/application/external/siggen/main.cpp @@ -0,0 +1,82 @@ +/* + * 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_siggen.hpp" +#include "ui_navigation.hpp" +#include "external_app.hpp" + +namespace ui::external_app::siggen { +void initialize_app(ui::NavigationView& nav) { + nav.push(); +} +} // namespace ui::external_app::siggen +extern "C" { + +__attribute__((section(".external_app.app_siggen.application_information"), used)) application_information_t _application_information_siggen = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::siggen::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, + + /*.app_name = */ "Signal gen", + /*.bitmap_data = */ { + 0x18, + 0x00, + 0x24, + 0x00, + 0x42, + 0x00, + 0x42, + 0x00, + 0x42, + 0x00, + 0x42, + 0x00, + 0x81, + 0x00, + 0xAB, + 0x6A, + 0x80, + 0x40, + 0x00, + 0x21, + 0x00, + 0x21, + 0x00, + 0x21, + 0x00, + 0x21, + 0x00, + 0x12, + 0x00, + 0x0C, + 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_siggen */ {'P', 'S', 'I', 'G'}, + /*.m4_app_offset = */ 0x00000000, // will be filled at compile time +}; +} diff --git a/firmware/application/apps/ui_siggen.cpp b/firmware/application/external/siggen/ui_siggen.cpp similarity index 97% rename from firmware/application/apps/ui_siggen.cpp rename to firmware/application/external/siggen/ui_siggen.cpp index 032dbd56c..24d3e8931 100644 --- a/firmware/application/apps/ui_siggen.cpp +++ b/firmware/application/external/siggen/ui_siggen.cpp @@ -31,7 +31,7 @@ using namespace portapack; -namespace ui { +namespace ui::external_app::siggen { void SigGenView::focus() { options_shape.focus(); @@ -75,7 +75,7 @@ void SigGenView::on_tx_progress(const uint32_t progress, const bool done) { SigGenView::SigGenView( NavigationView& nav) { - baseband::run_image(portapack::spi_flash::image_tag_siggen); + baseband::run_prepared_image(portapack::memory::map::m4_code.base()); add_children({&labels, &options_mod, @@ -172,4 +172,4 @@ SigGenView::SigGenView( }; } -} /* namespace ui */ \ No newline at end of file +} // namespace ui::external_app::siggen \ No newline at end of file diff --git a/firmware/application/apps/ui_siggen.hpp b/firmware/application/external/siggen/ui_siggen.hpp similarity index 98% rename from firmware/application/apps/ui_siggen.hpp rename to firmware/application/external/siggen/ui_siggen.hpp index ce771fff0..bac6da79a 100644 --- a/firmware/application/apps/ui_siggen.hpp +++ b/firmware/application/external/siggen/ui_siggen.hpp @@ -33,7 +33,7 @@ #include "portapack.hpp" #include "message.hpp" -namespace ui { +namespace ui::external_app::siggen { class SigGenView : public View { public: @@ -139,6 +139,6 @@ class SigGenView : public View { }}; }; -} /* namespace ui */ +} // namespace ui::external_app::siggen #endif /*__SIGGEN_H__*/ diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 8b57e1efc..0a93e8010 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -52,7 +52,6 @@ #include "ui_sd_over_usb.hpp" #include "ui_search.hpp" #include "ui_settings.hpp" -#include "ui_siggen.hpp" #include "ui_sonde.hpp" #include "ui_ss_viewer.hpp" // #include "ui_test.hpp" @@ -140,7 +139,6 @@ const NavigationView::AppList NavigationView::appList = { {"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()}, - {"signalgen", "SignalGen", TX, Color::green(), &bitmap_icon_cwgen, new ViewFactory()}, /* TRX ********************************************************************/ {"microphone", "Mic", TRX, Color::green(), &bitmap_icon_microphone, new ViewFactory()}, /* UTILITIES *************************************************************/ diff --git a/firmware/baseband/CMakeLists.txt b/firmware/baseband/CMakeLists.txt index 5a92c17ed..86a07a1cc 100644 --- a/firmware/baseband/CMakeLists.txt +++ b/firmware/baseband/CMakeLists.txt @@ -447,14 +447,6 @@ set(MODE_CPPSRC ) DeclareTargets(PREP replay) -### Signal generator - -set(MODE_CPPSRC - proc_siggen.cpp -) -DeclareTargets(PSIG siggen) - - ### Tones @@ -681,6 +673,13 @@ set(MODE_CPPSRC DeclareTargets(POSK ookstream) +### Signal generator + +set(MODE_CPPSRC + proc_siggen.cpp +) +DeclareTargets(PSIG siggen) + ### WeFax Rx