From 9bcdd1479b652eaa7191dbdc00250d1196cf93b3 Mon Sep 17 00:00:00 2001 From: genteure Date: Sun, 2 Nov 2025 12:44:45 +0800 Subject: [PATCH] fix(core): int to pointer cast in bas proxy Direct int to pointer cast causing build to fail in some build environments. --- app/src/split/bluetooth/central_bas_proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/split/bluetooth/central_bas_proxy.c b/app/src/split/bluetooth/central_bas_proxy.c index 3e89fb0b893..f706d78f59b 100644 --- a/app/src/split/bluetooth/central_bas_proxy.c +++ b/app/src/split/bluetooth/central_bas_proxy.c @@ -30,7 +30,7 @@ static void blvl_ccc_cfg_changed(const struct bt_gatt_attr *attr, uint16_t value static ssize_t read_blvl(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) { - const uint8_t source = (uint8_t)(uint32_t)attr->user_data; + const uint8_t source = *(uint8_t *)attr->user_data; uint8_t level = 0; int rc = zmk_split_central_get_peripheral_battery_level(source, &level); @@ -60,7 +60,7 @@ static const struct bt_gatt_cpf aux_level_cpf = { #define PERIPH_BATT_LEVEL_ATTRS(i, _) \ BT_GATT_CHARACTERISTIC(BT_UUID_BAS_BATTERY_LEVEL, BT_GATT_CHRC_READ | BT_GATT_CHRC_NOTIFY, \ - BT_GATT_PERM_READ, read_blvl, NULL, i), \ + BT_GATT_PERM_READ, read_blvl, NULL, ((uint8_t[]){i})), \ BT_GATT_CCC(blvl_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), \ BT_GATT_CPF(&aux_level_cpf), BT_GATT_CUD(PERIPH_CUD(i), BT_GATT_PERM_READ),