Transmit ChannelSpectrum data through separate FIFO.

Allows handling of data during LCD "vertical retrace", independent of other baseband->application messages. A bit kludgy still...
This commit is contained in:
Jared Boone 2016-01-06 11:34:41 -08:00
parent 2cd28fcc0c
commit aaa1bc3a09
4 changed files with 37 additions and 21 deletions

View file

@ -237,15 +237,20 @@ WaterfallWidget::WaterfallWidget() {
}
void WaterfallWidget::on_show() {
context().message_map().register_handler(Message::ID::ChannelSpectrum,
context().message_map().register_handler(Message::ID::FIFONotify,
[this](const Message* const p) {
this->on_channel_spectrum(reinterpret_cast<const ChannelSpectrumMessage*>(p)->spectrum);
const auto message = reinterpret_cast<const FIFONotifyMessage*>(p);
auto fifo = reinterpret_cast<ChannelSpectrumFIFO*>(message->fifo);
ChannelSpectrum channel_spectrum;
if( fifo->out(channel_spectrum) ) {
this->on_channel_spectrum(channel_spectrum);
}
}
);
}
void WaterfallWidget::on_hide() {
context().message_map().unregister_handler(Message::ID::ChannelSpectrum);
context().message_map().unregister_handler(Message::ID::FIFONotify);
}
void WaterfallWidget::set_parent_rect(const Rect new_parent_rect) {