Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
compile.h
Go to the documentation of this file.
1
5#ifndef COMPILE_H
6#define COMPILE_H
7
8// define hardware constants
9#if HARDWARE_VERSION_MAJOR == 1 && HARDWARE_VERSION_MINOR == 0
10#warning "hardware version set to 1.0"
11#endif
12
13//
14// lamp type detection
15//
16
17// LMBD_LAMP_TYPE__SIMPLE
18#ifdef LMBD_LAMP_TYPE__SIMPLE
19
20#warning Compiling SIMPLE lamp type
21
22#ifdef LMBD_LAMP_TYPE__CCT
23#error "Cannot define CCT if SIMPLE is defined"
24#endif
25
26#ifdef LMBD_LAMP_TYPE__INDEXABLE
27#error "Cannot define INDEXABLE if SIMPLE is defined"
28#endif
29
30#endif // LMBD_LAMP_TYPE__SIMPLE
31
32// LMBD_LAMP_TYPE__CCT
33#ifdef LMBD_LAMP_TYPE__CCT
34
35#warning Compiling CCT lamp type
36
37#ifdef LMBD_LAMP_TYPE__SIMPLE
38#error "Cannot define SIMPLE if CCT is defined"
39#endif
40
41#ifdef LMBD_LAMP_TYPE__INDEXABLE
42#error "Cannot define INDEXABLE if CCT is defined"
43#endif
44
45#endif // LMBD_LAMP_TYPE__CCT
46
47// LMBD_LAMP_TYPE__CCT
48#ifdef LMBD_LAMP_TYPE__INDEXABLE
49
50#warning Compiling INDEXABLE lamp type
51
52#ifdef LMBD_LAMP_TYPE__SIMPLE
53#error "Cannot define SIMPLE if INDEXABLE is defined"
54#endif
55
56#ifdef LMBD_LAMP_TYPE__CCT
57#error "Cannot define CCT if INDEXABLE is defined"
58#endif
59
60#endif // LMBD_LAMP_TYPE__CCT
61
62#ifndef LMBD_LAMP_TYPE__SIMPLE
63#ifndef LMBD_LAMP_TYPE__CCT
64#ifndef LMBD_LAMP_TYPE__INDEXABLE
65#error Must compile the program with a defined user mode
66#endif
67#endif
68#endif
69
70// Users triggering the error below, will either:
71// - have no idea what they are doing, and shell prefer using the Makefile
72// - be autonomous, and can add all the necessary build flags
73// (among which -I$(BUILD_DIR)/objs/sketch and other -D<define>)
74
75#ifndef LMBD_MISSING_DEFINE
76#error "LMBD_MISSING_DEFINE missing, are you using the Makefile to build?"
77#endif
78
79#endif