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

Method waitComplete

src/platforms/arm/rp/rpcommon/spi_hw_4_rp.cpp.hpp:504–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504bool SPIQuadRP2040::waitComplete(u32 timeout_ms) {
505 if (!mTransactionActive) {
506 return true; // Nothing to wait for
507 }
508
509 // Poll with timeout checking
510 if (timeout_ms == fl::numeric_limits<u32>::max()) {
511 // Infinite timeout - just wait
512 dma_channel_wait_for_finish_blocking(mDMAChannel);
513 } else {
514 // Timeout-based polling with timestamp checking
515 fl::u32 start_time = fl::millis();
516 while (dma_channel_is_busy(mDMAChannel)) {
517 if ((fl::millis() - start_time) >= timeout_ms) {
518 return false; // Timeout
519 }
520 }
521 }
522
523 mTransactionActive = false;
524
525 // Auto-release DMA buffer
526 mBufferAcquired = false;
527 mCurrentTotalSize = 0;
528
529 return true;
530}
531
532bool SPIQuadRP2040::isBusy() const {
533 if (!mInitialized) {

Callers

nothing calls this directly

Calls 2

maxFunction · 0.85
millisFunction · 0.50

Tested by

no test coverage detected