Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ttytyper wants to merge2 commits intoesp8266:masterfromttytyper:patch-1
Closed

Corrected board definitions to include ESP8266#6972

ttytyper wants to merge2 commits intoesp8266:masterfromttytyper:patch-1

Conversation

@ttytyper
Copy link

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

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

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:

recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
(note the-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:
/tools/boards.txt.py#L866 (part with sonoff boards)
So you'd need to change it too and regenerate boards.txt so that IDE uses correct definitions

Having_ESP8266_ seems like a correct way to name boards, but not sure what are implications for backwards compatibility are.

@mhightower83
Copy link
Contributor

@ttytyper If you like, I can supply you with theboards.txt.py changes for your PR or I can create a PR and include your changes?

@d-a-v
Copy link
Collaborator

@mcspr you are right, in this PRboard.txt.py needs this change:

            '.menu.BoardModel.sonoffSV.build.board': 'SONOFF_SV',

to

            '.menu.BoardModel.sonoffSV.build.board': 'ARDUINO_SONOFF_SV',

(and similarly with other itead/sonoff models)
@mhightower83 you are the initial author for the itead board update, would you agree with this changes ?
@ttytyper would you be able to update your PR with these changes ? Or leave@mhightower83 do it as proposed ?

@mhightower83
Copy link
Contributor

@d-a-v actually, it looks like the recipe in platform.txt adds theARDUINO_ part, we need to add theESP8266_ toSONOFF_SV to complete the correction, etc.

'.menu.BoardModel.sonoffSV.build.board': 'ESP8266_SONOFF_SV',
## Compile c++ filesrecipe.cpp.o.pattern=... -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" ...

@d-a-v
Copy link
Collaborator

True,ESP8266_ notARDUINO_

@ttytyper
Copy link
Author

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.

mhightower83 added a commit to mhightower83/Arduino that referenced this pull requestJan 19, 2020
…ard}`,as proposed byesp8266#6972 (comment).@ttytyper 's changes have been incorporate into this PRThe build flag ARDUINO_SONOFF_... should now appear as ARDUINO_ESP8266_SONOFF_...@ttytyper,@mcspr, and@d-a-v thanks!
earlephilhower pushed a commit that referenced this pull requestJan 27, 2020
…ard}`, (#7024)as proposed by#6972 (comment).@ttytyper 's changes have been incorporate into this PRThe build flag ARDUINO_SONOFF_... should now appear as ARDUINO_ESP8266_SONOFF_...@ttytyper,@mcspr, and@d-a-v thanks!
@earlephilhower
Copy link
Collaborator

Superseded by#7024

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@ttytyper@mcspr@mhightower83@d-a-v@earlephilhower

[8]ページ先頭

©2009-2025 Movatter.jp