mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-18 10:32:16 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user