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

@ -30,6 +30,7 @@
#include "baseband_packet.hpp"
#include "ert_packet.hpp"
#include "dsp_fir_taps.hpp"
#include "fifo.hpp"
#include "utility.hpp"
@ -44,7 +45,7 @@ public:
RSSIStatistics = 0,
BasebandStatistics = 1,
ChannelStatistics = 2,
ChannelSpectrum = 3,
AudioStatistics = 4,
BasebandConfiguration = 5,
TPMSPacket = 6,
@ -55,6 +56,7 @@ public:
NBFMConfigure = 11,
WFMConfigure = 12,
AMConfigure = 13,
FIFONotify = 14,
MAX
};
@ -207,15 +209,7 @@ struct ChannelSpectrum {
uint32_t channel_filter_stop_frequency { 0 };
};
class ChannelSpectrumMessage : public Message {
public:
constexpr ChannelSpectrumMessage(
) : Message { ID::ChannelSpectrum }
{
}
ChannelSpectrum spectrum;
};
using ChannelSpectrumFIFO = FIFO<ChannelSpectrum, 2>;
class AISPacketMessage : public Message {
public:
@ -333,6 +327,18 @@ public:
const fir_taps_real<32> channel_filter;
};
class FIFONotifyMessage : public Message {
public:
constexpr FIFONotifyMessage(
void* const fifo
) : Message { ID::FIFONotify },
fifo { fifo }
{
}
void* const fifo;
};
class MessageHandlerMap {
public:
using MessageHandler = std::function<void(Message* const p)>;