Skip to content
Snippets Groups Projects
Select Git revision
  • c35125400a829a919717813bf23cd4056c947d6d
  • master default protected
  • wdt-fix
  • appDb-store-timing
  • wdt
  • koalo/bhi160
  • genofire/ble-rewrite
  • rahix/simple_menu
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • ios-workarounds
  • koalo/wip/i2c-for-python
  • 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
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
28 results

api_caller.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    api_dispatcher.c 651 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;
    }
    
    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");
    	printf("%d: ",ApiCallSpace->id);
    	for (int i = 0; i < 16; i++) {
    		printf("0x%02x ", ((char*)ApiCallSpace->buf)[i]);
    	}
    	printf("\n");
    
    	ApiCallSpace->returning = 1;
    
    	SEMA_FreeSema(API_CALL_SEMA);
    }