mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-25 22:16:14 -05:00
Move capture start/stop into baseband API.
Hide more calls to baseband/shared memory.
This commit is contained in:
parent
6bd191349a
commit
420adea180
@ -102,4 +102,16 @@ void spectrum_streaming_stop() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void capture_start(CaptureConfig* const config) {
|
||||||
|
shared_memory.baseband_queue.push_and_wait(
|
||||||
|
CaptureConfigMessage { config }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void capture_stop() {
|
||||||
|
shared_memory.baseband_queue.push_and_wait(
|
||||||
|
CaptureConfigMessage { nullptr }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace baseband */
|
} /* namespace baseband */
|
||||||
|
@ -58,6 +58,9 @@ void shutdown();
|
|||||||
void spectrum_streaming_start();
|
void spectrum_streaming_start();
|
||||||
void spectrum_streaming_stop();
|
void spectrum_streaming_stop();
|
||||||
|
|
||||||
|
void capture_start(CaptureConfig* const config);
|
||||||
|
void capture_stop();
|
||||||
|
|
||||||
} /* namespace baseband */
|
} /* namespace baseband */
|
||||||
|
|
||||||
#endif/*__BASEBAND_API_H__*/
|
#endif/*__BASEBAND_API_H__*/
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "capture_thread.hpp"
|
#include "capture_thread.hpp"
|
||||||
|
|
||||||
#include "portapack_shared_memory.hpp"
|
#include "baseband_api.hpp"
|
||||||
|
|
||||||
// StreamOutput ///////////////////////////////////////////////////////////
|
// StreamOutput ///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -59,9 +59,7 @@ StreamOutput::StreamOutput(
|
|||||||
CaptureConfig* const config
|
CaptureConfig* const config
|
||||||
) : config { config }
|
) : config { config }
|
||||||
{
|
{
|
||||||
shared_memory.baseband_queue.push_and_wait(
|
baseband::capture_start(config);
|
||||||
CaptureConfigMessage { config }
|
|
||||||
);
|
|
||||||
fifo_buffers_empty = config->fifo_buffers_empty;
|
fifo_buffers_empty = config->fifo_buffers_empty;
|
||||||
fifo_buffers_full = config->fifo_buffers_full;
|
fifo_buffers_full = config->fifo_buffers_full;
|
||||||
}
|
}
|
||||||
@ -69,9 +67,7 @@ StreamOutput::StreamOutput(
|
|||||||
StreamOutput::~StreamOutput() {
|
StreamOutput::~StreamOutput() {
|
||||||
fifo_buffers_full = nullptr;
|
fifo_buffers_full = nullptr;
|
||||||
fifo_buffers_empty = nullptr;
|
fifo_buffers_empty = nullptr;
|
||||||
shared_memory.baseband_queue.push_and_wait(
|
baseband::capture_stop();
|
||||||
CaptureConfigMessage { nullptr }
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CaptureThread //////////////////////////////////////////////////////////
|
// CaptureThread //////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user