diff options
author | innovaker <66737976+innovaker@users.noreply.github.com> | 2020-12-02 16:41:57 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-12-14 12:41:25 -0500 |
commit | bac1f17cf6ce225876dc7b6b2a809bcd98010391 (patch) | |
tree | 9783743b31fdadd66d1b3c9e5a3e14dc661ec313 /app/src/split/bluetooth/service.c | |
parent | a4652fa25da83ae036613157fb566eb1ce1426fe (diff) |
refactor(app): replace Zephyr integer types with C99 integer types
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
Diffstat (limited to 'app/src/split/bluetooth/service.c')
-rw-r--r-- | app/src/split/bluetooth/service.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/src/split/bluetooth/service.c b/app/src/split/bluetooth/service.c index 86af685..4839084 100644 --- a/app/src/split/bluetooth/service.c +++ b/app/src/split/bluetooth/service.c @@ -18,21 +18,21 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include <zmk/split/bluetooth/uuid.h> #include <zmk/split/bluetooth/service.h> -static u8_t num_of_positions = ZMK_KEYMAP_LEN; -static u8_t position_state[16]; +static uint8_t num_of_positions = ZMK_KEYMAP_LEN; +static uint8_t position_state[16]; static ssize_t split_svc_pos_state(struct bt_conn *conn, const struct bt_gatt_attr *attrs, - void *buf, u16_t len, u16_t offset) { + void *buf, uint16_t len, uint16_t offset) { return bt_gatt_attr_read(conn, attrs, buf, len, offset, &position_state, sizeof(position_state)); } static ssize_t split_svc_num_of_positions(struct bt_conn *conn, const struct bt_gatt_attr *attrs, - void *buf, u16_t len, u16_t offset) { - return bt_gatt_attr_read(conn, attrs, buf, len, offset, attrs->user_data, sizeof(u8_t)); + void *buf, uint16_t len, uint16_t offset) { + return bt_gatt_attr_read(conn, attrs, buf, len, offset, attrs->user_data, sizeof(uint8_t)); } -static void split_svc_pos_state_ccc(const struct bt_gatt_attr *attr, u16_t value) { +static void split_svc_pos_state_ccc(const struct bt_gatt_attr *attr, uint16_t value) { LOG_DBG("value %d", value); } @@ -45,12 +45,12 @@ BT_GATT_SERVICE_DEFINE( BT_GATT_DESCRIPTOR(BT_UUID_NUM_OF_DIGITALS, BT_GATT_PERM_READ, split_svc_num_of_positions, NULL, &num_of_positions), ); -int zmk_split_bt_position_pressed(u8_t position) { +int zmk_split_bt_position_pressed(uint8_t position) { WRITE_BIT(position_state[position / 8], position % 8, true); return bt_gatt_notify(NULL, &split_svc.attrs[1], &position_state, sizeof(position_state)); } -int zmk_split_bt_position_released(u8_t position) { +int zmk_split_bt_position_released(uint8_t position) { WRITE_BIT(position_state[position / 8], position % 8, false); return bt_gatt_notify(NULL, &split_svc.attrs[1], &position_state, sizeof(position_state)); }
\ No newline at end of file |