-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Corrected board definitions to include ESP8266 #6972
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
Conversation
According to the sonoff_*.json board files from PlatformIO, the build flags are supposed to be ARDUINO_ESP8266_SONOFF_BASIC etc. However, pins_arduino.h expects them to be ARDUINO_SONOFF_BASIC etc, without ESP8266. This causes sketches that make use of i2c with Wire.h to fail, as the necessary pins do not get defined. I suspect that pins_arduino.h is incorrect and propose this correction. My apologies if this is not the correct way to fix the issue - it's difficult to wrap my head around how the different frameworks, IDEs, build tools etc interact :) Reference: https://github.com/platformio/platform-espressif8266/tree/develop/boards
It is a bit more complicated than that, since Arduino IDE uses a different build config through platform.txt and boards.txt ini-like files: Line 104 in fa5040d
-DARDUINO_{build.board} , which means that the IDE will use the variable provided by the menu entry / variable depending on the selected board type)
Resulting boards.txt is generated by this script: Having |
@ttytyper If you like, I can supply you with the |
@mcspr you are right, in this PR
to
(and similarly with other itead/sonoff models) |
@d-a-v actually, it looks like the recipe in platform.txt adds the
|
True, |
It looks like you have a much better idea of what needs to be done than I do :) Thanks for looking into it. @mhightower83 Feel free to make the necessary changes. This is all a bit beyond what I'm comfortable messing around with. |
…ard}`, as proposed by esp8266#6972 (comment). @ttytyper 's changes have been incorporate into this PR The build flag ARDUINO_SONOFF_... should now appear as ARDUINO_ESP8266_SONOFF_... @ttytyper, @mcspr, and @d-a-v thanks!
Superseded by #7024 |
According to the sonoff_*.json board files from PlatformIO, the build flags are supposed to be ARDUINO_ESP8266_SONOFF_BASIC etc. However, pins_arduino.h expects them to be ARDUINO_SONOFF_BASIC etc, without ESP8266. This causes sketches that make use of i2c with Wire.h to fail, as the necessary pins do not get defined.
I suspect that pins_arduino.h is incorrect and propose this correction. My apologies if this is not the correct way to fix the issue - it's difficult to wrap my head around how the different frameworks, IDEs, build tools etc interact :)
Reference: https://github.com/platformio/platform-espressif8266/tree/develop/boards