From 785abfeb82fb2c7f8aba4778d981d7c09cb47348 Mon Sep 17 00:00:00 2001 From: Felipe Neves Date: Fri, 20 Dec 2019 13:30:30 -0300 Subject: [PATCH] docs: update esp_expresstion_with_stack code snippet to check shared stack and mutex allocation. --- docs/en/api-reference/system/esp_expression_with_stack.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/api-reference/system/esp_expression_with_stack.rst b/docs/en/api-reference/system/esp_expression_with_stack.rst index 343d2fe0dc..dd7b994f25 100644 --- a/docs/en/api-reference/system/esp_expression_with_stack.rst +++ b/docs/en/api-reference/system/esp_expression_with_stack.rst @@ -32,9 +32,11 @@ 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)); + assert(shared_stack != NULL); //Allocate a mutex to protect its usage: SemaphoreHandle_t printf_lock = xSemaphoreCreateMutex(); + assert(printf_lock != NULL); //Call the desired function using the macro helper: ESP_EXECUTE_EXPRESSION_WITH_STACK(printf_lock,