Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic variables/templates for use in platformio.ini #705

Closed
sticilface opened this issue Jun 24, 2016 · 8 comments
Closed

Dynamic variables/templates for use in platformio.ini #705

sticilface opened this issue Jun 24, 2016 · 8 comments
Assignees
Labels
Milestone

Comments

@sticilface
Copy link
Contributor

sticilface commented Jun 24, 2016

I'd like to define some variables that are constant between about 6 [env]. is this possible...

something like

[platformio]
src_dir = ./MyMelvanimate ; keeps arduino happy :)
data_dir = ./MyMelvanimate/data
env_default = esp12e-debug
test_var='-lstdc++ -Wl,-Tesp8266.flash.4m.ld -lc -I"/Users/amelvin/Arduino/esp8266/tools/sdk/libc/xtensa-lx106-elf/include" -L"/Users/amelvin/Arduino/esp8266/tools/sdk/libc/xtensa-lx106-elf/lib"'

then later

[env:debug]
platform = espressif
framework = arduino
board = esp12e
;build_flags = -lstdc++ -Wl,-Tesp8266.flash.4m.ld -lc -I"/Users/amelvin/Arduino/esp8266/tools/sdk/libc/xtensa-lx106-elf/include" -L"/Users/amelvin/Arduino/esp8266/tools/sdk/libc/xtensa-lx106-elf/lib" ;   -DDebug_ESPManager -DDEBUG_ESP_PORT=Serial -DDebugUDP ; -DDebugMelvanimate ;-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
build_flags = $test_var; -lstdc++ -Wl,-Tesp8266.flash.4m.ld
board_flash_mode = qio
board_f_cpu = 160000000L
board_f_flash = 80000000L
lib_install = 13, 547, 89 ; 64 = arduinojson
upload_port = 192.168.1.70 ; nodemcu
@ivankravets ivankravets reopened this Jun 24, 2016
@ivankravets ivankravets self-assigned this Jun 24, 2016
@ivankravets ivankravets added this to the 3.0.0 milestone Jun 24, 2016
@sticilface
Copy link
Contributor Author

thats great cheers. Was a question so moved it to the forum.

@ivankravets
Copy link
Member

Why did you close this issue? That is a great feature for PaltformIO 3.0. I had the same idea 👍

Now, it should be 100% implemented.

@ivankravets
Copy link
Member

ivankravets commented Jun 24, 2016

I propose a next format of dynamic variables:

[common]
build_flags = -DHELLO -Icustom/inc

[env:uno_debug]
build_flags = -DDEBUG ${common.build_flags}

[env:uno_release]
build_flags = -DRELEASE ${common.build_flags}

@ivankravets ivankravets changed the title Is it possible to use variables in platformio.ini? Dynamic variables/templates for use in platformio.ini Jun 24, 2016
@ivankravets ivankravets mentioned this issue Jun 24, 2016
37 tasks
@sticilface
Copy link
Contributor Author

This looks great:)

@itsjustvenky
Copy link

Yes.. this is really a nice idea.a great feature indeed

@ivankravets ivankravets modified the milestones: 3.0.0, 3.0 Aug 30, 2016
@ivankravets ivankravets modified the milestones: 3.0, 3.1.0, 3.2.0 Sep 10, 2016
@ivankravets
Copy link
Member

@raymusmunt
Copy link

Works great @ivankravets

@ivankravets
Copy link
Member

@raymusmunt please give us a 🌟 https://github.com/platformio/platformio/stargazers 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants