File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
adafruit_feather_esp32_v2 Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -42,20 +42,19 @@ static const uint8_t A9 = 33;
4242static const uint8_t A10 = 27 ;
4343static const uint8_t A11 = 12 ;
4444static const uint8_t A12 = 13 ;
45+ static const uint8_t A13 = 35 ;
4546
4647// vbat measure
47- static const uint8_t BATT_MONITOR = 35 ;
48- static const uint8_t A13 = 35 ;
48+ #define BATT_MONITOR 35
4949
5050// internal switch
51- static const uint8_t BUTTON = 38 ;
51+ #define BUTTON = 38;
5252
5353// Neopixel
54- static const uint8_t NEOPIXEL_PIN = 0 ;
55- static const uint8_t PIN_NEOPIXEL = 0 ;
54+ #define PIN_NEOPIXEL 0
5655
5756// Neopixel & I2C power
58- static const uint8_t NEOPIXEL_I2C_POWER = 2 ;
57+ #define NEOPIXEL_I2C_POWER 2
5958
6059static const uint8_t T0 = 4 ;
6160static const uint8_t T1 = 0 ;
Original file line number Diff line number Diff line change @@ -36,10 +36,11 @@ void initVariant(void)
3636 pinMode (NEOPIXEL_POWER, OUTPUT);
3737 digitalWrite (NEOPIXEL_POWER, HIGH);
3838
39- // This board has a power control pin, and we must set it to output and low
40- // in order to enable the I2C port.
39+ // turn on the I2C power by setting pin to opposite of 'rest state'
40+ pinMode (PIN_I2C_POWER, INPUT);
41+ delay (1 );
42+ bool polarity = digitalRead (PIN_I2C_POWER);
4143 pinMode (PIN_I2C_POWER, OUTPUT);
42- digitalWrite (PIN_I2C_POWER, LOW );
44+ digitalWrite (PIN_I2C_POWER, !polarity );
4345}
44-
4546}
Original file line number Diff line number Diff line change 1111#define digitalPinToInterrupt (p ) (((p)<NUM_DIGITAL_PINS)?(p):-1)
1212#define digitalPinHasPWM (p ) (p < EXTERNAL_NUM_INTERRUPTS)
1313
14- static const uint8_t SWITCH = 9 ;
15- static const uint8_t NEOPIXEL_PIN = 2 ;
14+ #define BUTTON 9
15+ #define PIN_NEOPIXEL 2
1616
1717static const uint8_t TX = 21 ;
1818static const uint8_t RX = 20 ;
You can’t perform that action at this time.
0 commit comments