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

Miscellaneous cleanup of platformio.ini #29

Closed
wants to merge 4 commits into from

Conversation

dhebbeker
Copy link
Member

@dhebbeker dhebbeker commented May 13, 2023

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.

@dhebbeker dhebbeker force-pushed the feature/miscellaneous-cleanup branch 3 times, most recently from 188819a to 2e9aa42 Compare May 16, 2023 18:39
dhebbeker added 4 commits May 19, 2023 18:49
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
@dhebbeker dhebbeker force-pushed the feature/miscellaneous-cleanup branch from 2e9aa42 to a79f23c Compare May 19, 2023 16:50
@dhebbeker dhebbeker changed the title miscellaneous cleanup Miscellaneous cleanup of platformio.ini May 19, 2023
@dhebbeker dhebbeker requested a review from FiveTeethless May 19, 2023 17:15
@dhebbeker dhebbeker marked this pull request as ready for review May 19, 2023 17:15

;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
Copy link
Collaborator

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
Copy link
Collaborator

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/>
Copy link
Collaborator

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 =
Copy link
Collaborator

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]
Copy link
Collaborator

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.

Copy link
Member Author

@dhebbeker dhebbeker left a 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

@dhebbeker
Copy link
Member Author

We have agreed, that most changes shall not be applied.

I will rebase the remaining useful changes and create a new pull request.

@dhebbeker dhebbeker closed this May 27, 2023
@dhebbeker dhebbeker deleted the feature/miscellaneous-cleanup branch May 27, 2023 20:41
dhebbeker added a commit that referenced this pull request May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants