diff options
author | hubmartin <hub.martin@gmail.com> | 2021-09-13 10:19:07 +0200 |
---|---|---|
committer | hubmartin <hub.martin@gmail.com> | 2021-09-13 10:19:07 +0200 |
commit | 73d3e41ceadf576542508c114679e1d3e6039d4d (patch) | |
tree | 8fdbd15c5a0ac7fc209276ea6e60a9570a51b7ff /src/components/battery/BatteryController.cpp | |
parent | 8390d0ef7243261675aab3a5c19862eb3fc53e68 (diff) | |
parent | c9aeef94ea824ad7304ca3f0bd76a476f4744ff4 (diff) |
Merge branch 'develop' into pinmap
Diffstat (limited to 'src/components/battery/BatteryController.cpp')
-rw-r--r-- | src/components/battery/BatteryController.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp index cabf101b..4ef20a24 100644 --- a/src/components/battery/BatteryController.cpp +++ b/src/components/battery/BatteryController.cpp @@ -10,10 +10,7 @@ Battery* Battery::instance = nullptr; Battery::Battery() { instance = this; -} - -void Battery::Init() { - nrf_gpio_cfg_input(PinMap::Charging, static_cast<nrf_gpio_pin_pull_t> GPIO_PIN_CNF_PULL_Pullup); + nrf_gpio_cfg_input(PinMap::Charging, static_cast<nrf_gpio_pin_pull_t> GPIO_PIN_CNF_PULL_Disabled); } void Battery::Update() { @@ -76,5 +73,11 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) { nrfx_saadc_uninit(); isReading = false; + + systemTask->PushMessage(System::Messages::BatteryMeasurementDone); } } + +void Battery::Register(Pinetime::System::SystemTask* systemTask) { + this->systemTask = systemTask; +} |