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

Method freeDMA

src/platforms/esp/32/drivers/rmt/rmt_5/rmt_memory_manager.cpp.hpp:780–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780void RmtMemoryManager::freeDMA(u8 channel_id, bool is_tx) FL_NOEXCEPT {
781#if FASTLED_RMT_STATIC_ALLOCATION
782 // Static-allocation mode: see RmtMemoryManager::free() for rationale.
783 // The destructor still reaches this; skipping the mismatch-diagnostic
784 // FL_WARN sites lets the linker drop the operator<< chains. See #2856
785 // item 3.6.
786 (void)channel_id;
787 (void)is_tx;
788#elif FASTLED_RMT5_DMA_SUPPORTED
789 if (!mDMAAllocation.allocated) {
790 FL_WARN("DMA free called but no DMA allocated");
791 return;
792 }
793
794 if (mDMAAllocation.channel_id != channel_id || mDMAAllocation.is_tx != is_tx) {
795 FL_WARN("DMA free mismatch: expected "
796 << (mDMAAllocation.is_tx ? "TX" : "RX") << " channel "
797 << static_cast<int>(mDMAAllocation.channel_id)
798 << ", got " << (is_tx ? "TX" : "RX") << " channel "
799 << static_cast<int>(channel_id));
800 return;
801 }
802
803 FL_LOG_RMT("DMA freed from " << (is_tx ? "TX" : "RX") << " channel "
804 << static_cast<int>(channel_id)
805 << " | DMA slots: 0/" << FASTLED_RMT5_MAX_DMA_CHANNELS);
806
807 mDMAAllocation.allocated = false;
808 mDMAAllocation.channel_id = 0;
809 mDMAAllocation.is_tx = false;
810#else
811 (void)channel_id;
812 (void)is_tx;
813#endif
814}
815
816int RmtMemoryManager::getDMAChannelsInUse() const FL_NOEXCEPT {
817#if FASTLED_RMT5_DMA_SUPPORTED

Callers 9

~RmtRxChannelImplMethod · 0.45
RmtRxChannelImplClass · 0.45
createChannelMethod · 0.45
configureChannelMethod · 0.45
reconfigureForNetworkMethod · 0.45
acquireChannelMethod · 0.45
destroyChannelMethod · 0.45
FL_TEST_FILEFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected