Giter VIP home page Giter VIP logo

Comments (7)

ladyada avatar ladyada commented on July 21, 2024

@SpenceKonde may have advice, we've never used that core :)

from adafruit_busio.

e-tinkers avatar e-tinkers commented on July 21, 2024

@SpenceKonde may have advice, we've never used that core :)

I sorted of managed to make it work.

If I look at the source code of BusIO, it does seems to cover the megaTinyCore. As I said, this works well on Arduino IDE, but failed on PlatformIO.

If I change the line on the source code from defined(MEGATINYCORE) to defined(MEGATINYCORE_MCU) after seeing the Arduino.h definition used in megaTinyCore, the code compiled successfully for both PlatformIO and Arduino IDE now.

I think I will loop-in @ivankravets for his comment before deciding on how to fix this.

from adafruit_busio.

SpenceKonde avatar SpenceKonde commented on July 21, 2024

Yikes! Thanks for letting me know about this, Edit: NO I did not remove this! I'm not that big of a clunk - but I changed how that define was created, and the new method doesn't work, and I hadn't noticed.....

Edit again: No, no that's not the problem.... but clearly, it's not getting propagated such that the library can see it....

from adafruit_busio.

SpenceKonde avatar SpenceKonde commented on July 21, 2024

OHHH! It's PlatformIO, but not the Arduino IDE... (hadn't seen the start of the issue since came here from email)

Ugh, this is some inconsistency between how Arduino and Platform IO behave regarding defines that are passed from platform.txt through the command line...

I don't actually have platform IO set up (and have a list of higher priority items to work on a mile long), but I will put a band-aid for it into the next release - of course, it looks like it takes a while for releases to get propagated to PlatformIO :-(

My recommendation for fixing it until this gets to platformIO would be adding to the Arduino.h for megaTinyCore something like:

#ifndef MEGATINYCORE
#define MEGATINYCORE "2.1.5"
#endif

(since you know the version, and when upgraded it'll get overwritten. I on the other hand, know I will not managed to remember to update the version number (that's why I do all this wacky stuff with the version number defines! And I still manage to forget to update it in the single place that it needs to be set with surprisingly high frequency.

from adafruit_busio.

e-tinkers avatar e-tinkers commented on July 21, 2024

My recommendation for fixing it until this gets to platformIO would be adding to the Arduino.h for megaTinyCore something like:

#ifndef MEGATINYCORE
#define MEGATINYCORE "2.1.5"
#endif

Thanks for the recommendation @SpenceKonde. Now you mention the version, I realised that if you think it took a little time for PlatformIO to catch up the latest release, I'm surprise to see that the Arduino IDE is even behind, I noticed that the Arduino IDE is actually running version 2.0.5.

Using core 'arduino' from platform in folder: /Users/xxxx/Library/Arduino15/packages/megaTinyCore/hardware/megaavr/2.0.5

and I now know what exactly caused this compilation error, as I can see that MEGATINYCORE is defined near the end of the Arduino.h on v2.0.5:

#define MEGATINYCORE "2.0.5"

This has been removed in v2.1.5 which is used on PlatformIO.

I will follow your recommendation for now to keep my project going.

If I don't hear further comment from you, I will close this thread soon. Thanks for the help.

from adafruit_busio.

SpenceKonde avatar SpenceKonde commented on July 21, 2024

Well, on the Arduino IDE you can go to tools -> board -> boards manager and use that to update it to the latest version. 2.2.8.

Yeah - sometime in the 2.1.0-ish timeframe, I switched MEGATINYCORE from being a #define in Arduino.h to being a passed to the compiler as -DMEGATINYCORE=whatever hideous combination of backslashes and quotes it takes to get the define to make it through unscathed). That step was taken so that there could be a single source of truth regarding the version, previously it double or triple entry bookkeeping, and every source of a version number had a different number in it, and I think there was more than one release where none of them matched the actual version number it was released as..... I wonder if the stringify preprocessor directive could be used to do this more gracefully...

from adafruit_busio.

e-tinkers avatar e-tinkers commented on July 21, 2024

I switched MEGATINYCORE from being a #define in Arduino.h to being a passed to the compiler as -DMEGATINYCORE=whatever hideous combination of backslashes and quotes it takes to get the define to make it through unscathed).

Ah, thanks for the important piece of information, I add the custom build flags to the platformio.ini, and everything works perfectly now! My platformio.ini now looks like this:

[env:ATtiny3217]
platform = atmelmegaavr
board = ATtiny3217
framework = arduino
build_flags = -D MEGATINYCORE
lib_deps =
	adafruit/Adafruit SSD1306@^2.4.3
	adafruit/Adafruit MAX31856 library@^1.2.3
	br3ttb/PID@^1.2.1
	adafruit/Adafruit GFX Library@^1.10.6

Once again, thank you for your help.

from adafruit_busio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.