NRF RX to ext app (#1641)

* NFR Rx to ext app
This commit is contained in:
Totoo 2023-12-11 11:57:04 +01:00 committed by GitHub
parent ec80859d93
commit 5f8e44e7b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 114 additions and 15 deletions

View File

@ -281,7 +281,7 @@ set(CPPSRC
apps/ui_mictx.cpp
apps/ui_modemsetup.cpp
apps/ui_morse.cpp
apps/ui_nrf_rx.cpp
# apps/ui_nrf_rx.cpp
# apps/ui_nuoptix.cpp
apps/ui_playlist.cpp
apps/ui_pocsag_tx.cpp

View File

@ -24,6 +24,10 @@ set(EXTCPPSRC
external/analogtv/main.cpp
external/analogtv/analog_tv_app.cpp
#nrf_rx
external/nrf_rx/main.cpp
external/nrf_rx/ui_nrf_rx.cpp
)
set(EXTAPPLIST
@ -32,5 +36,6 @@ set(EXTAPPLIST
calculator
font_viewer
blespam
nrf_rx
analogtv
)

View File

@ -23,6 +23,7 @@ MEMORY
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
ram_external_app_nrf_rx(rwx) : org = 0xEEEF0000, len = 32k
}
SECTIONS
@ -63,4 +64,11 @@ SECTIONS
KEEP(*(.external_app.app_analogtv.application_information));
*(*ui*external_app*analogtv*);
} > ram_external_app_analogtv
.external_app_nrf_rx : ALIGN(4) SUBALIGN(4)
{
KEEP(*(.external_app.app_nrf_rx.application_information));
*(*ui*external_app*nrf_rx*);
} > ram_external_app_nrf_rx
}

View File

@ -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_nrf_rx.hpp"
#include "ui_navigation.hpp"
#include "external_app.hpp"
namespace ui::external_app::nrf_rx {
void initialize_app(ui::NavigationView& nav) {
nav.push<NRFRxView>();
}
} // namespace ui::external_app::nrf_rx
extern "C" {
__attribute__((section(".external_app.app_nrf_rx.application_information"), used)) application_information_t _application_information_nrf_rx = {
/*.memory_location = */ (uint8_t*)0x00000000,
/*.externalAppEntry = */ ui::external_app::nrf_rx::initialize_app,
/*.header_version = */ CURRENT_HEADER_VERSION,
/*.app_version = */ VERSION_MD5,
/*.app_name = */ "NRF",
/*.bitmap_data = */ {
0x00,
0x01,
0x00,
0x01,
0x00,
0x01,
0x00,
0x01,
0x00,
0x01,
0x00,
0x01,
0x00,
0x01,
0xF8,
0x3F,
0xFC,
0x7F,
0xFC,
0x7F,
0xDC,
0x7F,
0x8C,
0x6B,
0xDC,
0x7F,
0xFC,
0x7F,
0xFC,
0x7F,
0xF8,
0x3F,
},
/*.icon_color = */ ui::Color::yellow().v,
/*.menu_location = */ app_location_t::RX,
/*.m4_app_tag = portapack::spi_flash::image_tag_nrf_rx */ {'P', 'N', 'R', 'R'},
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time
};
}

View File

@ -34,7 +34,7 @@
using namespace portapack;
using namespace modems;
namespace ui {
namespace ui::external_app::nrf_rx {
void NRFRxView::focus() {
field_frequency.focus();
@ -42,7 +42,8 @@ void NRFRxView::focus() {
NRFRxView::NRFRxView(NavigationView& nav)
: nav_{nav} {
baseband::run_image(portapack::spi_flash::image_tag_nrf_rx);
// baseband::run_image(portapack::spi_flash::image_tag_nrf_rx);
baseband::run_prepared_image(portapack::memory::map::m4_code.base());
add_children({&rssi,
&channel,
@ -130,4 +131,4 @@ NRFRxView::~NRFRxView() {
baseband::shutdown();
}
} /* namespace ui */
} // namespace ui::external_app::nrf_rx

View File

@ -34,7 +34,7 @@
#include "utility.hpp"
namespace ui {
namespace ui::external_app::nrf_rx {
class NRFRxView : public View {
public:
@ -90,6 +90,6 @@ class NRFRxView : public View {
}};
};
} /* namespace ui */
} /* namespace ui::external_app::nrf_rx */
#endif /*__UI_NRF_RX_H__*/

View File

@ -54,7 +54,7 @@
#include "ui_looking_glass_app.hpp"
#include "ui_mictx.hpp"
#include "ui_morse.hpp"
#include "ui_nrf_rx.hpp"
// #include "ui_nrf_rx.hpp"
// #include "ui_numbers.hpp"
// #include "ui_nuoptix.hpp"
// #include "ui_playdead.hpp"
@ -560,7 +560,7 @@ ReceiversMenuView::ReceiversMenuView(NavigationView& nav) {
{"BLE Rx", Color::green(), &bitmap_icon_btle, [&nav]() { nav.push<BLERxView>(); }},
{"ERT Meter", Color::green(), &bitmap_icon_ert, [&nav]() { nav.push<ERTAppView>(); }},
{"Level", Color::green(), &bitmap_icon_options_radio, [&nav]() { nav.push<LevelView>(); }},
{"NRF", Color::yellow(), &bitmap_icon_nrf, [&nav]() { nav.push<NRFRxView>(); }},
//{"NRF", Color::yellow(), &bitmap_icon_nrf, [&nav]() { nav.push<NRFRxView>(); }},
{"POCSAG", Color::green(), &bitmap_icon_pocsag, [&nav]() { nav.push<POCSAGAppView>(); }},
{"Radiosnde", Color::green(), &bitmap_icon_sonde, [&nav]() { nav.push<SondeView>(); }},
{"Recon", Color::green(), &bitmap_icon_scanner, [&nav]() { nav.push<ReconView>(); }},

View File

@ -347,12 +347,6 @@ set(MODE_CPPSRC
)
DeclareTargets(PAPR aprsrx)
### NRF RX
set(MODE_CPPSRC
proc_nrfrx.cpp
)
DeclareTargets(PNRR nrfrx)
### BTLE RX
@ -620,6 +614,14 @@ set(MODE_CPPSRC
)
DeclareTargets(PAFR afskrx)
### NRF RX
set(MODE_CPPSRC
proc_nrfrx.cpp
)
DeclareTargets(PNRR nrfrx)
### AM TV
set(MODE_CPPSRC