diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-09-22 12:03:41 +0300 |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2021-09-22 12:03:41 +0300 |
| commit | b2100908373f76660fcfb5f3c454eb69a38ca4ef (patch) | |
| tree | 090a52c4e10646a0d7a9383920452342b4898f4c /src/components/battery/BatteryController.h | |
| parent | b31b2425f8afd5022173852f5a78592b37104c39 (diff) | |
| parent | 1c3c3c8db919c703bbd3f1be4ce9c6833237ea6f (diff) | |
Merge branch 'develop' into detect_full_charge
Diffstat (limited to 'src/components/battery/BatteryController.h')
| -rw-r--r-- | src/components/battery/BatteryController.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index b66da5e4..c78ffb3f 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -1,8 +1,7 @@ #pragma once #include <cstdint> #include <drivers/include/nrfx_saadc.h> -#include <array> -#include <numeric> +#include <systemtask/SystemTask.h> namespace Pinetime { namespace Controllers { @@ -11,8 +10,8 @@ namespace Pinetime { public: Battery(); - void Init(); void Update(); + void Register(System::SystemTask* systemTask); uint8_t PercentRemaining() const { return percentRemaining; @@ -36,8 +35,6 @@ namespace Pinetime { static Battery* instance; nrf_saadc_value_t saadc_value; - static constexpr uint32_t chargingPin = 12; - static constexpr uint32_t powerPresentPin = 19; static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7; uint16_t voltage = 0; uint8_t percentRemaining = 0; @@ -52,6 +49,8 @@ namespace Pinetime { static void AdcCallbackStatic(nrfx_saadc_evt_t const* event); bool isReading = false; + + Pinetime::System::SystemTask* systemTask = nullptr; }; } } |
