diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-07-02 18:30:32 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-02 17:30:32 +0200 |
| commit | 38f40034b0a200586429a3d8329479ad13d84d94 (patch) | |
| tree | 77e96ee32a6a134f8e8c7945cd7d8b84c130063e /src/components/battery/BatteryController.h | |
| parent | 7075b7f264d1c5ae3a2b7d2fc26e1d0ad36b2616 (diff) | |
Float voltage to int (#444)
* Change voltage float to millivolt integer
* Explain the ADC to milliVolts conversion
Diffstat (limited to 'src/components/battery/BatteryController.h')
| -rw-r--r-- | src/components/battery/BatteryController.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index 04bcf6b8..26e24938 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -50,7 +50,7 @@ namespace Pinetime { return percentRemainingBuffer.GetAverage(); } - float Voltage() const { + uint16_t Voltage() const { return voltage; } @@ -71,7 +71,7 @@ namespace Pinetime { static constexpr uint32_t chargingPin = 12; static constexpr uint32_t powerPresentPin = 19; static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7; - float voltage = 0.0f; + uint16_t voltage = 0; int percentRemaining = -1; bool isCharging = false; @@ -86,4 +86,4 @@ namespace Pinetime { uint8_t samples = 0; }; } -}
\ No newline at end of file +} |
