mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-12-01 15:46:12 +00:00
Move FIFO and write size to CaptureConfig structure.
Now configured from baseband, where write size and appropriate FIFO size is known.
This commit is contained in:
@@ -411,7 +411,18 @@ public:
|
||||
};
|
||||
|
||||
struct CaptureConfig {
|
||||
FIFO<uint8_t>* fifo { nullptr };
|
||||
const size_t write_size_log2;
|
||||
const size_t buffer_count_log2;
|
||||
FIFO<uint8_t>* fifo;
|
||||
|
||||
constexpr CaptureConfig(
|
||||
const size_t write_size_log2,
|
||||
const size_t buffer_count_log2
|
||||
) : write_size_log2 { write_size_log2 },
|
||||
buffer_count_log2 { buffer_count_log2 },
|
||||
fifo { nullptr }
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CaptureConfigMessage : public Message {
|
||||
|
||||
@@ -70,6 +70,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool is_empty() const {
|
||||
return fifo.is_empty();
|
||||
}
|
||||
|
||||
private:
|
||||
FIFO<uint8_t> fifo;
|
||||
Mutex mutex_write;
|
||||
@@ -92,10 +96,6 @@ private:
|
||||
return fifo.len();
|
||||
}
|
||||
|
||||
bool is_empty() const {
|
||||
return fifo.is_empty();
|
||||
}
|
||||
|
||||
bool push(const void* const buf, const size_t len) {
|
||||
chMtxLock(&mutex_write);
|
||||
const auto result = fifo.in_r(buf, len);
|
||||
|
||||
Reference in New Issue
Block a user