battery: Add zmk_battery_state_of_peripheral_charge()

As a counterpart to zmk_battery_state_of_charge()
This commit is contained in:
Donald Gordon 2022-07-13 22:35:46 +12:00 committed by Chris Andreae
parent f3a9efa8df
commit b77f92a221
No known key found for this signature in database
GPG key ID: 3AA9D181B3ABD33F
2 changed files with 5 additions and 0 deletions

View file

@ -7,3 +7,6 @@
#pragma once
uint8_t zmk_battery_state_of_charge();
#if IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
uint8_t zmk_battery_state_of_peripheral_charge();
#endif

View file

@ -72,6 +72,8 @@ ZMK_SUBSCRIPTION(peripheral_batt_lvl_listener, zmk_peripheral_battery_state_chan
uint8_t zmk_battery_state_of_charge() { return last_state_of_charge; }
uint8_t zmk_battery_state_of_peripheral_charge() { return last_state_of_peripheral_charge; }
static int zmk_battery_update(const struct device *battery) {
struct sensor_value state_of_charge;