We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1ae61b commit 3b4fb29Copy full SHA for 3b4fb29
libraries/I2S/src/I2S.cpp
@@ -376,13 +376,14 @@ bool I2S::read32(int32_t *l, int32_t *r) {
376
377
size_t I2S::write(const uint8_t *buffer, size_t size) {
378
// We can only write 32-bit chunks here
379
- if (size & 0x3) {
+ if (size & 0x3 || !_running || !_isOutput) {
380
return 0;
381
}
382
+
383
size_t writtenSize = 0;
- int32_t *p = (int32_t *)buffer;
384
+ uint32_t *p = (uint32_t *)buffer;
385
while (size) {
- if (!write((int32_t)*p)) {
386
+ if (!_arb->write(*p, false)) {
387
// Blocked, stop write here
388
return writtenSize;
389
} else {
0 commit comments