/* This deallocates the parameter RAM slot allocated by edma_alloc_slot(). Callers are responsible for ensuring the slot is inactive, and will not be activated.  */
void edma_free_slot(unsigned slot)
/* This deallocates the parameter RAM slot allocated by edma_alloc_slot(). Callers are responsible for ensuring the slot is inactive, and will not be activated.  */
void edma_free_slot(unsigned slot)
{
    unsigned ctlr;
    ctlr = EDMA_CTLR(slot);
    slot = EDMA_CHAN_SLOT(slot);
    if (slot < edma_cc[ctlr]->num_channels ||
        slot >= edma_cc[ctlr]->num_slots)
        return;
    rt_memcpy((void *)(edmacc_regs_base[ctlr] + PARM_OFFSET(slot)),
            &dummy_paramset, PARM_SIZE);
    clear_bit(slot, edma_cc[ctlr]->edma_inuse);
}