summaryrefslogtreecommitdiff
path: root/src/components/battery
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/battery')
-rw-r--r--src/components/battery/BatteryController.cpp6
-rw-r--r--src/components/battery/BatteryController.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp
index fa476ea..d543ccd 100644
--- a/src/components/battery/BatteryController.cpp
+++ b/src/components/battery/BatteryController.cpp
@@ -12,12 +12,12 @@ Battery::Battery() {
}
void Battery::Init() {
- nrf_gpio_cfg_input(chargingPin, 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_Pullup);
}
void Battery::Update() {
- isCharging = !nrf_gpio_pin_read(chargingPin);
- isPowerPresent = !nrf_gpio_pin_read(powerPresentPin);
+ isCharging = !nrf_gpio_pin_read(PinMap::Charging);
+ isPowerPresent = !nrf_gpio_pin_read(PinMap::PowerPresent);
if (isReading) {
return;
diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h
index cd66ff8..993ef6c 100644
--- a/src/components/battery/BatteryController.h
+++ b/src/components/battery/BatteryController.h
@@ -73,8 +73,6 @@ namespace Pinetime {
static constexpr uint8_t percentRemainingSamples = 5;
CircBuffer<percentRemainingSamples> percentRemainingBuffer {};
- static constexpr uint32_t chargingPin = PINMAP_CHARGING_PIN;
- static constexpr uint32_t powerPresentPin = 19;
static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7;
uint16_t voltage = 0;
int percentRemaining = -1;