Use CaptureConfig to share state between cores.

Remove awful FIFO_HACK.
TODO: Lots of repeated code...
TODO: Capture thread is signalled too frequently.
This commit is contained in:
Jared Boone 2016-04-23 15:07:44 -07:00
parent 67eb62ec12
commit d5e21ce972
12 changed files with 82 additions and 29 deletions

View file

@ -44,8 +44,6 @@ CaptureProcessor::CaptureProcessor() {
spectrum_samples = 0;
channel_spectrum.set_decimation_factor(1);
stream = std::make_unique<StreamInput>(15);
}
void CaptureProcessor::execute(const buffer_c8_t& buffer) {
@ -76,7 +74,19 @@ void CaptureProcessor::on_message(const Message* const message) {
channel_spectrum.on_message(message);
break;
case Message::ID::CaptureConfig:
capture_config(*reinterpret_cast<const CaptureConfigMessage*>(message));
break;
default:
break;
}
}
void CaptureProcessor::capture_config(const CaptureConfigMessage& message) {
if( message.config ) {
stream = std::make_unique<StreamInput>(15, *message.config);
} else {
stream.reset();
}
}