mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Signal M0 when stream FIFO has another "chunk".
This commit is contained in:
parent
4a1d3b14a1
commit
a5c2143ca8
@ -48,7 +48,13 @@ public:
|
|||||||
|
|
||||||
size_t write(const void* const data, const size_t length) {
|
size_t write(const void* const data, const size_t length) {
|
||||||
const auto written = fifo.in(reinterpret_cast<const uint8_t*>(data), length);
|
const auto written = fifo.in(reinterpret_cast<const uint8_t*>(data), length);
|
||||||
|
|
||||||
|
const auto last_bytes_written = bytes_written;
|
||||||
bytes_written += written;
|
bytes_written += written;
|
||||||
|
if( (bytes_written & event_bytes_mask) < (last_bytes_written & event_bytes_mask) ) {
|
||||||
|
creg::m4txevent::assert();
|
||||||
|
}
|
||||||
|
|
||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +64,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const size_t K;
|
const size_t K;
|
||||||
|
const uint64_t event_bytes_mask = (1ULL << 12) - 1;
|
||||||
uint64_t bytes_written = 0;
|
uint64_t bytes_written = 0;
|
||||||
std::unique_ptr<uint8_t[]> data;
|
std::unique_ptr<uint8_t[]> data;
|
||||||
FIFO<uint8_t> fifo;
|
FIFO<uint8_t> fifo;
|
||||||
|
Loading…
Reference in New Issue
Block a user