Skip to content
Snippets Groups Projects
Select Git revision
  • rectangle_fill_off_by_one
  • ble_dev_name
  • master default protected
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • schneider/bonding
  • schneider/bootloader-update-9a0d158
  • schneider/bsec
  • rahix/bma
  • rahix/bhi
  • schleicher-test
  • schneider/schleicher-test
  • freertos-btle
  • ch3/api-speed-eval2
  • schneider/mp-for-old-bl
  • ch3/leds-api
  • ch3/genapi-refactor
  • ch3/dual-core
  • dualcore
  • v0.0
21 results

init.gdb

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    api_caller.c NaN GiB
    #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;
    }