test_ipc.c 532 B

1234567891011121314151617181920212223
  1. #include <stdio.h>
  2. #include "freertos/FreeRTOS.h"
  3. #include "freertos/task.h"
  4. #include "unity.h"
  5. #include "esp_ipc.h"
  6. static void test_func_ipc_cb(void *arg)
  7. {
  8. vTaskDelay(50);
  9. int *val = (int *)arg;
  10. *val = 0xa5a5;
  11. }
  12. TEST_CASE("Test blocking IPC function call", "[ipc]")
  13. {
  14. int val = 0x5a5a;
  15. #ifdef CONFIG_FREERTOS_UNICORE
  16. esp_ipc_call_blocking(xPortGetCoreID(), test_func_ipc_cb, &val);
  17. #else
  18. esp_ipc_call_blocking(!xPortGetCoreID(), test_func_ipc_cb, &val);
  19. #endif
  20. TEST_ASSERT_EQUAL_HEX(val, 0xa5a5);
  21. }