mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Dumb baseband-running state tracking to ease use of baseband API.
This commit is contained in:
parent
b2d5e47308
commit
34e45412d1
@ -271,6 +271,8 @@ void AnalogAudioView::update_modulation(const ReceiverModel::Mode modulation) {
|
|||||||
audio::output::mute();
|
audio::output::mute();
|
||||||
record_view.stop();
|
record_view.stop();
|
||||||
|
|
||||||
|
baseband::shutdown();
|
||||||
|
|
||||||
portapack::spi_flash::image_tag_t image_tag;
|
portapack::spi_flash::image_tag_t image_tag;
|
||||||
switch(modulation) {
|
switch(modulation) {
|
||||||
case ReceiverModel::Mode::AMAudio: image_tag = portapack::spi_flash::image_tag_am_audio; break;
|
case ReceiverModel::Mode::AMAudio: image_tag = portapack::spi_flash::image_tag_am_audio; break;
|
||||||
|
@ -90,17 +90,30 @@ void stop() {
|
|||||||
send_message(&message);
|
send_message(&message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool baseband_image_running = false;
|
||||||
|
|
||||||
void run_image(const portapack::spi_flash::image_tag_t image_tag) {
|
void run_image(const portapack::spi_flash::image_tag_t image_tag) {
|
||||||
|
if( baseband_image_running ) {
|
||||||
|
chDbgPanic("BBRunning");
|
||||||
|
}
|
||||||
|
|
||||||
m4_init(image_tag, portapack::memory::map::m4_code);
|
m4_init(image_tag, portapack::memory::map::m4_code);
|
||||||
|
baseband_image_running = true;
|
||||||
|
|
||||||
creg::m4txevent::enable();
|
creg::m4txevent::enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void shutdown() {
|
void shutdown() {
|
||||||
|
if( !baseband_image_running ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
creg::m4txevent::disable();
|
creg::m4txevent::disable();
|
||||||
|
|
||||||
ShutdownMessage message;
|
ShutdownMessage message;
|
||||||
send_message(&message);
|
send_message(&message);
|
||||||
|
|
||||||
|
baseband_image_running = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void spectrum_streaming_start() {
|
void spectrum_streaming_start() {
|
||||||
|
Loading…
Reference in New Issue
Block a user