MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / playedBuffer

Function playedBuffer

modules/pins/i2s/audioout.c:1461–1472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1459
1460#ifdef MODDEF_AUDIOOUT_AMPLIFIER_POWER
1461static bool playedBuffer(i2s_chan_handle_t handle, i2s_event_data_t *event, void *user_ctx)
1462{
1463 modAudioOut out = user_ctx;
1464
1465 int bytesInFlight = __atomic_fetch_sub(&out->bytesInFlight, event->size, __ATOMIC_SEQ_CST);
1466 if (bytesInFlight <= event->size) {
1467 if (bytesInFlight >= 0)
1468 modGPIOWrite(&out->amplifierPower, 0);
1469 }
1470
1471 return false;
1472}
1473#endif
1474
1475void audioOutLoop(void *pvParameter)

Callers

nothing calls this directly

Calls 1

modGPIOWriteFunction · 0.50

Tested by

no test coverage detected