fix: Use HalPowerManager for battery percentage (#1005)
## Summary The introduction of `HalGPIO` moved the `BatteryMonitor battery` object into the member function `HalGPIO::getBatteryPercentage()`. Then, with the introduction of `HalPowerManager`, this function was moved to `HalPowerManager::getBatteryPercentage()`. However, the original `BatteryMonitor battery` object is still utilized by themes for displaying the battery percentage. This PR replaces these deprecated uses of `BatteryMonitor battery` with the new `HalPowerManager::getBatteryPercentage()` function. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO **_
This commit is contained in:
@@ -34,7 +34,7 @@ class HalPowerManager {
|
||||
void startDeepSleep(HalGPIO& gpio) const;
|
||||
|
||||
// Get battery percentage (range 0-100)
|
||||
int getBatteryPercentage() const;
|
||||
uint16_t getBatteryPercentage() const;
|
||||
|
||||
// RAII helper class to manage power saving locks
|
||||
// Usage: create an instance of Lock in a scope to disable power saving, for example when running a task that needs
|
||||
|
||||
Reference in New Issue
Block a user