aboutsummaryrefslogtreecommitdiff
path: root/src_c/arch.h
blob: 01ae8d992bafcda80014881dee492d7356c4de97 (plain) (blame)
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
#ifndef LISP16_ARCH_H
#define LISP16_ARCH_H

#define LSP_ARCH_POSIX 0
#define LSP_ARCH_AVR8 1
#define LSP_ARCH_STM32 2

#ifndef LSP_ARCH
#error LSP_ARCH not defined
#endif

#if LSP_ARCH == LSP_ARCH_POSIX

#include <stdint.h>
typedef _Bool lsp_bool_t;
typedef int8_t lsp_int8_t;
typedef int16_t lsp_int16_t;
typedef int32_t lsp_int32_t;
typedef uint8_t lsp_uint8_t;
typedef uint16_t lsp_uint16_t;
typedef uint32_t lsp_uint32_t;

#elif LSP_ARCH == LSP_ARCH_AVR8

#include <stdint.h>
typedef _Bool lsp_bool_t;
typedef int8_t lsp_int8_t;
typedef int16_t lsp_int16_t;
typedef int32_t lsp_int32_t;
typedef uint8_t lsp_uint8_t;
typedef uint16_t lsp_uint16_t;
typedef uint32_t lsp_uint32_t;

#elif LSP_ARCH == LSP_ARCH_STM32

#include <stdint.h>
typedef _Bool lsp_bool_t;
typedef int8_t lsp_int8_t;
typedef int16_t lsp_int16_t;
typedef int32_t lsp_int32_t;
typedef uint8_t lsp_uint8_t;
typedef uint16_t lsp_uint16_t;
typedef uint32_t lsp_uint32_t;

#else

#error unknown LSP_ARCH

#endif

#ifndef NULL
#define NULL ((void *)0)
#endif

#ifndef true
#define true ((lsp_bool_t)1)
#endif

#ifndef false
#define false ((lsp_bool_t)0)
#endif

#endif