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

Add support for variants without custom cores (ie, EnviroDIY Stonefly using Adafruit core) #232

Open
SRGDamia1 opened this issue Aug 15, 2024 · 1 comment

Comments

@SRGDamia1
Copy link

I have the JSON and variant files working correctly on my local computer, but I want to make them available in the registry for all users. This board does not need a separate core; it uses the Adafruit core. It does need a variants file, though. I can submit a PR for the board .json file, but the build system only accepts variant files stored locally in the project directory or as part of a complete core hosted elsewhere.

if "build.variant" in board:
variants_dir = os.path.join(
"$PROJECT_DIR", board.get("build.variants_dir")) if board.get(
"build.variants_dir", "") else os.path.join(FRAMEWORK_DIR, "variants")
env.Append(
CPPPATH=[os.path.join(variants_dir, board.get("build.variant"))]
)
libs.append(env.BuildLibrary(
os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"),
os.path.join(variants_dir, board.get("build.variant"))
))

I want PlatformIO to automatically find and download the variants file for the user without me maintaining a copy of the Adafruit core.

If I'm not understanding and there's already a way to do this, please let me know!

@valeros
Copy link
Member

valeros commented Oct 9, 2024

Hi @SRGDamia1

Unfortunately, this repository is not the right place for custom boards that depend on third-party variant files outside of the supported Arduino cores. Although, it's possible to achieve what you described. I see here two options:

  • If your board uses an already available Arduino core (e.g. Adafruit), you can dynamically patch the framework package as described here. It's up to you how you get your variant files (for example you can download them from the Internet in the same extra script).
  • Alternatively, you can incorporate those custom variant files into your project and set the build.variants_dir option in your platformio.ini . The value in this option should point to a folder in your project that contains necessary variant files.

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

No branches or pull requests

2 participants