From 7b90f34c5a4fe4cb59e0ddbc1a86dedd114ffb1e Mon Sep 17 00:00:00 2001 From: Felipe Neves Date: Fri, 15 Nov 2019 16:49:25 +0800 Subject: [PATCH] esp_expression_with_stack: renamed macro and functions to have esp_ prefix --- .../esp_common/include/esp_expression_with_stack.h | 10 +++++----- .../esp_common/src/esp_espression_with_stack_asm.S | 12 ++++++------ components/newlib/test/test_shared_stack_printf.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/esp_common/include/esp_expression_with_stack.h b/components/esp_common/include/esp_expression_with_stack.h index e2ca47c13..4d337f3fd 100644 --- a/components/esp_common/include/esp_expression_with_stack.h +++ b/components/esp_common/include/esp_expression_with_stack.h @@ -10,16 +10,16 @@ * @param stack Pointer to user alocated stack, it must points to its top * @param expression Expression or function to be executed using the stack */ -#define EXECUTE_EXPRESSION_WITH_STACK(lock, stack, expression) \ +#define ESP_EXECUTE_EXPRESSION_WITH_STACK(lock, stack, expression) \ ({ \ if(lock) { \ uint32_t backup; \ xSemaphoreTake(lock, portMAX_DELAY); \ - switch_stack_enter(stack, &backup); \ + esp_switch_stack_enter(stack, &backup); \ { \ expression; \ } \ - switch_stack_exit(&backup); \ + esp_switch_stack_exit(&backup); \ xSemaphoreGive(lock); \ } \ }) @@ -29,7 +29,7 @@ * Should never be called directly, otherwise crashes could * occur */ -extern void switch_stack_enter(portSTACK_TYPE *stack, uint32_t *backup_stack); -extern void switch_stack_exit(uint32_t *backup_stack); +extern void esp_switch_stack_enter(portSTACK_TYPE *stack, uint32_t *backup_stack); +extern void esp_switch_stack_exit(uint32_t *backup_stack); #endif \ No newline at end of file diff --git a/components/esp_common/src/esp_espression_with_stack_asm.S b/components/esp_common/src/esp_espression_with_stack_asm.S index b27834ad0..78e30b9e4 100644 --- a/components/esp_common/src/esp_espression_with_stack_asm.S +++ b/components/esp_common/src/esp_espression_with_stack_asm.S @@ -5,10 +5,10 @@ /** * extern void switch_stack_enter(portSTACK_TYPE *stack, portSTACK_TYPE *backup_stack); */ - .globl switch_stack_enter - .type switch_stack_enter,@function + .globl esp_switch_stack_enter + .type esp_switch_stack_enter,@function .align 4 -switch_stack_enter: +esp_switch_stack_enter: entry sp, 0x10 mov a4, a1 s32i a4, a3, 0 /* on a3 there is a safe place to save the current stack */ @@ -19,10 +19,10 @@ switch_stack_enter: /** * extern void switch_stack_exit(portSTACK_TYPE *backup_stack); */ - .globl switch_stack_exit - .type switch_stack_exit,@function + .globl esp_switch_stack_exit + .type esp_switch_stack_exit,@function .align 4 -switch_stack_exit: +esp_switch_stack_exit: entry sp, 0x10 l32i a4, a2, 0 /* recover the original task stack */ mov a1, a4 /* put it on sp register again */ diff --git a/components/newlib/test/test_shared_stack_printf.c b/components/newlib/test/test_shared_stack_printf.c index 6202b6e36..f5f8aabcb 100644 --- a/components/newlib/test/test_shared_stack_printf.c +++ b/components/newlib/test/test_shared_stack_printf.c @@ -26,7 +26,7 @@ TEST_CASE("test printf using shared buffer stack", "[newlib]") TEST_ASSERT(shared_stack != NULL); SemaphoreHandle_t printf_lock = xSemaphoreCreateMutex(); - EXECUTE_EXPRESSION_WITH_STACK(printf_lock, ext_stack_top, printf("Executing this from external stack! \n")); - EXECUTE_EXPRESSION_WITH_STACK(printf_lock, ext_stack_top, check_stack(ext_stack_top, shared_stack)); + ESP_EXECUTE_EXPRESSION_WITH_STACK(printf_lock, ext_stack_top, printf("Executing this from external stack! \n")); + ESP_EXECUTE_EXPRESSION_WITH_STACK(printf_lock, ext_stack_top, check_stack(ext_stack_top, shared_stack)); free(shared_stack); }