| 778 | } |
| 779 | |
| 780 | void 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 | |
| 816 | int RmtMemoryManager::getDMAChannelsInUse() const FL_NOEXCEPT { |
| 817 | #if FASTLED_RMT5_DMA_SUPPORTED |
no outgoing calls
no test coverage detected