From a83fa1c9e30f023b013a919ffcc0548c123bf8f3 Mon Sep 17 00:00:00 2001 From: ttytyper Date: Wed, 1 Jan 2020 19:26:43 +0100 Subject: [PATCH] Corrected board definitions to include ESP8266 According to the sonoff_*.json board files from PlatformIO, the build flags are supposed to be ARDUINO_ESP8266_SONOFF_BASIC etc. However, pins_arduino.h expects them to be ARDUINO_SONOFF_BASIC etc, without ESP8266. This causes sketches that make use of i2c with Wire.h to fail, as the necessary pins do not get defined. I suspect that pins_arduino.h is incorrect and propose this correction. My apologies if this is not the correct way to fix the issue - it's difficult to wrap my head around how the different frameworks, IDEs, build tools etc interact :) Reference: https://github.com/platformio/platform-espressif8266/tree/develop/boards --- variants/itead/pins_arduino.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/variants/itead/pins_arduino.h b/variants/itead/pins_arduino.h index ad54a0b815..d58c17a6bb 100644 --- a/variants/itead/pins_arduino.h +++ b/variants/itead/pins_arduino.h @@ -26,17 +26,17 @@ #ifndef Pins_Arduino_h #define Pins_Arduino_h -#if defined(ARDUINO_SONOFF_SV) +#if defined(ARDUINO_ESP8266_SONOFF_SV) #define PIN_WIRE_SCL (5) static const uint8_t SCL = PIN_WIRE_SCL; #endif -#if defined(ARDUINO_SONOFF_TH) || defined(ARDUINO_SONOFF_BASIC) +#if defined(ARDUINO_ESP8266_SONOFF_TH) || defined(ARDUINO_ESP8266_SONOFF_BASIC) #define PIN_WIRE_SCL (14) static const uint8_t SCL = PIN_WIRE_SCL; #endif -#if defined(ARDUINO_SONOFF_TH) || defined(ARDUINO_SONOFF_SV) +#if defined(ARDUINO_ESP8266_SONOFF_TH) || defined(ARDUINO_ESP8266_SONOFF_SV) #define PIN_WIRE_SDA (4) static const uint8_t SDA = PIN_WIRE_SDA; #endif