-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatformio.ini
166 lines (135 loc) · 4.14 KB
/
platformio.ini
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
; (!) TO CHECK IF ALL SECTIONS ARE CONFIGURED CORRECTLY
; (!) FOR EXAMPLE extends OR values interpolation
; (!) RUN >> pio project config
; (!) OR
; (!) RUN >> pio run -t envdump [-e ENVNAME]
; https://docs.platformio.org/en/latest/core/userguide/cmd_run.html#cmdoption-pio-run-list-targets
[platformio]
name = micro_chess
; ---------------- CONSTANTS SECTION -----------------
[constants]
prefix = MCH_
type_sections =
platform-type
build-type
mode
; ---------------- PLATFORM SECTIONS ----------------
[arduino] ; ARDUINO_ARCH_AVR is defined here
platform = atmelavr
framework = arduino
[arduino:uno] ; ARDUINO_AVR_UNO is defined here
extends = arduino
board = uno
[arduino:nano] ; ARDUINO_AVR_NANO is defined here
extends = arduino
board = nanoatmega328
; ------------- PLATFROM TYPE SECTIONS --------------
[platform-type:embedded]
; (!) CHANGE MANUALLY TO arduino:uno / arduino:nano / etc.
; (!) DEPENDING ON WHICH PLATFORM YOU INTEND TO USE
extends = arduino:uno
build_flags =
-D ${constants.prefix}EMBEDDED
; About Baud Rate - https://en.wikipedia.org/wiki/Serial_port#Settings
monitor_speed = 115200
monitor_echo = yes
monitor_filters =
send_on_enter
colorize
test_filter = test_embedded
[platform-type:native]
platform = native
build_flags =
-D ${constants.prefix}NATIVE
lib_deps = throwtheswitch/Unity
test_filter = test_native
; --------------- BUILD TYPE SECTIONS ---------------
[build-type:release]
build_type = release
build_flags =
-D ${constants.prefix}RELEASE
test_ignore = *
[build-type:debug]
build_type = debug
debug_build_flags =
-D ${constants.prefix}DEBUG
-Og
-g2
test_ignore = *
[build-type:test]
build_type = test
build_flags =
-D ${constants.prefix}TEST
; -------------- SPECIAL MODE SECTIONS --------------
[mode:verbose]
build_flags =
-D ${constants.prefix}VERBOSE
; ------------------ ENV SECTIONS -------------------
[env]
build_unflags = -std=gnu++11
; Options to Request or Suppress Warnings - https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
build_flags =
-std=gnu++17
; Do not warn when a switch statement has an index of enumerated type
; and lacks a case for one or more of the named codes of that enumeration.
; (The presence of a default label prevents this warning.)
; case labels outside the enumeration range also provoke warnings
; when this option is not used (even if there is a default label).
-Wno-switch
; Do not warn when the sizeof operator is applied to a parameter
; that is declared as an array in a function definition.
-Wno-sizeof-array-argument
[env:embedded-debug]
extends =
platform-type:embedded
build-type:debug
build_flags =
${env.build_flags}
${platform-type:embedded.build_flags}
debug_build_flags =
${build-type:debug.debug_build_flags}
-D AVR8_BREAKPOINT_MODE=1
; (!) CHANGE COM PORT MANUALLY TO THE ONE ARDUINO IS CONNECTED TO
debug_port = COM3
debug_tool = avr-stub
debug_extra_cmds = set debug remote 1
; avr-debug docs - https://github.com/jdolinay/avr_debug/blob/master/doc/avr_debug.pdf
lib_deps = jdolinay/avr-debugger
[env:embedded-release]
extends =
platform-type:embedded
build-type:release
build_flags =
${env.build_flags}
${platform-type:embedded.build_flags}
${build-type:release.build_flags}
[env:embedded-release-verbose]
extends = env:embedded-release
build_flags =
${env:embedded-release.build_flags}
${mode:verbose.build_flags}
[env:test-embedded]
extends =
platform-type:embedded
build-type:test
build_flags =
${env.build_flags}
${platform-type:embedded.build_flags}
${build-type:test.build_flags}
[env:test-native]
extends =
platform-type:native
build-type:test
build_flags =
${env.build_flags}
${platform-type:native.build_flags}
${build-type:test.build_flags}