mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04: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:
parent
aaa1bc3a09
commit
ba33cc737d
@ -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);
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
RSSIStatistics = 0,
|
||||
BasebandStatistics = 1,
|
||||
ChannelStatistics = 2,
|
||||
|
||||
DisplayFrameSync = 3,
|
||||
AudioStatistics = 4,
|
||||
BasebandConfiguration = 5,
|
||||
TPMSPacket = 6,
|
||||
@ -133,6 +133,14 @@ public:
|
||||
ChannelStatistics statistics;
|
||||
};
|
||||
|
||||
class DisplayFrameSyncMessage : public Message {
|
||||
public:
|
||||
constexpr DisplayFrameSyncMessage(
|
||||
) : Message { ID::DisplayFrameSync }
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct AudioStatistics {
|
||||
int32_t rms_db;
|
||||
int32_t max_db;
|
||||
|
Loading…
Reference in New Issue
Block a user