From bac1f17cf6ce225876dc7b6b2a809bcd98010391 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Wed, 2 Dec 2020 16:41:57 +0000 Subject: refactor(app): replace Zephyr integer types with C99 integer types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit u8_t → uint8_t u16_t → uint16_t u32_t → uint32_t u64_t → uint64_t s8_t → int8_t s16_t → int16_t s32_t → int32_t s64_t → int64_t Prerequisite for #223 See: https://github.com/zephyrproject-rtos/zephyr/releases/tag/zephyr-v2.4.0 PR: #467 --- app/src/split/bluetooth/central.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'app/src/split/bluetooth/central.c') diff --git a/app/src/split/bluetooth/central.c b/app/src/split/bluetooth/central.c index 2d4d1ed..f3c860f 100644 --- a/app/src/split/bluetooth/central.c +++ b/app/src/split/bluetooth/central.c @@ -33,11 +33,12 @@ static struct bt_uuid_128 uuid = BT_UUID_INIT_128(ZMK_SPLIT_BT_SERVICE_UUID); static struct bt_gatt_discover_params discover_params; static struct bt_gatt_subscribe_params subscribe_params; -static u8_t split_central_notify_func(struct bt_conn *conn, struct bt_gatt_subscribe_params *params, - const void *data, u16_t length) { - static u8_t position_state[POSITION_STATE_DATA_LEN]; +static uint8_t split_central_notify_func(struct bt_conn *conn, + struct bt_gatt_subscribe_params *params, const void *data, + uint16_t length) { + static uint8_t position_state[POSITION_STATE_DATA_LEN]; - u8_t changed_positions[POSITION_STATE_DATA_LEN]; + uint8_t changed_positions[POSITION_STATE_DATA_LEN]; if (!data) { LOG_DBG("[UNSUBSCRIBED]"); @@ -48,14 +49,14 @@ static u8_t split_central_notify_func(struct bt_conn *conn, struct bt_gatt_subsc LOG_DBG("[NOTIFICATION] data %p length %u", data, length); for (int i = 0; i < POSITION_STATE_DATA_LEN; i++) { - changed_positions[i] = ((u8_t *)data)[i] ^ position_state[i]; - position_state[i] = ((u8_t *)data)[i]; + changed_positions[i] = ((uint8_t *)data)[i] ^ position_state[i]; + position_state[i] = ((uint8_t *)data)[i]; } for (int i = 0; i < POSITION_STATE_DATA_LEN; i++) { for (int j = 0; j < 8; j++) { if (changed_positions[i] & BIT(j)) { - u32_t position = (i * 8) + j; + uint32_t position = (i * 8) + j; bool pressed = position_state[i] & BIT(j); struct position_state_changed *pos_ev = new_position_state_changed(); pos_ev->position = position; @@ -91,8 +92,8 @@ static int split_central_subscribe(struct bt_conn *conn) { return 0; } -static u8_t split_central_discovery_func(struct bt_conn *conn, const struct bt_gatt_attr *attr, - struct bt_gatt_discover_params *params) { +static uint8_t split_central_discovery_func(struct bt_conn *conn, const struct bt_gatt_attr *attr, + struct bt_gatt_discover_params *params) { int err; if (!attr) { @@ -245,7 +246,7 @@ static bool split_central_eir_found(struct bt_data *data, void *user_data) { return true; } -static void split_central_device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type, +static void split_central_device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, struct net_buf_simple *ad) { char dev[BT_ADDR_LE_STR_LEN]; @@ -272,7 +273,7 @@ static int start_scan(void) { return 0; } -static void split_central_connected(struct bt_conn *conn, u8_t conn_err) { +static void split_central_connected(struct bt_conn *conn, uint8_t conn_err) { char addr[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); @@ -292,7 +293,7 @@ static void split_central_connected(struct bt_conn *conn, u8_t conn_err) { split_central_process_connection(conn); } -static void split_central_disconnected(struct bt_conn *conn, u8_t reason) { +static void split_central_disconnected(struct bt_conn *conn, uint8_t reason) { char addr[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); -- cgit v1.2.3