mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-19 20:45:18 -05:00
fix: Use zmk_battery_state_of_charge in battery widgets
This commit is contained in:
@@ -67,7 +67,7 @@ void battery_status_update_cb(struct battery_status_state state) {
|
||||
|
||||
static struct battery_status_state battery_status_get_state(const zmk_event_t *eh) {
|
||||
return (struct battery_status_state) {
|
||||
.level = bt_bas_get_battery_level(),
|
||||
.level = zmk_battery_state_of_charge(),
|
||||
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK)
|
||||
.usb_present = zmk_usb_is_powered(),
|
||||
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */
|
||||
|
||||
@@ -71,7 +71,7 @@ static void battery_status_update_cb(struct battery_status_state state) {
|
||||
|
||||
static struct battery_status_state battery_status_get_state(const zmk_event_t *eh) {
|
||||
return (struct battery_status_state) {
|
||||
.level = bt_bas_get_battery_level(),
|
||||
.level = zmk_battery_state_of_charge(),
|
||||
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK)
|
||||
.usb_present = zmk_usb_is_powered(),
|
||||
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */
|
||||
|
||||
@@ -211,7 +211,7 @@ static void battery_status_update_cb(struct battery_status_state state) {
|
||||
|
||||
static struct battery_status_state battery_status_get_state(const zmk_event_t *eh) {
|
||||
return (struct battery_status_state) {
|
||||
.level = bt_bas_get_battery_level(),
|
||||
.level = zmk_battery_state_of_charge(),
|
||||
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK)
|
||||
.usb_present = zmk_usb_is_powered(),
|
||||
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */
|
||||
|
||||
Reference in New Issue
Block a user