Hide baseband queue code inside baseband "API".

This commit is contained in:
Jared Boone 2016-02-10 20:11:19 -08:00
parent 49a89b9dee
commit 22e44605b6
10 changed files with 195 additions and 122 deletions

View file

@ -23,8 +23,7 @@
#include "event_m0.hpp"
#include "portapack_shared_memory.hpp"
using namespace portapack;
#include "baseband_api.hpp"
#include "manchester.hpp"
@ -140,20 +139,15 @@ ERTAppView::ERTAppView(NavigationView&) {
1,
});
BasebandConfigurationMessage message { {
baseband::start({
.mode = 6,
.sampling_rate = sampling_rate,
.decimation_factor = 1,
} };
shared_memory.baseband_queue.push(message);
});
}
ERTAppView::~ERTAppView() {
shared_memory.baseband_queue.push_and_wait(
BasebandConfigurationMessage {
.configuration = { },
}
);
baseband::stop();
radio::disable();
EventDispatcher::message_map().unregister_handler(Message::ID::ERTPacket);