From e62ecb3ef489e017bbf72e1a57dc0bcd56e5f1cf Mon Sep 17 00:00:00 2001 From: Martin Sloup Date: Tue, 7 Feb 2017 02:39:08 +0100 Subject: [PATCH] Added boards constants for LED_BUILTIN and KEY_BUILTIN (#177) * Added boards constants for LED_BUILTIN and KEY_BUILTIN Sources: * esp320: http://wiki.sweetpeas.se/index.php?title=ESP320#Developing_using_the_Arduino_IDE * esp32thing: https://cdn.sparkfun.com/assets/learn_tutorials/5/0/7/esp32-thing-schematic.pdf * espea32: https://github.com/AprilBrother/ESPea32/blob/master/hardware/ESPea32-schematic.pdf * hornbill32dev: https://github.com/ExploreEmbedded/Hornbill-ESP32-DEV/blob/master/Design%20Files/Schematic/Hornbill%20Devboard.pdf * lolin32: values from existing header * nano32: http://iot-bits.com/closer-look-esp32-nano32/ * node32s: https://github.com/lamloei/node32s-book/blob/master/ch01/node32s-schematic.pdf * Replace BUILTIN_LED constant with #define --- variants/esp320/pins_arduino.h | 6 ++++++ variants/esp32thing/pins_arduino.h | 5 +++++ variants/espea32/pins_arduino.h | 5 ++++- variants/hornbill32dev/pins_arduino.h | 7 ++++++- variants/lolin32/pins_arduino.h | 6 ++++-- variants/nano32/pins_arduino.h | 5 ++++- variants/node32s/pins_arduino.h | 5 +++++ 7 files changed, 34 insertions(+), 5 deletions(-) diff --git a/variants/esp320/pins_arduino.h b/variants/esp320/pins_arduino.h index 38839188..f69cc98b 100644 --- a/variants/esp320/pins_arduino.h +++ b/variants/esp320/pins_arduino.h @@ -9,6 +9,12 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) +static const uint8_t LED_BUILTIN = 5; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + +static const uint8_t TX = 1; +static const uint8_t RX = 3; + static const uint8_t SDA = 2; static const uint8_t SCL = 14; diff --git a/variants/esp32thing/pins_arduino.h b/variants/esp32thing/pins_arduino.h index 6485bc09..3da4bf2b 100644 --- a/variants/esp32thing/pins_arduino.h +++ b/variants/esp32thing/pins_arduino.h @@ -9,6 +9,11 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) +static const uint8_t LED_BUILTIN = 5; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + +static const uint8_t KEY_BUILTIN = 0; + static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/espea32/pins_arduino.h b/variants/espea32/pins_arduino.h index c87e1a23..8ce2507d 100644 --- a/variants/espea32/pins_arduino.h +++ b/variants/espea32/pins_arduino.h @@ -9,7 +9,10 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) -#define LED_BUILTIN 5 +static const uint8_t LED_BUILTIN = 5; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + +static const uint8_t KEY_BUILTIN = 0; static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/hornbill32dev/pins_arduino.h b/variants/hornbill32dev/pins_arduino.h index a76095fe..ef100575 100644 --- a/variants/hornbill32dev/pins_arduino.h +++ b/variants/hornbill32dev/pins_arduino.h @@ -9,7 +9,12 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) -static const uint8_t TX = 1; +static const uint8_t LED_BUILTIN = 13; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + +static const uint8_t KEY_BUILTIN = 0; + +static const uint8_t TX = 1; static const uint8_t RX = 3; static const uint8_t SDA = 21; diff --git a/variants/lolin32/pins_arduino.h b/variants/lolin32/pins_arduino.h index cde7c0b4..e341357b 100644 --- a/variants/lolin32/pins_arduino.h +++ b/variants/lolin32/pins_arduino.h @@ -9,8 +9,10 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) -#define LED_BUILTIN 2 -#define KEY_BUILTIN 0 +static const uint8_t LED_BUILTIN = 2; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + +static const uint8_t KEY_BUILTIN = 0; static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/nano32/pins_arduino.h b/variants/nano32/pins_arduino.h index 7a1cb982..e50bd30d 100644 --- a/variants/nano32/pins_arduino.h +++ b/variants/nano32/pins_arduino.h @@ -9,7 +9,10 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) -#define LED_BUILTIN 16 +static const uint8_t LED_BUILTIN = 16; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + +static const uint8_t BUILTIN_KEY = 0; static const uint8_t TX = 1; static const uint8_t RX = 3; diff --git a/variants/node32s/pins_arduino.h b/variants/node32s/pins_arduino.h index 85452d36..e341357b 100644 --- a/variants/node32s/pins_arduino.h +++ b/variants/node32s/pins_arduino.h @@ -9,6 +9,11 @@ #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinHasPWM(p) (p < 34) +static const uint8_t LED_BUILTIN = 2; +#define BUILTIN_LED LED_BUILTIN // backward compatibility + +static const uint8_t KEY_BUILTIN = 0; + static const uint8_t TX = 1; static const uint8_t RX = 3;