Skip to content

Commit 17136d7

Browse files
committed
Extend a project configuration example with the common "[env]" section
1 parent c07845a commit 17136d7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

projectconf/interpolation.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,16 @@ first item from pair ``<option> = value``.
6060

6161
.. code-block:: ini
6262
63-
; You MUST inject these options into [env:] section
64-
; using ${extra.***} (see below)
63+
; COMMON options
64+
; Each "[env:***]" extends this "[env]" by default
65+
[env]
66+
framework = arduino
67+
build_flags = -D VERSION=1.2.3
68+
69+
; CUSTOM options
70+
; You need manually inject these options into a section
71+
; using ${extra.<name_of_option>} (see below)
6572
[extra]
66-
build_flags = -D VERSION=1.2.3 -D DEBUG=1
6773
lib_deps_builtin =
6874
SPI
6975
Wire
@@ -72,18 +78,15 @@ first item from pair ``<option> = value``.
7278
7379
[env:uno]
7480
platform = atmelavr
75-
framework = arduino
7681
board = uno
77-
build_flags = ${extra.build_flags}
7882
lib_deps =
7983
${extra.lib_deps_builtin}
8084
${extra.lib_deps_external}
8185
8286
[env:nodemcuv2]
8387
platform = espressif8266
84-
framework = arduino
8588
board = nodemcuv2
86-
build_flags = ${extra.build_flags} -Wall
89+
build_flags = ${env.build_flags} -Wall
8790
lib_deps =
8891
${extra.lib_deps_builtin}
8992
${extra.lib_deps_external}
@@ -105,6 +108,7 @@ first item from pair ``<option> = value``.
105108
platform = espressif32
106109
board = esp32dev
107110
build_flags =
111+
${env.build_flags}
108112
-DWIFI_SSID=${sysenv.WIFI_SSID}
109113
-DWIFI_PASS=${sysenv.WIFI_PASS}
110114

0 commit comments

Comments
 (0)