mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-05-10 10:35:12 -04:00
Merge 828623c70c
into fff96fb5c0
This commit is contained in:
commit
fd244b507a
1 changed files with 22 additions and 5 deletions
27
Power.h
27
Power.h
|
@ -95,10 +95,10 @@
|
|||
float bat_delay_v = 0;
|
||||
float bat_state_change_v = 0;
|
||||
#elif BOARD_MODEL == BOARD_HELTEC32_V3
|
||||
#define BAT_V_MIN 3.15
|
||||
#define BAT_V_MAX 4.3
|
||||
#define BAT_V_CHG 4.48
|
||||
#define BAT_V_FLOAT 4.33
|
||||
#define BAT_V_MIN 3.05
|
||||
#define BAT_V_MAX 4.0
|
||||
#define BAT_V_CHG 4.1
|
||||
#define BAT_V_FLOAT 3.95
|
||||
#define BAT_SAMPLES 7
|
||||
const uint8_t pin_vbat = 1;
|
||||
const uint8_t pin_ctrl = 37;
|
||||
|
@ -348,8 +348,25 @@ bool init_pmu() {
|
|||
pinMode(pin_vbat, INPUT);
|
||||
return true;
|
||||
#elif BOARD_MODEL == BOARD_HELTEC32_V3
|
||||
// there are three version of V3: V3, V3.1, and V3.2
|
||||
// V3 and V3.1 have a pull up on pin_ctrl and are active low
|
||||
// V3.2 has a transistor and active high
|
||||
// put the pin input mode and read it. if it's high, we have V3 or V3.1
|
||||
// other wise, it's a V3.2
|
||||
uint16_t pin_ctrl_value;
|
||||
uint8_t pin_ctrl_active = LOW;
|
||||
pinMode(pin_ctrl, INPUT);
|
||||
pin_ctrl_value = digitalRead(pin_ctrl);
|
||||
if(pin_ctrl_value == HIGH) {
|
||||
// We have either a V3 or V3.1
|
||||
pin_ctrl_active = LOW;
|
||||
}
|
||||
else {
|
||||
// We have a V3.2
|
||||
pin_ctrl_active = HIGH;
|
||||
}
|
||||
pinMode(pin_ctrl,OUTPUT);
|
||||
digitalWrite(pin_ctrl, LOW);
|
||||
digitalWrite(pin_ctrl, pin_ctrl_active);
|
||||
return true;
|
||||
#elif BOARD_MODEL == BOARD_HELTEC_T114
|
||||
pinMode(pin_ctrl,OUTPUT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue