/* This function shall be invoked by the API library * and should not be explicitly invoked. */ void CyU3PDmaBufferDeInit ( void) { uint32_t status; /* Get the mutex lock. */ if (CyU3PThreadIdentify ()) { status = CyU3PMutexGet (&glBufferManager.lock, CYU3P_WAIT_FOREVER); } else { status = CyU3PMutexGet (&glBufferManager.lock, CYU3P_NO_WAIT); } if (status != CY_U3P_SUCCESS) { return; } /* Free memory and zero out variables. */ CyU3PMemFree (glBufferManager.usedStatus); glBufferManager.usedStatus = 0; glBufferManager.startAddr = 0; glBufferManager.regionSize = 0; glBufferManager.statusSize = 0; /* Free up and destroy the mutex variable. */ CyU3PMutexPut (&glBufferManager.lock); CyU3PMutexDestroy (&glBufferManager.lock); }
/* Function : CyU3PDmaBufferDeInit * Description : This function frees up the custom heap used for DMA buffer allocation. * The function should not be explicitly invoked, and is called from the * API library. * Parameters : None */ void CyU3PDmaBufferDeInit ( void) { uint32_t status; /* Get the mutex lock. */ if (CyU3PThreadIdentify ()) { status = CyU3PMutexGet (&glBufferManager.lock, CYU3P_WAIT_FOREVER); } else { status = CyU3PMutexGet (&glBufferManager.lock, CYU3P_NO_WAIT); } if (status != CY_U3P_SUCCESS) { return; } /* Free memory and zero out variables. */ CyU3PMemFree (glBufferManager.usedStatus); glBufferManager.usedStatus = 0; glBufferManager.startAddr = 0; glBufferManager.regionSize = 0; glBufferManager.statusSize = 0; #ifdef CYFXTX_ERRORDETECTION /* Clear status tracking variables. */ glBufAllocCnt = 0; glBufFreeCnt = 0; glBufInUseList = 0; #endif /* Free up and destroy the mutex variable. */ CyU3PMutexPut (&glBufferManager.lock); CyU3PMutexDestroy (&glBufferManager.lock); }