mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-18 13:42:01 +00:00
Transmit DisplayFrameSync message, handle in WaterfallSpectrum.
More kludginess, especially around initialization and timing. But it addresses the flickering lines of pixels at the bottom of the waterfall scroll area!
This commit is contained in:
@@ -197,6 +197,8 @@ private:
|
||||
}
|
||||
|
||||
void handle_lcd_frame_sync() {
|
||||
DisplayFrameSyncMessage message;
|
||||
context.message_map().send(&message);
|
||||
painter.paint_widget_tree(top_widget);
|
||||
}
|
||||
|
||||
|
@@ -240,16 +240,23 @@ void WaterfallWidget::on_show() {
|
||||
context().message_map().register_handler(Message::ID::FIFONotify,
|
||||
[this](const Message* const p) {
|
||||
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);
|
||||
this->fifo = reinterpret_cast<ChannelSpectrumFIFO*>(message->fifo);
|
||||
}
|
||||
);
|
||||
context().message_map().register_handler(Message::ID::DisplayFrameSync,
|
||||
[this](const Message* const p) {
|
||||
if( this->fifo ) {
|
||||
ChannelSpectrum channel_spectrum;
|
||||
while( fifo->out(channel_spectrum) ) {
|
||||
this->on_channel_spectrum(channel_spectrum);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void WaterfallWidget::on_hide() {
|
||||
context().message_map().unregister_handler(Message::ID::DisplayFrameSync);
|
||||
context().message_map().unregister_handler(Message::ID::FIFONotify);
|
||||
}
|
||||
|
||||
|
@@ -84,6 +84,7 @@ public:
|
||||
private:
|
||||
WaterfallView waterfall_view;
|
||||
FrequencyScale frequency_scale;
|
||||
ChannelSpectrumFIFO* fifo;
|
||||
|
||||
void on_channel_spectrum(const ChannelSpectrum& spectrum);
|
||||
};
|
||||
|
Reference in New Issue
Block a user