Skip to content
Snippets Groups Projects
Select Git revision
  • e57d3da6fc539a2815c1e3a98edd112bdb58743f
  • master default
  • faulty_unsigned_comparisons
  • fuchsi-ecg-app
  • gpio_in_adc_fix
  • drawcall_clipping
  • genofire/leds_rgb_get_state
  • genofire/rockets-state
  • genofire/ble-follow-py
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • genofire/haule-ble-fs-deactive
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • ios-workarounds
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
34 results

api_common.h

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);
    }