Skip to content
Snippets Groups Projects
Commit c5da7c7b authored by ch3's avatar ch3
Browse files

Add first API definition

parent 1f41b761
Branches
Tags
No related merge requests found
void* api_call_start (uint32_t id, void* args, size_t size)
{
// aquire semaphore
ret = SEMA_GetSema (API_CALL_SEMA);
ApiCallSpace->id = id;
ApiCallSpace->returning = 0;
return ApiCallSpace;
}
#include "api_common.h"
int api_call (uint32_t id, void *args);
#define API_CALL_SEMA 0
struct api_call
{
uint32_t id;
uint8_t returning;
unsigned char *buf;
};
static struct api_call **ApiCallSpace = (void*)0x20080001;
#include "api_common.h"
int
api_init (sys_cfg_sema_t *sys_cfg)
{
int ret;
ret = SEMA_Init (sys_cfg);
ApiCallSpace->returning = 1;
}
#include "api_common.h"
int
api_init (sys_cfg_sema_t *sys_cfg);
......@@ -3,6 +3,8 @@
#include "mxc_delay.h"
#include "api.h"
#include "api/api_dispatcher.h"
static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
void api_set_buzzer(uint8_t state)
......@@ -24,6 +26,7 @@ void api_set_led(uint8_t led, led_color_t color)
int main(void)
{
api_init(NULL);
// Enable rxev on core1
MXC_GCR->evten |= 0x20;
for (int i = 0; 1; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment