-
Notifications
You must be signed in to change notification settings - Fork 0
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
Miscellaneous cleanup of platformio.ini
#29
Conversation
188819a
to
2e9aa42
Compare
Used the PIO IDE to configure project: Added project description. Using the wizard did cleanup the file.
See [comment][1]. Do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also [here][2]. To decode backtraces from the Wokwi serial monitor, one can use [this python script][3]. [1]: platformio/platform-espressif32#105 (comment) [2]: https://docs.platformio.org/en/latest/projectconf/build_configurations.html#build-configurations [3]: https://github.com/me21/EspArduinoExceptionDecoder
2e9aa42
to
a79f23c
Compare
platformio.ini
|
||
;Path to source files relative to PIO project | ||
; see https://docs.platformio.org/en/stable/projectconf/sections/platformio/options/directory/src_dir.html | ||
src_dir = src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can leave this out
|
||
;switch "include" path to be src as well, as we decide to have headers and sources in same directories | ||
; this prevents the build environment from complaining the path not existing | ||
include_dir = src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe check this, if it was necessary to stop PlatformIO from complaining, about missing "include" directory.
[env] | ||
;filter for source file directory when building | ||
; see https://docs.platformio.org/en/stable/projectconf/sections/env/options/build/build_src_filter.html | ||
build_src_filter = +<*> -<.git/> -<.svn/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can leave this out
|
||
;general dependencies | ||
; for version requirements see https://docs.platformio.org/en/stable/core/userguide/pkg/cmd_install.html#cmd-pkg-install-requirements | ||
lib_deps = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shoul be left here for other platforms
[env:esp32-s3-devkitc-1] | ||
platform = espressif32 | ||
board = esp32-s3-devkitc-1 | ||
framework = arduino | ||
;;add dependencies to general dependencies from [env] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an example of how the config of [env] can be expanded. If "${env.lib_deps}" was not used, the parameter would be overwritten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo:
- lib_deps to [env]
- check if include_dir is necessary
- leave comments
We have agreed, that most changes shall not be applied.
I will rebase the remaining useful changes and create a new pull request. |
… project. Because we want to retain useful comments (see #29 (review) and platformio/platformio-core#3862).
Using the GUI
I used PlatformIO Home to modify the project configuration. It removed most of the comments in
platformio.ini
and added some. Instead of reverting these - admittedly unnecessary - changes, I suggest to accept those. This way PlatformIO Home can be used in future without the need to revert the changes to comments every time.Remove unnecessary entries
I took advantage of the situation and removed configuration statements which were set to default values or did not have any effect. This reduces the size of the file and - hopefully - the maintenance effort.
Add filter for debugging
For debugging runtime exceptions reading the backtrace can be helpful. In order to understand the backtrace which is written by the framework to the serial port, a backtrace decoder can be used. I added a filter to the ESP32 environment which handles this.
For this to work, do not forget to build in debug-mode. For example in PlatformIO IDE, select as project task 'Advanced' → 'Pre-Debug'. See also here. Also this only works as long as the serial output is read by PlatformIO.
To decode backtraces from the Wokwi serial monitor, one can use this python script.