add code for feather esp32-s2 (both versions)
@@ -51,6 +51,17 @@ void enableInternalPower() {
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, HIGH);
#endif
+
+#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
+ // 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, !polarity);
+ pinMode(NEOPIXEL_POWER, OUTPUT);
+ digitalWrite(NEOPIXEL_POWER, HIGH);
+#endif
}
void disableInternalPower() {
@@ -58,4 +69,11 @@ void disableInternalPower() {
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, LOW);
#endif
+
+#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
+ // turn on the I2C power by setting pin to rest state (off)
+ pinMode(PIN_I2C_POWER, INPUT);
+ pinMode(NEOPIXEL_POWER, OUTPUT);
+ digitalWrite(NEOPIXEL_POWER, LOW);
+#endif
}
