Skip to content

Commit

Permalink
SSTV TX to ext (#2254)
Browse files Browse the repository at this point in the history
* SSTV TX to ext
  • Loading branch information
htotoo authored Sep 20, 2024
1 parent 7feef9d commit 9438c9a
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 15 deletions.
2 changes: 1 addition & 1 deletion firmware/application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ set(CPPSRC
# apps/ui_spectrum_painter_text.cpp
# apps/ui_spectrum_painter.cpp
apps/ui_ss_viewer.cpp
apps/ui_sstvtx.cpp
# apps/ui_sstvtx.cpp #moved to ext
apps/ui_standalone_view.cpp
apps/ui_subghzd.cpp
# apps/ui_test.cpp
Expand Down
6 changes: 5 additions & 1 deletion firmware/application/external/external.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ set(EXTCPPSRC
external/adsbtx/main.cpp
external/adsbtx/ui_adsb_tx.cpp


#morse_tx
external/morse_tx/main.cpp
external/morse_tx/ui_morse.cpp

#sstvtx
external/sstvtx/main.cpp
external/sstvtx/ui_sstvtx.cpp
)

set(EXTAPPLIST
Expand All @@ -118,4 +121,5 @@ set(EXTAPPLIST
protoview
adsbtx
morse_tx
sstvtx
)
8 changes: 8 additions & 0 deletions firmware/application/external/external.ld
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ MEMORY
ram_external_app_protoview(rwx) : org = 0xADC40000, len = 32k
ram_external_app_adsbtx(rwx) : org = 0xADC50000, len = 32k
ram_external_app_morse_tx(rwx) : org = 0xADC60000, len = 32k
ram_external_app_sstvtx(rwx) : org = 0xADC70000, len = 32k
}

SECTIONS
Expand Down Expand Up @@ -183,5 +184,12 @@ SECTIONS
*(*ui*external_app*morse_tx*);
} > ram_external_app_morse_tx

.external_app_sstvtx : ALIGN(4) SUBALIGN(4)
{
KEEP(*(.external_app.app_sstvtx.application_information));
*(*ui*external_app*sstvtx*);
} > ram_external_app_sstvtx



}
82 changes: 82 additions & 0 deletions firmware/application/external/sstvtx/main.cpp
Original file line number Diff line number Diff line change
@@ -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_sstvtx.hpp"
#include "ui_navigation.hpp"
#include "external_app.hpp"

namespace ui::external_app::sstvtx {
void initialize_app(ui::NavigationView& nav) {
nav.push<SSTVTXView>();
}
} // namespace ui::external_app::sstvtx

extern "C" {

__attribute__((section(".external_app.app_sstvtx.application_information"), used)) application_information_t _application_information_sstvtx = {
/*.memory_location = */ (uint8_t*)0x00000000,
/*.externalAppEntry = */ ui::external_app::sstvtx::initialize_app,
/*.header_version = */ CURRENT_HEADER_VERSION,
/*.app_version = */ VERSION_MD5,

/*.app_name = */ "SSTV",
/*.bitmap_data = */ {
0x00,
0x00,
0x00,
0x00,
0xFE,
0x7F,
0x03,
0xC0,
0x53,
0xD5,
0xAB,
0xCA,
0x53,
0xD5,
0xAB,
0xCA,
0x53,
0xD5,
0xAB,
0xCA,
0x53,
0xD5,
0x03,
0xC0,
0xFF,
0xFF,
0xFB,
0xD7,
0xFE,
0x7F,
0x00,
0x00,
},
/*.icon_color = */ ui::Color::green().v,
/*.menu_location = */ app_location_t::TX,

/*.m4_app_tag = portapack::spi_flash::image_tag_sstvtx */ {'P', 'S', 'T', 'X'},
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

using namespace portapack;

namespace ui {
namespace ui::external_app::sstvtx {

void SSTVTXView::focus() {
if (file_error)
Expand Down Expand Up @@ -232,7 +232,8 @@ SSTVTXView::SSTVTXView(

// Maybe this could be merged with proc_tones ? Pretty much the same except lots
// of different tones (256+)
baseband::run_image(portapack::spi_flash::image_tag_sstv_tx);
// baseband::run_image(portapack::spi_flash::image_tag_sstv_tx);
baseband::run_prepared_image(portapack::memory::map::m4_code.base());

add_children({&labels,
&options_bitmaps,
Expand Down Expand Up @@ -283,4 +284,4 @@ SSTVTXView::SSTVTXView(
};
}

} /* namespace ui */
} // namespace ui::external_app::sstvtx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

using namespace sstv;

namespace ui {
namespace ui::external_app::sstvtx {

class SSTVTXView : public View {
public:
Expand Down Expand Up @@ -110,6 +110,6 @@ class SSTVTXView : public View {
}};
};

} /* namespace ui */
} /* namespace ui::external_app::sstvtx */

#endif /*__UI_SSTVTX_H__*/
4 changes: 2 additions & 2 deletions firmware/application/ui_navigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#include "ui_sonde.hpp"
// #include "ui_spectrum_painter.hpp" //moved to ext app
#include "ui_ss_viewer.hpp"
#include "ui_sstvtx.hpp"
// #include "ui_sstvtx.hpp" //moved to ext
// #include "ui_test.hpp"
#include "ui_text_editor.hpp"
#include "ui_tone_search.hpp"
Expand Down Expand Up @@ -191,7 +191,7 @@ const NavigationView::AppList NavigationView::appList = {
{"pocsagtx", "POCSAG TX", TX, ui::Color::green(), &bitmap_icon_pocsag, new ViewFactory<POCSAGTXView>()},
{"rdstx", "RDS", TX, ui::Color::green(), &bitmap_icon_rds, new ViewFactory<RDSView>()},
{"soundbrd", "Soundbrd", TX, ui::Color::green(), &bitmap_icon_soundboard, new ViewFactory<SoundBoardView>()},
{"sstvtx", "SSTV", TX, ui::Color::green(), &bitmap_icon_sstv, new ViewFactory<SSTVTXView>()},
//{"sstvtx", "SSTV", TX, ui::Color::green(), &bitmap_icon_sstv, new ViewFactory<SSTVTXView>()}, //moved to ext
{"touchtune", "TouchTune", TX, ui::Color::green(), &bitmap_icon_touchtunes, new ViewFactory<TouchTunesView>()},
/* UTILITIES *************************************************************/
{"antennalength", "Antenna Length", UTILITIES, Color::green(), &bitmap_icon_tools_antenna, new ViewFactory<WhipCalcView>()},
Expand Down
12 changes: 6 additions & 6 deletions firmware/baseband/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,6 @@ set(MODE_CPPSRC
DeclareTargets(PSIG siggen)


### SSTV TX

set(MODE_CPPSRC
proc_sstvtx.cpp
)
DeclareTargets(PSTX sstvtx)

### Tones

Expand Down Expand Up @@ -650,6 +644,12 @@ set(MODE_CPPSRC
DeclareTargets(PPVW protoview)


### SSTV TX

set(MODE_CPPSRC
proc_sstvtx.cpp
)
DeclareTargets(PSTX sstvtx)

### TPMS

Expand Down

0 comments on commit 9438c9a

Please sign in to comment.