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

Method acquireDMABuffer

src/platforms/stub/spi_8_stub.cpp.hpp:58–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58DMABuffer SpiHw8Stub::acquireDMABuffer(size_t bytes_per_lane) FL_NOEXCEPT {
59 if (!mInitialized) {
60 return DMABuffer(SPIError::NOT_INITIALIZED);
61 }
62
63 // Auto-wait if previous transmission still active
64 if (mBusy) {
65 waitComplete();
66 }
67
68 // For octal-lane SPI: num_lanes = 8
69 constexpr size_t num_lanes = 8;
70 const size_t total_size = bytes_per_lane * num_lanes;
71
72 // Create a new DMABuffer with the specified size
73 mCurrentBuffer = DMABuffer(total_size);
74
75 if (!mCurrentBuffer.ok()) {
76 return mCurrentBuffer; // Return error
77 }
78
79 mBufferAcquired = true;
80
81 // Return a copy of the buffer (shared_ptr will be shared)
82 return mCurrentBuffer;
83}
84
85bool SpiHw8Stub::transmit(TransmitMode mode) FL_NOEXCEPT {
86 (void)mode; // Unused in stub

Callers 4

flushMethod · 0.45
acquireBufferMethod · 0.45
transmitBatchMethod · 0.45
finalizeTransmissionMethod · 0.45

Calls 2

DMABufferClass · 0.50
okMethod · 0.45

Tested by

no test coverage detected