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

[1.1.x] Fix PlatformIO dependencies #8452

Merged
merged 1 commit into from Nov 17, 2017

Conversation

tcm0116
Copy link
Contributor

@tcm0116 tcm0116 commented Nov 16, 2017

The PlatformIO configuration for 1.1.x was missing most of the library dependencies, so options such as the TMC2130 drivers wouldn't compile.

Additionally, there was a strange issue where PlatformIO was trying to compile the TMC2130 library using spi.h from within the Marlin code, even though the library was including SPI.h from the Arduino framework. I'm not really sure why the case sensitivity was an issue (especially on my Mac), but the easiest solution was to rename Marlin/spi.h to Marlin/MarlinSPI.h and fix the include in temperature.cpp.

One dependency that I didn't add is Arduino-L6470 as it doesn't even appear to compile correctly in the Arduino IDE due to stepper_indirection.cpp attempting to call L6470::init() with a parameter even though the function does not accept a parameter. I checked the history of the library, and it doesn't appear that the function ever accepted a parameter. I'm not sure how that ever worked.

@teemuatlut
Copy link
Member

I believe PIO doesn't differentiate between <header.h> and "header.h" and that's why it includes the spi.h from a project rather than from the core.

platformio.ini Outdated
lib_deps =
U8glib@1.19.1
https://github.com/lincomatic/LiquidTWI2.git
https://github.com/teemuatlut/TMC2130Stepper.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the library name and not git links. In the TMC SPI discussion it was discovered that PIO doesn't play nice with direct links.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach seemed to be working without issue and is the same as in bugfix-2.0.x. I'd suggest we change it there if we're going to change it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea the problem was with the LPC HAL and didn't link properly. It was fine for Teensy and AVR (possibly) so you wouldn't see a problem v1.1.x. It needs to be changed with v2.0 but I haven't bothered with it yet and it might just get included in some other PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LiquidTWI2 and TMC26XStepper libraries don't appear to be in the PlatformIO Library Manager, so I had to keep the git links for those. I was able to switch to using the library names for the others.

@tcm0116
Copy link
Contributor Author

tcm0116 commented Nov 16, 2017

I believe PIO doesn't differentiate between <header.h> and "header.h" and that's why it includes the spi.h from a project rather than from the core.

It turns out that the HFS+ file system on my Mac is actually case-insensitive and it appears that the AVR compiler used by PlatformIO doesn't distinguish between <> and "" in the #include declaration, causing Marlin's spi.h to be found before the Arduino Framework's SPI.h. You learn something new every day...

@thinkyhead
Copy link
Member

@tcm0116 I've also run into case-insensitivity issues in git / macOS / HFS+ when I rename something, only changing its case. One of those little annoyances. Fortunately, when you use the Unix command-line, everything works in a case-sensitive fashion.

@thinkyhead thinkyhead merged commit aa61212 into MarlinFirmware:bugfix-1.1.x Nov 17, 2017
@thinkyhead
Copy link
Member

Looks like the bugfix-2 branch could use similar love.

@tcm0116 tcm0116 deleted the 1.1.x-pio_deps branch December 31, 2017 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants