Skip to content
Snippets Groups Projects
Select Git revision
  • b14de21fc806d11e9af40d64da0f2cea953345f9
  • main default protected
  • phhw
  • captouch-threshold
  • t
  • dos
  • test2
  • test
  • slewtest
  • simtest
  • view-think
  • vm-pending
  • media-buf
  • scope
  • passthrough
  • wave
  • vsync
  • dos-main-patch-50543
  • json-error
  • rahix/big-flow3r
  • pippin/media_framework
  • v1.3.0
  • v1.2.0
  • v1.2.0+rc1
  • v1.1.1
  • v1.1.0
  • v1.1.0+rc1
  • v1.0.0
  • v1.0.0+rc6
  • v1.0.0+rc5
  • v1.0.0+rc4
  • v1.0.0+rc3
  • v1.0.0+rc2
  • v1.0.0+rc1
34 results

compile.c

Blame
  • Forked from flow3r / flow3r firmware
    Source project has a limited visibility.
    api_caller.c 650 B
    #include <stdlib.h>
    
    #include "api/api_caller.h"
    #include "tmr_utils.h"
    
    void* api_call_start (uint32_t id, void* args, uint32_t size)
    {
    	// aquire semaphore
    	while (E_BUSY == SEMA_GetSema (API_CALL_SEMA)) ;
    
    	ApiCallSpace->id = id;
    	ApiCallSpace->returning = 0;
    	return ApiCallSpace->buf;
    }
    
    void* api_call_bother_dispatcher (void* buf)
    {
    	SEMA_FreeSema (API_CALL_SEMA);
    	// TODO: set event
    
    	while(1) {
    		// aquire semaphore
    		while (E_BUSY == SEMA_GetSema (API_CALL_SEMA)) ;
    		if (ApiCallSpace->returning == 1) {
    			break;
    		}
    		SEMA_FreeSema(API_CALL_SEMA);
    		TMR_Delay(MXC_TMR2, MSEC(100), 0);
    	}
    	SEMA_FreeSema(API_CALL_SEMA);
    
    	return NULL;
    }