mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
LED_BUILTIN should be a #define (#4276)
* LED_BUILTIN should be a #define deduplicate and hide BUILTIN_LED as a deprecated constant * test for LED_BUILTIN existence * board:espino:variant: rename button macro (naming coherence)
This commit is contained in:
parent
b15102ad28
commit
4caf4878c7
64
boards.txt
64
boards.txt
@ -180,37 +180,37 @@ generic.menu.FlashSize.16M15M.build.spiffs_start=0x100000
|
||||
generic.menu.FlashSize.16M15M.build.spiffs_end=0xFFB000
|
||||
generic.menu.FlashSize.16M15M.build.spiffs_blocksize=8192
|
||||
generic.menu.led.2=2
|
||||
generic.menu.led.2.build.led=-DUSERLED=2
|
||||
generic.menu.led.2.build.led=-DLED_BUILTIN=2
|
||||
generic.menu.led.0=0
|
||||
generic.menu.led.0.build.led=-DUSERLED=0
|
||||
generic.menu.led.0.build.led=-DLED_BUILTIN=0
|
||||
generic.menu.led.1=1
|
||||
generic.menu.led.1.build.led=-DUSERLED=1
|
||||
generic.menu.led.1.build.led=-DLED_BUILTIN=1
|
||||
generic.menu.led.3=3
|
||||
generic.menu.led.3.build.led=-DUSERLED=3
|
||||
generic.menu.led.3.build.led=-DLED_BUILTIN=3
|
||||
generic.menu.led.4=4
|
||||
generic.menu.led.4.build.led=-DUSERLED=4
|
||||
generic.menu.led.4.build.led=-DLED_BUILTIN=4
|
||||
generic.menu.led.5=5
|
||||
generic.menu.led.5.build.led=-DUSERLED=5
|
||||
generic.menu.led.5.build.led=-DLED_BUILTIN=5
|
||||
generic.menu.led.6=6
|
||||
generic.menu.led.6.build.led=-DUSERLED=6
|
||||
generic.menu.led.6.build.led=-DLED_BUILTIN=6
|
||||
generic.menu.led.7=7
|
||||
generic.menu.led.7.build.led=-DUSERLED=7
|
||||
generic.menu.led.7.build.led=-DLED_BUILTIN=7
|
||||
generic.menu.led.8=8
|
||||
generic.menu.led.8.build.led=-DUSERLED=8
|
||||
generic.menu.led.8.build.led=-DLED_BUILTIN=8
|
||||
generic.menu.led.9=9
|
||||
generic.menu.led.9.build.led=-DUSERLED=9
|
||||
generic.menu.led.9.build.led=-DLED_BUILTIN=9
|
||||
generic.menu.led.10=10
|
||||
generic.menu.led.10.build.led=-DUSERLED=10
|
||||
generic.menu.led.10.build.led=-DLED_BUILTIN=10
|
||||
generic.menu.led.11=11
|
||||
generic.menu.led.11.build.led=-DUSERLED=11
|
||||
generic.menu.led.11.build.led=-DLED_BUILTIN=11
|
||||
generic.menu.led.12=12
|
||||
generic.menu.led.12.build.led=-DUSERLED=12
|
||||
generic.menu.led.12.build.led=-DLED_BUILTIN=12
|
||||
generic.menu.led.13=13
|
||||
generic.menu.led.13.build.led=-DUSERLED=13
|
||||
generic.menu.led.13.build.led=-DLED_BUILTIN=13
|
||||
generic.menu.led.14=14
|
||||
generic.menu.led.14.build.led=-DUSERLED=14
|
||||
generic.menu.led.14.build.led=-DLED_BUILTIN=14
|
||||
generic.menu.led.15=15
|
||||
generic.menu.led.15.build.led=-DUSERLED=15
|
||||
generic.menu.led.15.build.led=-DLED_BUILTIN=15
|
||||
generic.menu.LwIPVariant.v2mss536=v2 Lower Memory
|
||||
generic.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
|
||||
generic.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
|
||||
@ -394,37 +394,37 @@ esp8285.menu.FlashSize.1M512.build.spiffs_start=0x7B000
|
||||
esp8285.menu.FlashSize.1M512.build.spiffs_end=0xFB000
|
||||
esp8285.menu.FlashSize.1M512.build.spiffs_blocksize=8192
|
||||
esp8285.menu.led.2=2
|
||||
esp8285.menu.led.2.build.led=-DUSERLED=2
|
||||
esp8285.menu.led.2.build.led=-DLED_BUILTIN=2
|
||||
esp8285.menu.led.0=0
|
||||
esp8285.menu.led.0.build.led=-DUSERLED=0
|
||||
esp8285.menu.led.0.build.led=-DLED_BUILTIN=0
|
||||
esp8285.menu.led.1=1
|
||||
esp8285.menu.led.1.build.led=-DUSERLED=1
|
||||
esp8285.menu.led.1.build.led=-DLED_BUILTIN=1
|
||||
esp8285.menu.led.3=3
|
||||
esp8285.menu.led.3.build.led=-DUSERLED=3
|
||||
esp8285.menu.led.3.build.led=-DLED_BUILTIN=3
|
||||
esp8285.menu.led.4=4
|
||||
esp8285.menu.led.4.build.led=-DUSERLED=4
|
||||
esp8285.menu.led.4.build.led=-DLED_BUILTIN=4
|
||||
esp8285.menu.led.5=5
|
||||
esp8285.menu.led.5.build.led=-DUSERLED=5
|
||||
esp8285.menu.led.5.build.led=-DLED_BUILTIN=5
|
||||
esp8285.menu.led.6=6
|
||||
esp8285.menu.led.6.build.led=-DUSERLED=6
|
||||
esp8285.menu.led.6.build.led=-DLED_BUILTIN=6
|
||||
esp8285.menu.led.7=7
|
||||
esp8285.menu.led.7.build.led=-DUSERLED=7
|
||||
esp8285.menu.led.7.build.led=-DLED_BUILTIN=7
|
||||
esp8285.menu.led.8=8
|
||||
esp8285.menu.led.8.build.led=-DUSERLED=8
|
||||
esp8285.menu.led.8.build.led=-DLED_BUILTIN=8
|
||||
esp8285.menu.led.9=9
|
||||
esp8285.menu.led.9.build.led=-DUSERLED=9
|
||||
esp8285.menu.led.9.build.led=-DLED_BUILTIN=9
|
||||
esp8285.menu.led.10=10
|
||||
esp8285.menu.led.10.build.led=-DUSERLED=10
|
||||
esp8285.menu.led.10.build.led=-DLED_BUILTIN=10
|
||||
esp8285.menu.led.11=11
|
||||
esp8285.menu.led.11.build.led=-DUSERLED=11
|
||||
esp8285.menu.led.11.build.led=-DLED_BUILTIN=11
|
||||
esp8285.menu.led.12=12
|
||||
esp8285.menu.led.12.build.led=-DUSERLED=12
|
||||
esp8285.menu.led.12.build.led=-DLED_BUILTIN=12
|
||||
esp8285.menu.led.13=13
|
||||
esp8285.menu.led.13.build.led=-DUSERLED=13
|
||||
esp8285.menu.led.13.build.led=-DLED_BUILTIN=13
|
||||
esp8285.menu.led.14=14
|
||||
esp8285.menu.led.14.build.led=-DUSERLED=14
|
||||
esp8285.menu.led.14.build.led=-DLED_BUILTIN=14
|
||||
esp8285.menu.led.15=15
|
||||
esp8285.menu.led.15.build.led=-DUSERLED=15
|
||||
esp8285.menu.led.15.build.led=-DLED_BUILTIN=15
|
||||
esp8285.menu.LwIPVariant.v2mss536=v2 Lower Memory
|
||||
esp8285.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
|
||||
esp8285.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
|
||||
|
@ -1062,14 +1062,14 @@ def all_flash_size ():
|
||||
def led (default,max):
|
||||
led = collections.OrderedDict([
|
||||
('.menu.led.' + str(default), str(default)),
|
||||
('.menu.led.' + str(default) + '.build.led', '-DUSERLED=' + str(default)),
|
||||
('.menu.led.' + str(default) + '.build.led', '-DLED_BUILTIN=' + str(default)),
|
||||
]);
|
||||
for i in range(0,max):
|
||||
if not i == default:
|
||||
led.update(
|
||||
collections.OrderedDict([
|
||||
('.menu.led.' + str(i), str(i)),
|
||||
('.menu.led.' + str(i) + '.build.led', '-DUSERLED=' + str(i)),
|
||||
('.menu.led.' + str(i) + '.build.led', '-DLED_BUILTIN=' + str(i)),
|
||||
]))
|
||||
return { 'led': led }
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
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
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -34,7 +34,6 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 0;
|
||||
static const uint8_t BUILTIN_LED = 0;
|
||||
#define LED_BUILTIN 0
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
#include "../generic/common.h"
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
#define LED_BUILTIN 2
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
#include "../generic/common.h"
|
||||
|
||||
static const uint8_t LED_BUILTIN = 14;
|
||||
static const uint8_t BUILTIN_LED = 14;
|
||||
#define LED_BUILTIN 14
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -34,8 +34,7 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;//new ESP-12E GPIO2
|
||||
static const uint8_t BUILTIN_LED = 2;//new ESP-12E GPIO2
|
||||
#define LED_BUILTIN 2 //new ESP-12E GPIO2
|
||||
|
||||
static const uint8_t D0 = 3;
|
||||
static const uint8_t D1 = 1;
|
||||
|
@ -34,8 +34,7 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
#define LED_BUILTIN 2
|
||||
|
||||
static const uint8_t D0 = 16;
|
||||
static const uint8_t D1 = 5;
|
||||
|
@ -34,15 +34,11 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
#define LED_BUILTIN 2
|
||||
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 BUTTON_BUILTIN = 0;
|
||||
|
||||
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;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -34,7 +34,6 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t BUILTIN_LED = 16;
|
||||
static const uint8_t LED_BUILTIN = 16;
|
||||
#define LED_BUILTIN 16
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -36,7 +36,6 @@
|
||||
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
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -36,7 +36,6 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
#define LED_BUILTIN 2
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -71,4 +71,11 @@ static const uint8_t A0 = PIN_A0;
|
||||
#define SERIAL_PORT_HARDWARE Serial
|
||||
#define SERIAL_PORT_HARDWARE_OPEN Serial1
|
||||
|
||||
#ifdef LED_BUILTIN
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
const int BUILTIN_LED __attribute__((deprecated, weak)) = LED_BUILTIN;
|
||||
#endif
|
||||
|
||||
#endif /* GENERIC_COMMON_H */
|
||||
|
@ -34,10 +34,8 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
#ifndef USERLED
|
||||
#define USERLED 1
|
||||
#ifndef LED_BUILTIN
|
||||
#define LED_BUILTIN 1
|
||||
#endif
|
||||
static const uint8_t BUILTIN_LED = USERLED;
|
||||
static const uint8_t LED_BUILTIN = USERLED;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -34,8 +34,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
|
||||
|
||||
static const uint8_t D0 = 16;
|
||||
static const uint8_t D1 = 5;
|
||||
|
@ -52,8 +52,7 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t BUILTIN_LED = 5;
|
||||
static const uint8_t LED_BUILTIN = 5;
|
||||
#define LED_BUILTIN 5
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
||||
|
@ -36,7 +36,6 @@
|
||||
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
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -36,7 +36,6 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
#define LED_BUILTIN 2
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -34,7 +34,6 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 5;
|
||||
static const uint8_t BUILTIN_LED = 5;
|
||||
#define LED_BUILTIN 5
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -39,8 +39,7 @@
|
||||
static const uint8_t SDA = PIN_WIRE_SDA;
|
||||
static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 12;
|
||||
static const uint8_t BUILTIN_LED = 12;
|
||||
#define LED_BUILTIN 12
|
||||
|
||||
static const uint8_t D0 = 16;
|
||||
static const uint8_t D1 = 5;
|
||||
|
@ -77,8 +77,7 @@ static const uint8_t E14 = ESP_PINS_OFFSET + 14;
|
||||
static const uint8_t E15 = ESP_PINS_OFFSET + 15;
|
||||
static const uint8_t E16 = ESP_PINS_OFFSET + 16;
|
||||
|
||||
static const uint8_t LED_BUILTIN_LED = 2;
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
#define LED_BUILTIN 2
|
||||
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#define SERIAL_PORT_USBVIRTUAL Serial
|
||||
|
Loading…
x
Reference in New Issue
Block a user