This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
main.c
68 lines (49 loc) · 2.22 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
This file is part of martink project.
martink firmware project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
martink firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with martink firmware. If not, see <http://www.gnu.org/licenses/>.
Author: Martin K. Schröder
Email: info@fortmax.se
Github: https://github.com/mkschreder
*/
/**
\mainpage LibK firmware development library
<b>Introduction</b>
LibK is a driver support library providing portable device driver
support for embedded applications.
It is distributed under the GNU General Public License - see the
accompanying LICENSE.txt file for more details.
It is designed to even be able to compile on a desktop. The future
may very well involve using libk to use the same device drivers for
both arduino and a linux based board that uses linux to access i2c
ports and other ports. LibK can basically be compiled as a native
library. All that is necessary to run it on any board is to
implement the arch interface for that board. For a native version
this layer would use linux system calls to access i2c or SPI ports
instead of accessing hardware registers directly - but for the
drivers it does not matter.
<b>Download source code</b>
You can get libk source code from the project github page:
https://github.com/mkschreder
*/
#include "kernel.h"
#include <setjmp.h>
extern void app_init(void);
extern void app_process_events(void);
void board_init(void);
extern int __cxa_guard_acquire(__guard *g);
extern void __cxa_guard_release (__guard *g);
extern void __cxa_guard_abort (__guard *g);
extern void __cxa_pure_virtual(void);
int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}
void __cxa_guard_release (__guard *g) {*(char *)g = 1;}
void __cxa_guard_abort (__guard *g) {*(char*)g = 0;}
void __cxa_pure_virtual(void) {}