Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed Feb 9, 2024
1 parent 3260282 commit 66b596b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions app/src/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ static uint8_t last_state_of_charge = 0;
static bool last_battery_is_charging = 0;

uint8_t zmk_battery_state_of_charge(void) { return last_state_of_charge; }

bool zmk_battery_is_charging(void) {
return last_battery_is_charging;
}
bool zmk_battery_is_charging(void) { return last_battery_is_charging; }

#if DT_HAS_CHOSEN(zmk_battery)
static const struct device *const battery = DEVICE_DT_GET(DT_CHOSEN(zmk_battery));
Expand Down Expand Up @@ -65,7 +62,9 @@ static int zmk_battery_update(const struct device *battery) {
const bool batt_is_charging = false;
#endif

if (last_state_of_charge != state_of_charge.val1 || last_battery_is_charging != batt_is_charging) {
if (last_state_of_charge != state_of_charge.val1 ||
last_battery_is_charging != batt_is_charging) {

last_state_of_charge = state_of_charge.val1;
last_battery_is_charging = batt_is_charging;
#if IS_ENABLED(CONFIG_BT_BAS)
Expand All @@ -78,11 +77,10 @@ static int zmk_battery_update(const struct device *battery) {
return rc;
}
#endif
rc = raise_zmk_battery_state_changed(
(struct zmk_battery_state_changed){
.state_of_charge = last_state_of_charge,
.is_charging = batt_is_charging,
});
rc = raise_zmk_battery_state_changed((struct zmk_battery_state_changed){
.state_of_charge = last_state_of_charge,
.is_charging = last_battery_is_charging,
});
}

return rc;
Expand Down

0 comments on commit 66b596b

Please sign in to comment.