AnalogTV to ext (#1638)

This commit is contained in:
Totoo 2023-12-11 08:55:07 +01:00 committed by GitHub
parent 5e9d92d65c
commit ec80859d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 112 additions and 16 deletions

View File

@ -243,7 +243,7 @@ set(CPPSRC
apps/acars_app.cpp
apps/ais_app.cpp
apps/analog_audio_app.cpp
apps/analog_tv_app.cpp
# apps/analog_tv_app.cpp
apps/ble_comm_app.cpp
apps/ble_rx_app.cpp
apps/ble_tx_app.cpp

View File

@ -37,7 +37,7 @@ using namespace tonekey;
#include "string_format.hpp"
namespace ui {
namespace ui::external_app::analogtv {
/* AnalogTvView *******************************************************/
@ -192,10 +192,11 @@ void AnalogTvView::update_modulation(const ReceiverModel::Mode modulation) {
baseband::shutdown();
portapack::spi_flash::image_tag_t image_tag;
image_tag = portapack::spi_flash::image_tag_am_tv;
// portapack::spi_flash::image_tag_t image_tag; //moved to ext app, disabled
// image_tag = portapack::spi_flash::image_tag_am_tv;
baseband::run_image(image_tag);
// baseband::run_image(image_tag);
baseband::run_prepared_image(portapack::memory::map::m4_code.base()); // moved the baseband too
receiver_model.set_modulation(modulation);
receiver_model.set_sampling_rate(2000000);
@ -203,4 +204,4 @@ void AnalogTvView::update_modulation(const ReceiverModel::Mode modulation) {
receiver_model.enable();
}
} /* namespace ui */
} // namespace ui::external_app::analogtv

View File

@ -36,7 +36,7 @@
#include "tone_key.hpp"
namespace ui {
namespace ui::external_app::analogtv {
class AnalogTvView : public View {
public:
@ -111,6 +111,6 @@ class AnalogTvView : public View {
void update_modulation(const ReceiverModel::Mode modulation);
};
} /* namespace ui */
} // namespace ui::external_app::analogtv
#endif /*__ANALOG_TV_APP_H__*/

View File

@ -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 "analog_tv_app.hpp"
#include "ui_navigation.hpp"
#include "external_app.hpp"
namespace ui::external_app::analogtv {
void initialize_app(ui::NavigationView& nav) {
nav.push<AnalogTvView>();
}
} // namespace ui::external_app::analogtv
extern "C" {
__attribute__((section(".external_app.app_analogtv.application_information"), used)) application_information_t _application_information_analogtv = {
/*.memory_location = */ (uint8_t*)0x00000000,
/*.externalAppEntry = */ ui::external_app::analogtv::initialize_app,
/*.header_version = */ CURRENT_HEADER_VERSION,
/*.app_version = */ VERSION_MD5,
/*.app_name = */ "Analog TV",
/*.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::yellow().v,
/*.menu_location = */ app_location_t::RX,
/*.m4_app_tag = portapack::spi_flash::image_tag_am_tv */ {'P', 'A', 'M', 'T'},
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time
};
}

View File

@ -20,6 +20,10 @@ set(EXTCPPSRC
external/blespam/main.cpp
external/blespam/ui_blespam.cpp
#analogtv
external/analogtv/main.cpp
external/analogtv/analog_tv_app.cpp
)
set(EXTAPPLIST
@ -28,4 +32,5 @@ set(EXTAPPLIST
calculator
font_viewer
blespam
analogtv
)

View File

@ -22,6 +22,7 @@ MEMORY
ram_external_app_calculator (rwx) : org = 0xEEEB0000, len = 32k
ram_external_app_font_viewer(rwx) : org = 0xEEEC0000, len = 32k
ram_external_app_blespam(rwx) : org = 0xEEED0000, len = 32k
ram_external_app_analogtv(rwx) : org = 0xEEEE0000, len = 32k
}
SECTIONS
@ -56,4 +57,10 @@ SECTIONS
KEEP(*(.external_app.app_blespam.application_information));
*(*ui*external_app*blespam*);
} > ram_external_app_blespam
.external_app_analogtv : ALIGN(4) SUBALIGN(4)
{
KEEP(*(.external_app.app_analogtv.application_information));
*(*ui*external_app*analogtv*);
} > ram_external_app_analogtv
}

View File

@ -86,7 +86,7 @@
// #include "acars_app.hpp"
#include "ais_app.hpp"
#include "analog_audio_app.hpp"
#include "analog_tv_app.hpp"
// #include "analog_tv_app.hpp"
#include "ble_comm_app.hpp"
#include "ble_rx_app.hpp"
#include "ble_tx_app.hpp"
@ -552,7 +552,7 @@ ReceiversMenuView::ReceiversMenuView(NavigationView& nav) {
// {"ACARS", Color::yellow(), &bitmap_icon_adsb, [&nav](){ nav.push<ACARSAppView>(); }},
{"ADS-B", Color::green(), &bitmap_icon_adsb, [&nav]() { nav.push<ADSBRxView>(); }},
{"AIS Boats", Color::green(), &bitmap_icon_ais, [&nav]() { nav.push<AISAppView>(); }},
{"Analog TV", Color::yellow(), &bitmap_icon_sstv, [&nav]() { nav.push<AnalogTvView>(); }},
//{"Analog TV", Color::yellow(), &bitmap_icon_sstv, [&nav]() { nav.push<AnalogTvView>(); }},
{"APRS", Color::green(), &bitmap_icon_aprs, [&nav]() { nav.push<APRSRXView>(); }},
{"Audio", Color::green(), &bitmap_icon_speaker, [&nav]() { nav.push<AnalogAudioView>(); }},
//{"BTLE", Color::yellow(), &bitmap_icon_btle, [&nav]() { nav.push<BTLERxView>(); }},

View File

@ -382,12 +382,6 @@ set(MODE_CPPSRC
)
DeclareTargets(PAMA am_audio)
### AM TV
set(MODE_CPPSRC
proc_am_tv.cpp
)
DeclareTargets(PAMT am_tv)
### Audio transmit
@ -626,6 +620,13 @@ set(MODE_CPPSRC
)
DeclareTargets(PAFR afskrx)
### AM TV
set(MODE_CPPSRC
proc_am_tv.cpp
)
DeclareTargets(PAMT am_tv)
### Test
set(MODE_CPPSRC