Merge pull request 'Repeater, room server, sensor, companion: nRF52 no longer stays at +2.6 mA after boot (CC310 IRQ), plus sleep/peripheral fixes' (#28) from feat/powersave-audit into main
This commit is contained in:
commit
ec3b71daa9
9 files changed
+154
-9
No files matched your search
@@ -31,10 +31,9 @@ void SenseCapSolarBoard::begin() {
|
||||
|
||||
pinMode(BATTERY_PIN, INPUT);
|
||||
pinMode(VBAT_ENABLE, OUTPUT);
|
||||
digitalWrite(VBAT_ENABLE, LOW);
|
||||
digitalWrite(VBAT_ENABLE, HIGH);
|
||||
analogReadResolution(12);
|
||||
analogReference(AR_INTERNAL_3_0);
|
||||
delay(50);
|
||||
|
||||
#ifdef PIN_USER_BTN
|
||||
pinMode(PIN_USER_BTN, INPUT_PULLUP);
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
analogReference(AR_INTERNAL_3_0);
|
||||
delay(10);
|
||||
adcvalue = analogRead(BATTERY_PIN);
|
||||
digitalWrite(VBAT_ENABLE, HIGH);
|
||||
return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user