Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add platformio compatibility #336

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

CSC-Sendance
Copy link
Contributor

This adds platformio compatibility, when this library is pulled as a gitsubmodule (e.g. in adafruit's nrf52 framework). More infos here: https://docs.platformio.org/en/latest/manifests/library-json/index.html

Related to my efforts of adding "real" platformio compatibility to Adafruit's nrf52 framework, see also adafruit/Adafruit_nRFCrypto#6 .

Hoping for your feedback!

This adds platformio compatibility, when this library is pulled as a gitsubmodule (e.g. in adafruit's nrf52 framework).
Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

I am not familliar, but do we also need to add USE_TINYUSB in this json as well ?

@CSC-Sendance
Copy link
Contributor Author

I am familliar, but do we also need to add USE_TINYUSB in this json as well ?

Hi - I checked for my favorite example, the nordicnrf52 platform:

If one's using the nordicnrf52 platform via

[env]
platform = nordicnrf52

in platformio, it checks for the TinyUSB library and adds the USE_TINYUSB flag automatically: https://github.com/platformio/builder-framework-arduino-nrf5/blob/6c8589b1058991cd26846690b3ea90b645d2fa18/adafruit.py#L225 ... so I guess it wouldn't be needed for that, strictly.

It would be possible to indicate compatible platforms too. I also checked for esp32, there it's not listed (because, I guess, it's rather optional to use becasue alternatives exist?).

Anyhow, we can just add the USE_TINYUSB flag for good measure in the flags section, since it shouldn't break anything anyway. I will test it for the nrf52840, to make sure.

P.S.: I have added a discussion to the nrf52 "framework" suggesting the platformio support, what is required and how to setup a testing environment: adafruit/Adafruit_nRF52_Arduino#793 . This also uses the most recent TinyUSB repo commit as git submodule, rather than a really old one, as the original does - with success after some minor namespace issue fixes.

@CSC-Sendance
Copy link
Contributor Author

I tested it (02f1321) and haven't run into any issues building and also using (Serial). Tested with CSC-Sendance/Adafruit_nRF52_Arduino@49153b1

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

look good, thank you

@hathach hathach merged commit 5c650e8 into adafruit:master Oct 3, 2023
@CSC-Sendance CSC-Sendance deleted the fix/platformio-compat branch October 6, 2023 08:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants