summaryrefslogtreecommitdiff
path: root/src/components/battery/BatteryController.h
diff options
context:
space:
mode:
authorJF002 <JF002@users.noreply.github.com>2021-04-16 19:57:35 +0200
committerGitHub <noreply@github.com>2021-04-16 19:57:35 +0200
commit36e27842e146ddcfbcd5dcef4ebb2c92955242be (patch)
tree54c2b4f658a82d5effc5f1a19f5937006aa748cd /src/components/battery/BatteryController.h
parenteb769fb60ecb8f96ecf6901082ec3f0610842af8 (diff)
parent3c413bdd5283f6ef95d23a4b7274722da680f039 (diff)
Merge pull request #263 from joaquimorg/0.16.0Update
Fix Issue #262 for 0.16.0 version
Diffstat (limited to 'src/components/battery/BatteryController.h')
-rw-r--r--src/components/battery/BatteryController.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h
index 2776687b..47d7a6d1 100644
--- a/src/components/battery/BatteryController.h
+++ b/src/components/battery/BatteryController.h
@@ -52,13 +52,13 @@ namespace Pinetime {
float Voltage() const { return voltage; }
bool IsCharging() const { return isCharging; }
- bool IsPowerPresent() const { return isPowerPresent; }
+ bool IsPowerPresent() const { return isPowerPresent; }
private:
static Battery *instance;
nrf_saadc_value_t saadc_value;
- static constexpr uint8_t percentRemainingSamples = 10;
+ static constexpr uint8_t percentRemainingSamples = 5;
CircBuffer<percentRemainingSamples> percentRemainingBuffer {};
static constexpr uint32_t chargingPin = 12;
@@ -74,6 +74,9 @@ namespace Pinetime {
void SaadcEventHandler(nrfx_saadc_evt_t const * p_event);
static void adcCallbackStatic(nrfx_saadc_evt_t const *event);
+
+ bool isReading = false;
+ uint8_t samples = 0;
};
}
} \ No newline at end of file