File tree 3 files changed +12
-12
lines changed
adafruit_feather_esp32_v2
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;
42
42
static const uint8_t A10 = 27 ;
43
43
static const uint8_t A11 = 12 ;
44
44
static const uint8_t A12 = 13 ;
45
+ static const uint8_t A13 = 35 ;
45
46
46
47
// vbat measure
47
- static const uint8_t BATT_MONITOR = 35 ;
48
- static const uint8_t A13 = 35 ;
48
+ #define BATT_MONITOR 35
49
49
50
50
// internal switch
51
- static const uint8_t BUTTON = 38 ;
51
+ #define BUTTON = 38;
52
52
53
53
// Neopixel
54
- static const uint8_t NEOPIXEL_PIN = 0 ;
55
- static const uint8_t PIN_NEOPIXEL = 0 ;
54
+ #define PIN_NEOPIXEL 0
56
55
57
56
// Neopixel & I2C power
58
- static const uint8_t NEOPIXEL_I2C_POWER = 2 ;
57
+ #define NEOPIXEL_I2C_POWER 2
59
58
60
59
static const uint8_t T0 = 4 ;
61
60
static const uint8_t T1 = 0 ;
Original file line number Diff line number Diff line change @@ -36,10 +36,11 @@ void initVariant(void)
36
36
pinMode (NEOPIXEL_POWER, OUTPUT);
37
37
digitalWrite (NEOPIXEL_POWER, HIGH);
38
38
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);
41
43
pinMode (PIN_I2C_POWER, OUTPUT);
42
- digitalWrite (PIN_I2C_POWER, LOW );
44
+ digitalWrite (PIN_I2C_POWER, !polarity );
43
45
}
44
-
45
46
}
Original file line number Diff line number Diff line change 11
11
#define digitalPinToInterrupt (p ) (((p)<NUM_DIGITAL_PINS)?(p):-1)
12
12
#define digitalPinHasPWM (p ) (p < EXTERNAL_NUM_INTERRUPTS)
13
13
14
- static const uint8_t SWITCH = 9 ;
15
- static const uint8_t NEOPIXEL_PIN = 2 ;
14
+ #define BUTTON 9
15
+ #define PIN_NEOPIXEL 2
16
16
17
17
static const uint8_t TX = 21 ;
18
18
static const uint8_t RX = 20 ;
You can’t perform that action at this time.
0 commit comments