docs: update on expression with stack api usage regard the stack setup.

pull/4618/head
Felipe Neves 2019-12-04 10:51:56 -03:00
rodzic fab50ccf7c
commit 8bfb8e885e
1 zmienionych plików z 1 dodań i 6 usunięć

Wyświetl plik

@ -33,17 +33,12 @@ The usage may looks like the code below:
//Allocate a stack buffer, from heap or as a static form:
portSTACK_TYPE *shared_stack = malloc(8192 * sizeof(portSTACK_TYPE));
//points to the top of stack, that is it the last word of allocated buffer:
portSTACK_TYPE *ext_stack_top = (portSTACK_TYPE *)&shared_stack[0] +
((sizeof(8192 * sizeof(portSTACK_TYPE))) /
sizeof(portSTACK_TYPE));
//Allocate a mutex to protect its usage:
SemaphoreHandle_t printf_lock = xSemaphoreCreateMutex();
//Call the desired function using the macro helper:
ESP_EXECUTE_EXPRESSION_WITH_STACK(printf_lock,
ext_stack_top,
shared_stack,
printf("Executing this from external stack! \n"));
free(shared_stack);
}