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

Use platformio's extend feature #149

Merged
merged 4 commits into from
Mar 22, 2020
Merged

Conversation

TheAssassin
Copy link
Contributor

While working on Marlin, I found a new (well, new to me) feature in PlatformIO. Using extends saves duplicate code and helps maintain similar environments (e.g., the ones using the same platform, framework etc.). I've modified the PlatformIO configuration to use those. I also took the moment and improved the comments. (I hate any form of inline comments and lines which exceed my screen size...)

@probonopd
Copy link
Owner

45 to 66 lines, I find it more complicated than before...

@carl1961
Copy link

carl1961 commented Mar 8, 2020

using @TheAssassin platformio.ini i was able to compile probonopd on windows 10 using vscode with platformio installed. Awesome work @TheAssassin and @probonopd The probonopd has really progressed a lot lately

@probonopd
Copy link
Owner

The kudos for PlatformIO go to @TheAssassin really. 👍 I suspected that PlatformIO was better than what we had before but always was afraid of doing the work in the fear of breaking something.

@TheAssassin
Copy link
Contributor Author

TheAssassin commented Mar 8, 2020

45 to 66 lines, I find it more complicated than before...

Mainly because I extended the documentation. At least 6 lines have been added since I moved your inline comment into two separate lines and added new comments. Then there's more blank lines. Comparing the lines doesn't make that much sense, therefore.

The actual code is less duplicated than before and should avoid forgetting to change single board configurations while editing something in the others. Even if there's 3-4 more lines, it's still better code.

Also, adding new boards is a lot easier than before. In PlatformIO, there's a definition for most boards out there. Especially in the ESP32 world, there's sooo many boards now, with different flash methods, some via UART, some via other methods. With the STM32 it's similar, they ship a dedicated debug port, but there's a few UART bootloaders, too, all that can be configured on a per-board basis in platformio.ini.

By the way: the PR failed because transfer.sh timed out. It built just fine.

platformio.ini Show resolved Hide resolved
By using a custom prefix base:, we don't need to list the environments we *want* to build explicitly.
@TheAssassin
Copy link
Contributor Author

I also simplified the PR a bit, removing the need for the default_envs. Should be more satisfying now.

@probonopd
Copy link
Owner

Thanks @TheAssassin, ready for merge?

@TheAssassin
Copy link
Contributor Author

Yes.

@probonopd probonopd merged commit acaed49 into probonopd:master Mar 22, 2020
@probonopd
Copy link
Owner

Thank you @TheAssassin

@TheAssassin TheAssassin deleted the pio-extends branch March 30, 2020 00:05
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.

3 participants