From c51e5bcc6366f02e37f7977e8d6277cd9ae4e696 Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 1 Mar 2022 17:07:58 -0500 Subject: [PATCH 1/2] make work with rev C pcb --- variants/adafruit_feather_esp32s2/variant.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/variants/adafruit_feather_esp32s2/variant.cpp b/variants/adafruit_feather_esp32s2/variant.cpp index 97e26fb9c60..069f735161d 100644 --- a/variants/adafruit_feather_esp32s2/variant.cpp +++ b/variants/adafruit_feather_esp32s2/variant.cpp @@ -36,10 +36,11 @@ void initVariant(void) pinMode(NEOPIXEL_POWER, OUTPUT); digitalWrite(NEOPIXEL_POWER, HIGH); - // This board has a power control pin, and we must set it to output and low - // in order to enable the I2C port. + // turn on the I2C power by setting pin to opposite of 'rest state' + pinMode(PIN_I2C_POWER, INPUT); + delay(1); + bool polarity = digitalRead(PIN_I2C_POWER); pinMode(PIN_I2C_POWER, OUTPUT); - digitalWrite(PIN_I2C_POWER, LOW); + digitalWrite(PIN_I2C_POWER, !polarity); } - } From 19459de883fa02f91c62ee3931483928239bafb6 Mon Sep 17 00:00:00 2001 From: lady ada Date: Wed, 9 Mar 2022 15:37:53 -0500 Subject: [PATCH 2/2] use #define for easy testing --- variants/adafruit_feather_esp32_v2/pins_arduino.h | 11 +++++------ variants/adafruit_qtpy_esp32c3/pins_arduino.h | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/variants/adafruit_feather_esp32_v2/pins_arduino.h b/variants/adafruit_feather_esp32_v2/pins_arduino.h index f984baf5aa2..97a09dba233 100644 --- a/variants/adafruit_feather_esp32_v2/pins_arduino.h +++ b/variants/adafruit_feather_esp32_v2/pins_arduino.h @@ -42,20 +42,19 @@ static const uint8_t A9 = 33; static const uint8_t A10 = 27; static const uint8_t A11 = 12; static const uint8_t A12 = 13; +static const uint8_t A13 = 35; // vbat measure -static const uint8_t BATT_MONITOR = 35; -static const uint8_t A13 = 35; +#define BATT_MONITOR 35 // internal switch -static const uint8_t BUTTON = 38; +#define BUTTON = 38; // Neopixel -static const uint8_t NEOPIXEL_PIN = 0; -static const uint8_t PIN_NEOPIXEL = 0; +#define PIN_NEOPIXEL 0 // Neopixel & I2C power -static const uint8_t NEOPIXEL_I2C_POWER = 2; +#define NEOPIXEL_I2C_POWER 2 static const uint8_t T0 = 4; static const uint8_t T1 = 0; diff --git a/variants/adafruit_qtpy_esp32c3/pins_arduino.h b/variants/adafruit_qtpy_esp32c3/pins_arduino.h index c0f1aefc8ce..6c93bfd5820 100644 --- a/variants/adafruit_qtpy_esp32c3/pins_arduino.h +++ b/variants/adafruit_qtpy_esp32c3/pins_arduino.h @@ -11,8 +11,8 @@ #define digitalPinToInterrupt(p) (((p)