mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Run baseband image per application.
First step toward having separate baseband images per app or function.
This commit is contained in:
parent
ac0bdc35a6
commit
303bfeaafc
@ -286,6 +286,8 @@ void AISRecentEntryDetailView::set_entry(const AISRecentEntry& entry) {
|
||||
}
|
||||
|
||||
AISAppView::AISAppView(NavigationView&) {
|
||||
baseband::run_image(portapack::spi_flash::baseband);
|
||||
|
||||
add_children({ {
|
||||
&label_channel,
|
||||
&options_channel,
|
||||
@ -333,6 +335,8 @@ AISAppView::AISAppView(NavigationView&) {
|
||||
AISAppView::~AISAppView() {
|
||||
baseband::stop();
|
||||
radio::disable();
|
||||
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void AISAppView::focus() {
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
#include "analog_audio_app.hpp"
|
||||
|
||||
#include "baseband_api.hpp"
|
||||
|
||||
#include "portapack.hpp"
|
||||
#include "portapack_persistent_memory.hpp"
|
||||
using namespace portapack;
|
||||
@ -77,6 +79,8 @@ NBFMOptionsView::NBFMOptionsView(
|
||||
AnalogAudioView::AnalogAudioView(
|
||||
NavigationView& nav
|
||||
) {
|
||||
baseband::run_image(portapack::spi_flash::baseband);
|
||||
|
||||
add_children({ {
|
||||
&rssi,
|
||||
&channel,
|
||||
@ -145,6 +149,8 @@ AnalogAudioView::~AnalogAudioView() {
|
||||
audio::output::stop();
|
||||
|
||||
receiver_model.disable();
|
||||
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void AnalogAudioView::on_hide() {
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include "portapack_shared_memory.hpp"
|
||||
|
||||
#include "core_control.hpp"
|
||||
|
||||
namespace baseband {
|
||||
|
||||
void AMConfig::apply() const {
|
||||
@ -81,6 +83,10 @@ void stop() {
|
||||
);
|
||||
}
|
||||
|
||||
void run_image(const portapack::spi_flash::region_t image_region) {
|
||||
m4_init(image_region, portapack::memory::map::m4_code);
|
||||
}
|
||||
|
||||
void shutdown() {
|
||||
ShutdownMessage shutdown_message;
|
||||
shared_memory.baseband_queue.push(shutdown_message);
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include "dsp_fir_taps.hpp"
|
||||
|
||||
#include "spi_image.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace baseband {
|
||||
@ -53,6 +55,7 @@ struct WFMConfig {
|
||||
void start(BasebandConfiguration configuration);
|
||||
void stop();
|
||||
|
||||
void run_image(const portapack::spi_flash::region_t image_region);
|
||||
void shutdown();
|
||||
|
||||
void spectrum_streaming_start();
|
||||
|
@ -32,6 +32,8 @@ using namespace portapack;
|
||||
namespace ui {
|
||||
|
||||
CaptureAppView::CaptureAppView(NavigationView& nav) {
|
||||
baseband::run_image(portapack::spi_flash::baseband);
|
||||
|
||||
add_children({ {
|
||||
&rssi,
|
||||
&channel,
|
||||
@ -83,6 +85,8 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
|
||||
CaptureAppView::~CaptureAppView() {
|
||||
baseband::stop();
|
||||
radio::disable();
|
||||
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void CaptureAppView::on_hide() {
|
||||
|
@ -121,6 +121,8 @@ void RecentEntriesView<ERTRecentEntries>::draw(
|
||||
}
|
||||
|
||||
ERTAppView::ERTAppView(NavigationView&) {
|
||||
baseband::run_image(portapack::spi_flash::baseband);
|
||||
|
||||
add_children({ {
|
||||
&recent_entries_view,
|
||||
} });
|
||||
@ -149,6 +151,8 @@ ERTAppView::ERTAppView(NavigationView&) {
|
||||
ERTAppView::~ERTAppView() {
|
||||
baseband::stop();
|
||||
radio::disable();
|
||||
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void ERTAppView::focus() {
|
||||
|
@ -59,13 +59,6 @@ static void event_loop() {
|
||||
};
|
||||
|
||||
EventDispatcher event_dispatcher { &system_view, context };
|
||||
|
||||
MessageHandlerRegistration message_handler_shutdown {
|
||||
Message::ID::Shutdown,
|
||||
[&event_dispatcher](const Message* const) {
|
||||
event_dispatcher.request_stop();
|
||||
}
|
||||
};
|
||||
MessageHandlerRegistration message_handler_display_sleep {
|
||||
Message::ID::DisplaySleep,
|
||||
[&event_dispatcher](const Message* const) {
|
||||
@ -88,8 +81,6 @@ int main(void) {
|
||||
|
||||
sdcStart(&SDCD1, nullptr);
|
||||
|
||||
m4_init(portapack::spi_flash::baseband, portapack::memory::map::m4_code);
|
||||
|
||||
controls_init();
|
||||
lcd_frame_sync_configure();
|
||||
rtc_interrupt_enable();
|
||||
|
@ -164,6 +164,8 @@ void RecentEntriesView<TPMSRecentEntries>::draw(
|
||||
}
|
||||
|
||||
TPMSAppView::TPMSAppView(NavigationView&) {
|
||||
baseband::run_image(portapack::spi_flash::baseband);
|
||||
|
||||
add_children({ {
|
||||
&rssi,
|
||||
&channel,
|
||||
@ -205,6 +207,8 @@ TPMSAppView::TPMSAppView(NavigationView&) {
|
||||
TPMSAppView::~TPMSAppView() {
|
||||
baseband::stop();
|
||||
radio::disable();
|
||||
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void TPMSAppView::focus() {
|
||||
|
Loading…
Reference in New Issue
Block a user