mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-08 22:52:27 -04: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:
parent
2cd28fcc0c
commit
aaa1bc3a09
4 changed files with 37 additions and 21 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue