Complete the code to allocate memory dynamically using FreeRTOS.
void *ptr = [1](100);
pvPortMalloc is the FreeRTOS function to allocate memory dynamically.
Complete the code to free the allocated memory using FreeRTOS.
void *ptr = pvPortMalloc(50); [1](ptr);
vPortFree is the FreeRTOS function to free memory allocated by pvPortMalloc.
Fix the error in the code to correctly allocate and free memory in FreeRTOS.
char *buffer = [1](256); // Use buffer vPortFree(buffer);
Use pvPortMalloc to allocate memory and vPortFree to free it in FreeRTOS. The code incorrectly uses free instead of vPortFree.
Fill both blanks to create a buffer, check allocation success, and free it properly.
char *buf = [1](128); if (buf == [2]) { // handle error } vPortFree(buf);
pvPortMalloc allocates memory, and NULL is used to check if allocation failed.
Fill all three blanks to allocate memory, check success, and free it correctly in FreeRTOS.
void *mem = [1](size); if (mem == [2]) { return -1; } [3](mem);
pvPortMalloc allocates memory, NULL checks failure, and vPortFree frees the memory in FreeRTOS.