Don't measure and notify percentage on charging event.

This commit is contained in:
Riku Isokoski
2021-10-09 13:39:27 +03:00
parent a9f7153fdf
commit 1777b9dee8
3 changed files with 11 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ Battery::Battery() {
nrf_gpio_cfg_input(PinMap::Charging, static_cast<nrf_gpio_pin_pull_t> GPIO_PIN_CNF_PULL_Disabled);
}
void Battery::Update() {
void Battery::ReadPowerState() {
isCharging = !nrf_gpio_pin_read(PinMap::Charging);
isPowerPresent = !nrf_gpio_pin_read(PinMap::PowerPresent);
@@ -22,6 +22,10 @@ void Battery::Update() {
} else if (!isPowerPresent) {
isFull = false;
}
}
void Battery::MeasureVoltage() {
ReadPowerState();
if (isReading) {
return;