mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 06:49:24 -05:00
Add missing message handler for wideband spectrum.
Spectrum processing was not enabled, and hence wideband spectrum was not being displayed.
This commit is contained in:
parent
55e3a70fde
commit
1f3c182b7f
@ -64,7 +64,24 @@ void WidebandSpectrum::execute(const buffer_c8_t& buffer) {
|
||||
}
|
||||
|
||||
void WidebandSpectrum::on_message(const Message* const message) {
|
||||
if( message->id == Message::ID::UpdateSpectrum ) {
|
||||
switch(message->id) {
|
||||
case Message::ID::UpdateSpectrum:
|
||||
channel_spectrum.update();
|
||||
break;
|
||||
|
||||
case Message::ID::SpectrumStreamingConfig:
|
||||
streaming_config(*reinterpret_cast<const SpectrumStreamingConfigMessage*>(message));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WidebandSpectrum::streaming_config(const SpectrumStreamingConfigMessage& message) {
|
||||
if( message.mode == SpectrumStreamingConfigMessage::Mode::Running ) {
|
||||
channel_spectrum.start();
|
||||
} else {
|
||||
channel_spectrum.stop();
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "baseband_processor.hpp"
|
||||
#include "spectrum_collector.hpp"
|
||||
|
||||
#include "message.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <array>
|
||||
#include <complex>
|
||||
@ -39,6 +41,8 @@ private:
|
||||
SpectrumCollector channel_spectrum;
|
||||
|
||||
std::array<complex16_t, 256> spectrum;
|
||||
|
||||
void streaming_config(const SpectrumStreamingConfigMessage& message);
|
||||
};
|
||||
|
||||
#endif/*__PROC_WIDEBAND_SPECTRUM_H__*/
|
||||
|
Loading…
Reference in New Issue
Block a user