From d3c7d0c8b88c9ddbbaedc4d2cc21dd678e207ed4 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Sat, 17 Jan 2015 02:51:58 +0300 Subject: [PATCH] Define esp pins E0..E16 for both board variants --- .../esp8266/variants/esp01/pins_arduino.h | 18 ++++++++++++++++-- .../esp8266/variants/wifio/pins_arduino.h | 13 +++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/hardware/arduino/esp8266/variants/esp01/pins_arduino.h b/hardware/arduino/esp8266/variants/esp01/pins_arduino.h index 5b36c0010..ab5d6e9a0 100644 --- a/hardware/arduino/esp8266/variants/esp01/pins_arduino.h +++ b/hardware/arduino/esp8266/variants/esp01/pins_arduino.h @@ -28,6 +28,7 @@ #define NUM_DIGITAL_PINS 16 #define NUM_ANALOG_INPUTS 1 +#define ESP_PINS_OFFSET 0 static const uint8_t SDA = 0; static const uint8_t SCL = 2; @@ -41,6 +42,19 @@ static const uint8_t BUILTIN_LED = 1; static const uint8_t A0 = 0; +static const uint8_t E0 = ESP_PINS_OFFSET + 0; +static const uint8_t E1 = ESP_PINS_OFFSET + 1; +static const uint8_t E2 = ESP_PINS_OFFSET + 2; +static const uint8_t E3 = ESP_PINS_OFFSET + 3; +static const uint8_t E4 = ESP_PINS_OFFSET + 4; +static const uint8_t E5 = ESP_PINS_OFFSET + 5; +static const uint8_t E11 = ESP_PINS_OFFSET + 11; +static const uint8_t E12 = ESP_PINS_OFFSET + 12; +static const uint8_t E13 = ESP_PINS_OFFSET + 13; +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; + // These serial port names are intended to allow libraries and architecture-neutral // sketches to automatically default to the correct port name for a particular type // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, @@ -58,7 +72,7 @@ static const uint8_t A0 = 0; // pins are NOT connected to anything by default. #define SERIAL_PORT_MONITOR Serial #define SERIAL_PORT_USBVIRTUAL Serial -#define SERIAL_PORT_HARDWARE Serial1 -#define SERIAL_PORT_HARDWARE_OPEN Serial1 +#define SERIAL_PORT_HARDWARE Serial +#define SERIAL_PORT_HARDWARE_OPEN Serial #endif /* Pins_Arduino_h */ diff --git a/hardware/arduino/esp8266/variants/wifio/pins_arduino.h b/hardware/arduino/esp8266/variants/wifio/pins_arduino.h index 1217c7de2..c2a2f986d 100644 --- a/hardware/arduino/esp8266/variants/wifio/pins_arduino.h +++ b/hardware/arduino/esp8266/variants/wifio/pins_arduino.h @@ -47,6 +47,19 @@ static const uint8_t A5 = 19; static const uint8_t A6 = 20; static const uint8_t A7 = 21; +static const uint8_t E0 = ESP_PINS_OFFSET + 0; +static const uint8_t E1 = ESP_PINS_OFFSET + 1; +static const uint8_t E2 = ESP_PINS_OFFSET + 2; +static const uint8_t E3 = ESP_PINS_OFFSET + 3; +static const uint8_t E4 = ESP_PINS_OFFSET + 4; +static const uint8_t E5 = ESP_PINS_OFFSET + 5; +static const uint8_t E11 = ESP_PINS_OFFSET + 11; +static const uint8_t E12 = ESP_PINS_OFFSET + 12; +static const uint8_t E13 = ESP_PINS_OFFSET + 13; +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 BUILTIN_LED = 2; #define SERIAL_PORT_MONITOR Serial