Skip to content
Snippets Groups Projects
Select Git revision
  • e6560754a5d41ddc01815ee06f10367d39af2367
  • master default protected
  • koalo/bhi160-works-but-dirty
  • ch3/splashscreen
  • m
  • rahix/simple_menu
  • ios-workarounds
  • koalo/wip/i2c-for-python
  • genofire/ble-rewrite
  • renze/safe_mode
  • renze/hatchery_apps
  • schneider/fundamental-test
  • koalo/factory-reset
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • schneider/bonding
  • schneider/bootloader-update-9a0d158
  • schneider/bsec
  • rahix/bma
  • rahix/bhi
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
27 results

board.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    api_dispatcher.c 653 B
    #include "api_dispatcher.h"
    
    int api_init(sys_cfg_sema_t *sys_cfg)
    {
    	int ret;
    
    	ret = SEMA_Init(sys_cfg);
    	/* Set the status of the flag to a valid initial state (right before
    	 * api-calls are made) */
    	ApiCallSpace->returning = 1;
    
    	return ret;
    }
    
    /* Generated function */
    void __api_dispatch_call(uint32_t id, void *buffer);
    
    void api_dispatcher()
    {
    	while (SEMA_GetSema(API_CALL_SEMA) == E_BUSY) {
    	}
    
    	if (ApiCallSpace->returning == 1) {
    		SEMA_FreeSema(API_CALL_SEMA);
    		return;
    	}
    
    	printf("core1: Catched API CALL!\n");
    	__api_dispatch_call(ApiCallSpace->id, ApiCallSpace->buf);
    
    	ApiCallSpace->returning = 1;
    
    	SEMA_FreeSema(API_CALL_SEMA);
    }