/* This function initializes the custom heap for OS specific dynamic memory allocation. * The function should not be explicitly invoked. This function is called from the * API library. Modify this function depending upon the heap requirement of * application code. The minimum required value is specified by the predefined macro. * Any value less than specified can cause the drivers to stop functioning. * The function creates a global byte pool. */ void CyU3PMemInit ( void) { if (!glMemPoolInit) { glMemPoolInit = CyTrue; CyU3PBytePoolCreate (&glMemBytePool, CY_U3P_MEM_HEAP_BASE, CY_U3P_MEM_HEAP_SIZE); } }
/* Function : CyU3PMemInit * Description : This function initializes the custom heap for OS specific dynamic * memory allocation. * The function should not be explicitly invoked, and is called from the * API library. The minimum required size for the heap is 20 KB. * The default implementation makes use of the Byte Pool services provided * by ThreadX. * Parameters : None */ void CyU3PMemInit ( void) { /* If the heap is not initialized so far, create the byte pool. */ if (!glMemPoolInit) { glMemPoolInit = CyTrue; CyU3PBytePoolCreate (&glMemBytePool, (void *)CY_U3P_MEM_HEAP_BASE, CY_U3P_MEM_HEAP_SIZE); } }