Comments (7)
@SpenceKonde may have advice, we've never used that core :)
from adafruit_busio.
@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.
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.
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.
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.
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.
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)
- Warning at Arduino Every Board HOT 2
- -O2 breaks this lib on atmel M0 HOT 14
- i2cProcQueue >> IntegerDivideByZero HOT 2
- proposal for robustness for I2C setSpeed() HOT 1
- Build warning: `[-Werror=unused-but-set-variable]` HOT 1
- Pointer to hardware SPI not correctly initialized if hardware is available but software SPI is used HOT 3
- If NO_GLOBAL_INSTANCES or NO_GLOBAL_SERIAL is defined, not able to find Serial in Adafruit_BusIO_Register.h HOT 6
- Design intent question: Why malloc? HOT 1
- When building in Platform.io for ESP32, there are type casting issues HOT 1
- Library doesn't work for ESP32 or ESP8266 on PlatformIO HOT 2
- Pico + PN532 + BusIo reading NTAGs
- Version 1.13.2 missing from platformio registry. HOT 3
- BusIO library won't build unless a serial device is configured HOT 4
- DEBUG_SERIAL decimal address printed as hex HOT 1
- Refactor to better separate HW and SW SPI HOT 1
- Adafruit BusIO v1.11.1 breaks begin_SPI() on SAMD51 with BMP388 HOT 5
- pass in an initialised wire instance? HOT 2
- Release 1.11.3 doesn't compile with Arduino 1.8.13 HOT 2
- repository description HOT 1
- issue with compiling the program to ESP8266 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_busio.