-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Please make LED_BUILTIN a macro [imported] #758
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
Comments
Fixed. |
Doesn't this actually apply to all other pin definitions in arduino_pins.h (MISO, MOSI, SDA, A0, A1, etc.) as well? It doesn't matter much now, but it's possible that in the future a board without I²C, SPI or ADC is released. Making these constants macros allows checking for them with |
This allows using them in #if. See also arduino/Arduino#758
I agree with @matthijskooijman. They should also be macros instead. |
…ave a built-in LED. Fixes arduino#758
static const uint8_t LED_BUILTIN = 13; is not declared in the \variants\leonardo\pins_arduino.h for the Leonardo in IDE 1.0.5 |
Changing the const int to #include have a subtle side effect, for example the following code: declare parameters name as "MISO", but since we #define MISO to something else, the code is screwed up, an produce errors like the following:
The same doesn't happen with the const int declaration (since the local name "hides" the global one). Any idea? |
This is Issue 758 moved from a Google Code project.
Added by 2011-12-22T05:25:10.000Z by c...@zygomorphic.com.
Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Enhancement, Priority-Medium
Original description
Please change LED_BUILTIN from a typed constant to a macro to better support boards that do not have a built-in LED.
The text was updated successfully, but these errors were encountered: