mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
esp_hw_support: create esp_cpu
Create a esp_cpu header that contains CPU-related functions and utilities.
This commit is contained in:
@@ -14,9 +14,9 @@ static StackType_t *shared_stack_sp = NULL;
|
||||
|
||||
void external_stack_function(void)
|
||||
{
|
||||
printf("Executing this printf from external stack! sp=%p\n", get_sp());
|
||||
printf("Executing this printf from external stack! sp=%p\n", esp_cpu_get_sp());
|
||||
|
||||
shared_stack_sp = (StackType_t *)get_sp();
|
||||
shared_stack_sp = (StackType_t *)esp_cpu_get_sp();
|
||||
|
||||
char *res = NULL;
|
||||
/* Test return value from asprintf, this could potentially help catch a misaligned
|
||||
@@ -30,9 +30,9 @@ void external_stack_function(void)
|
||||
void another_external_stack_function(void)
|
||||
{
|
||||
//We can even use Freertos resources inside of this context.
|
||||
printf("We can even use FreeRTOS resources... yielding, sp=%p\n", get_sp());
|
||||
printf("We can even use FreeRTOS resources... yielding, sp=%p\n", esp_cpu_get_sp());
|
||||
taskYIELD();
|
||||
shared_stack_sp = (StackType_t *)get_sp();
|
||||
shared_stack_sp = (StackType_t *)esp_cpu_get_sp();
|
||||
}
|
||||
|
||||
TEST_CASE("test printf using shared buffer stack", "[newlib]")
|
||||
@@ -43,7 +43,7 @@ TEST_CASE("test printf using shared buffer stack", "[newlib]")
|
||||
|
||||
SemaphoreHandle_t printf_lock = xSemaphoreCreateMutex();
|
||||
TEST_ASSERT_NOT_NULL(printf_lock);
|
||||
printf("current task sp: %p\n", get_sp());
|
||||
printf("current task sp: %p\n", esp_cpu_get_sp());
|
||||
printf("shared_stack: %p\n", (void *)shared_stack);
|
||||
printf("shared_stack expected top: %p\n", (void *)(shared_stack + SHARED_STACK_SIZE));
|
||||
|
||||
|
Reference in New Issue
Block a user