modified T114 code to disable many unused peripherals, and set up the LOWPWR power mode. all changes should be quite safe, but testing for a couple days just in case.

This commit is contained in:
Laura J
2025-08-25 22:10:18 -07:00
parent 24cc6a40a6
commit a16e011bd2
2 changed files with 44 additions and 0 deletions
+5
View File
@@ -40,6 +40,9 @@ public:
uint16_t getBattMilliVolts() override {
int adcvalue = 0;
NRF_SAADC->ENABLE = 1;
analogReadResolution(12);
analogReference(AR_INTERNAL_3_0);
pinMode(PIN_BAT_CTL, OUTPUT); // battery adc can be read only ctrl pin 6 set to high
@@ -49,6 +52,8 @@ public:
adcvalue = analogRead(PIN_VBAT_READ);
digitalWrite(6, 0);
NRF_SAADC->ENABLE = 0;
return (uint16_t)((float)adcvalue * MV_LSB * 4.9);
}