bdurbrow / grbl-Mega

An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on an Arduino Mega2560
https://github.com/gnea/grbl/wiki
MIT License
35 stars 8 forks source link

add platformio.ini #12

Open thawkins opened 4 years ago

thawkins commented 4 years ago

Add support file for platformio, which allows building of the project without using the Arduino IDE

https://platformio.org

Adding support involves adding a single file which provides information about building and uploading.

to build the project:

$cd grbl-Mega
$platformio run

to build and upload $cd grbl-Mega $platformio run --target upload

Platform io reduces the upload size by only linking in those parts of the Arduino framework that are actually used in the project.

Adding this file has no impact on the project other than to allow it to be built without the arduino iDE

bdurbrow commented 4 years ago

I'm not going to accept the pull request; because I think I need to tweak one of the settings (upload_port); but I will snag the file; do the adjustment; and add the functionality. I'll also add the documentation on building it with platformio to the main readme file.

Thanks for contributing! 😄

thawkins commented 4 years ago

Quick note, apparently from version 4.0 onwards of platformio, if the upload port is not specified at all then the framework will attempt to auto detect it. If it cant it will prompt for it.

I will modify my end to remove that port declaration.

I will try and write some docs on installing and using platformio, i just installed vscode with the platformio IDE extension, and its crazy easy to use and is effectively equivalent to the arduino ide + git + a whole bunch of stuff around validating C/C++ code. and a proper project manager.