MCPcopy Create free account
hub / github.com/FastLED/FastLED / waitComplete

Method waitComplete

src/platforms/arm/rp/rpcommon/spi_hw_2_rp.cpp.hpp:465–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465bool SPIDualRP2040::waitComplete(u32 timeout_ms) {
466 if (!mTransactionActive) {
467 return true; // Nothing to wait for
468 }
469
470 // Poll with timeout checking
471 if (timeout_ms == fl::numeric_limits<u32>::max()) {
472 // Infinite timeout - just wait
473 dma_channel_wait_for_finish_blocking(mDMAChannel);
474 } else {
475 // Timeout-based polling with timestamp checking
476 fl::u32 start_time = fl::millis();
477 while (dma_channel_is_busy(mDMAChannel)) {
478 if ((fl::millis() - start_time) >= timeout_ms) {
479 return false; // Timeout
480 }
481 }
482 }
483
484 mTransactionActive = false;
485
486 // Auto-release DMA buffer
487 mBufferAcquired = false;
488 mCurrentTotalSize = 0;
489
490 return true;
491}
492
493bool SPIDualRP2040::isBusy() const {
494 if (!mInitialized) {

Callers

nothing calls this directly

Calls 2

maxFunction · 0.85
millisFunction · 0.50

Tested by

no test coverage detected