From 9da038a2cc329d14e2518436a4f5fead06391bd2 Mon Sep 17 00:00:00 2001 From: ch3 <ch3@mailbox.org> Date: Thu, 13 Jun 2019 23:31:17 +0200 Subject: [PATCH] Add _bother_dispatcher() --- hw-tests/api-demo/api/api_caller.c | 12 ++++++++++-- hw-tests/api-demo/api/api_caller.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw-tests/api-demo/api/api_caller.c b/hw-tests/api-demo/api/api_caller.c index cc26fd8c..3b8d42fa 100644 --- a/hw-tests/api-demo/api/api_caller.c +++ b/hw-tests/api-demo/api/api_caller.c @@ -1,13 +1,21 @@ +#include <stdlib.h> + #include "api/api_caller.h" void* api_call_start (uint32_t id, void* args, uint32_t size) { - int ret; // aquire semaphore - ret = SEMA_GetSema (API_CALL_SEMA); + while (E_BUSY == SEMA_GetSema (API_CALL_SEMA)) ; ApiCallSpace->id = id; ApiCallSpace->returning = 0; return ApiCallSpace; } +void* api_call_bother_dispatcher (void* buf) +{ + SEMA_FreeSema (API_CALL_SEMA); + // set event + + return NULL; +} diff --git a/hw-tests/api-demo/api/api_caller.h b/hw-tests/api-demo/api/api_caller.h index c19ea433..39f7d99a 100644 --- a/hw-tests/api-demo/api/api_caller.h +++ b/hw-tests/api-demo/api/api_caller.h @@ -1,3 +1,5 @@ +#include "mxc_errors.h" + #include "api_common.h" void* api_call (uint32_t id, void *args, uint32_t size); -- GitLab