Unverified Commit f57b5bc7 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Add I2S::getOverUnderflow() (#1497)

See #1491.  Thanks @LinusHeu
parent 35a4d573
......@@ -84,6 +84,11 @@ void flush()
~~~~~~~~~~~~
Waits until all the I2S buffers have been output.
void getOverUnderflow()
~~~~~~~~~~~~~~~~~~~~~~~
Returns a flag indicating if the I2S system ran our of data to send on output,
or had to throw away data on input.
size_t write(uint8_t/int8_t/int16_t/int32_t)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Writes a single sample of ``bitsPerSample`` to the buffer. It is up to the
......
......@@ -54,6 +54,15 @@ public:
virtual size_t write(const uint8_t *buffer, size_t size) override;
virtual int availableForWrite() override;
// From the AR
bool getOverUnderflow() {
if (!_running) {
return false;
} else {
return _arb->getOverUnderflow();
}
}
// Try and make I2S::write() do what makes sense, namely write
// one sample (L or R) at the I2S configured bit width
virtual size_t write(uint8_t s) override {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment