mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 20:40:59 +02:00
Some board variant fixes (#6411)
* make work with rev C pcb * use #define for easy testing
This commit is contained in:
committed by
GitHub
parent
e87b87d04c
commit
ba8024c0d2
@ -42,20 +42,19 @@ static const uint8_t A9 = 33;
|
|||||||
static const uint8_t A10 = 27;
|
static const uint8_t A10 = 27;
|
||||||
static const uint8_t A11 = 12;
|
static const uint8_t A11 = 12;
|
||||||
static const uint8_t A12 = 13;
|
static const uint8_t A12 = 13;
|
||||||
|
|
||||||
// vbat measure
|
|
||||||
static const uint8_t BATT_MONITOR = 35;
|
|
||||||
static const uint8_t A13 = 35;
|
static const uint8_t A13 = 35;
|
||||||
|
|
||||||
|
// vbat measure
|
||||||
|
#define BATT_MONITOR 35
|
||||||
|
|
||||||
// internal switch
|
// internal switch
|
||||||
static const uint8_t BUTTON = 38;
|
#define BUTTON = 38;
|
||||||
|
|
||||||
// Neopixel
|
// Neopixel
|
||||||
static const uint8_t NEOPIXEL_PIN = 0;
|
#define PIN_NEOPIXEL 0
|
||||||
static const uint8_t PIN_NEOPIXEL = 0;
|
|
||||||
|
|
||||||
// Neopixel & I2C power
|
// 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 T0 = 4;
|
||||||
static const uint8_t T1 = 0;
|
static const uint8_t T1 = 0;
|
||||||
|
@ -36,10 +36,11 @@ void initVariant(void)
|
|||||||
pinMode(NEOPIXEL_POWER, OUTPUT);
|
pinMode(NEOPIXEL_POWER, OUTPUT);
|
||||||
digitalWrite(NEOPIXEL_POWER, HIGH);
|
digitalWrite(NEOPIXEL_POWER, HIGH);
|
||||||
|
|
||||||
// This board has a power control pin, and we must set it to output and low
|
// turn on the I2C power by setting pin to opposite of 'rest state'
|
||||||
// in order to enable the I2C port.
|
pinMode(PIN_I2C_POWER, INPUT);
|
||||||
|
delay(1);
|
||||||
|
bool polarity = digitalRead(PIN_I2C_POWER);
|
||||||
pinMode(PIN_I2C_POWER, OUTPUT);
|
pinMode(PIN_I2C_POWER, OUTPUT);
|
||||||
digitalWrite(PIN_I2C_POWER, LOW);
|
digitalWrite(PIN_I2C_POWER, !polarity);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):-1)
|
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):-1)
|
||||||
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)
|
#define digitalPinHasPWM(p) (p < EXTERNAL_NUM_INTERRUPTS)
|
||||||
|
|
||||||
static const uint8_t SWITCH = 9;
|
#define BUTTON 9
|
||||||
static const uint8_t NEOPIXEL_PIN = 2;
|
#define PIN_NEOPIXEL 2
|
||||||
|
|
||||||
static const uint8_t TX = 21;
|
static const uint8_t TX = 21;
|
||||||
static const uint8_t RX = 20;
|
static const uint8_t RX = 20;
|
||||||
|
Reference in New Issue
Block a user