mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-30 01:59:13 -04:00
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:
parent
67eb62ec12
commit
d5e21ce972
12 changed files with 82 additions and 29 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue