summaryrefslogtreecommitdiff
path: root/src/components/battery/BatteryController.h
diff options
context:
space:
mode:
authorMark Russell <mruss660@gmail.com>2021-09-16 20:01:25 (GMT)
committerMark Russell <mruss660@gmail.com>2021-09-16 20:01:25 (GMT)
commit1d43adcdfa7bd15ba45c0c9d7c59c0ff99176b9c (patch)
treec2fa91e352127c09abd0f9b4959cd1f47d628ea8 /src/components/battery/BatteryController.h
parentf857a757a7184726093a7085cdb3d74b728a22e4 (diff)
Merge upstream
Diffstat (limited to 'src/components/battery/BatteryController.h')
-rw-r--r--src/components/battery/BatteryController.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h
index 6f09b73..8af27ea 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;
@@ -34,8 +33,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;
@@ -49,6 +46,8 @@ namespace Pinetime {
static void AdcCallbackStatic(nrfx_saadc_evt_t const* event);
bool isReading = false;
+
+ Pinetime::System::SystemTask* systemTask = nullptr;
};
}
}