-
Notifications
You must be signed in to change notification settings - Fork 13.3k
LED_BUILTIN should be a #define #4276
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
Conversation
@@ -33,7 +33,7 @@ | |||
static const uint8_t SDA = PIN_WIRE_SDA; | |||
static const uint8_t SCL = PIN_WIRE_SCL; | |||
|
|||
static const uint8_t LED_BUILTIN = 16; | |||
static const uint8_t BUILTIN_LED = 16; | |||
#define LED_BUILTIN 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could a compiler #define such as "-DBUILTIN_LED=LED_BUILTIN" and remove the need for all these repeated 2nd #define BUILTIN_LED X?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUILTIN_LED is not used in core, but seems to be historically used in esp8266 code outside.
What about moving this define into variants/generic/common.h
(hidden, wrong name less exposed, less loaded gcc cmdline) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not standard, how about putting it somewhere safe and deprecating its use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
variants/espino/pins_arduino.h
Outdated
static const uint8_t LED_BUILTIN_R = 2; | ||
static const uint8_t LED_BUILTIN_G = 4; | ||
static const uint8_t LED_BUILTIN_B = 5; | ||
|
||
static const uint8_t BUILTIN_LED = 2; | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
variants/espino/pins_arduino.h
Outdated
static const uint8_t LED_BUILTIN_R = 2; | ||
static const uint8_t LED_BUILTIN_G = 4; | ||
static const uint8_t LED_BUILTIN_B = 5; | ||
|
||
static const uint8_t BUILTIN_LED = 2; | ||
/* | ||
static const uint8_t BUILTIN_LEDR = 2; | ||
static const uint8_t BUILTIN_LEDG = 4; | ||
static const uint8_t BUILTIN_LEDB = 5; | ||
static const uint8_t BUILTIN_BUTTON = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe there should be a BUTTON_BUILTIN?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. BUTTON_BUILTIN added, commented BUILTIN_* removed.
deduplicate and hide BUILTIN_LED as a deprecated constant
Arduino only defines LED_BUILTIN, should BUILTIN_LED be removed ?