Comments (4)
You can't override pre-defined macros in the sketch, and expect the compiler to pick it up and re-compile the libraries.
This means that the only viable way to override the LED_BUILTIN macro would either to add -DLED_BUILTIN=13
as a compiler build flag (difficult with Arduino IDE, possible with PlatformIO), or modify the source code in the MCUdude_corefiles
folder. I'm happy to add your suggestion to the code base (only defined LED_BUILTIN if not already defined), but it won't solve your issue. The compiler would still not pick this up as long as the macro is overridden in the sketch.
from megacore.
LED_BUILTIN
is just a constant, and isn't "tied" to a specific pin at all. You don't have to use the constant if you don't want to. However, you should be able to deal with it in your code like so:
#ifdef LED_BUILTIN
#undef LED_BUILTIN
#define LED_BUILTIN PIN_PG3
#endif
from megacore.
@MCUdude
Some libraries and example code use LED_BUILTIN to show simple notifications, I have to directly change the source code if i can't use build flag. Or I must place #undef LED_BUILTIN
before including the library.
from megacore.
Thanks for that, and of course I'm using PlatformIO. I realized that #undef
can't affect library code just after I sent the comment. No problem about it.
from megacore.
Related Issues (20)
- error while burning bootloader HOT 3
- Arduino IDE can't access AVR ISP mk2 HOT 14
- ATmega 128 I2C doesn't work HOT 2
- Incorrect clock timing HOT 1
- How to wake up from sleep using WDT reset? (atmega64) HOT 3
- arduino framework does'nt work on ATmega128 HOT 2
- Trouble uploading sketch to Arduino Mega2560 after burning bootloader HOT 1
- unable to burn bootloader for mega2560 HOT 40
- stk500v2 bootloader potential issues HOT 4
- To adopt urboot for MegaCore HOT 2
- Is it possible to program with FT232 programming? Is there a schematic drawing available? HOT 5
- Arduino Mega OTEthernet not working HOT 6
- generation of the file .hex HOT 11
- cannot be compiled when using the Wire library HOT 5
- Cannot upload sketch to mega without bootloader using arduinoISP HOT 5
- Original Mega 2560 bootloader HOT 4
- Doesn't work on arduino mega 2560 (clone) HOT 2
- ArduinoOTA problems on Mega2560 using Megacore >= 3 HOT 2
- Erase bootloader
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 megacore.