mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 20:21:04 +00:00
ipc: fix esp_ipc_call_blocking
to return after callback execution is completed
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
This commit is contained in:
23
components/esp32/test/test_ipc.c
Normal file
23
components/esp32/test/test_ipc.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "unity.h"
|
||||
#include "esp_ipc.h"
|
||||
|
||||
static void test_func_ipc_cb(void *arg)
|
||||
{
|
||||
vTaskDelay(50);
|
||||
int *val = (int *)arg;
|
||||
*val = 0xa5a5;
|
||||
}
|
||||
|
||||
TEST_CASE("Test blocking IPC function call", "[ipc]")
|
||||
{
|
||||
int val = 0x5a5a;
|
||||
#ifdef CONFIG_FREERTOS_UNICORE
|
||||
esp_ipc_call_blocking(xPortGetCoreID(), test_func_ipc_cb, &val);
|
||||
#else
|
||||
esp_ipc_call_blocking(!xPortGetCoreID(), test_func_ipc_cb, &val);
|
||||
#endif
|
||||
TEST_ASSERT_EQUAL_HEX(val, 0xa5a5);
|
||||
}
|
Reference in New Issue
Block a user