Skip to content

Commit

Permalink
fix(split): Update events and init function
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Mar 25, 2024
1 parent 9e0c926 commit f6ef244
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static inline int set_layer_state(uint8_t layer, bool state) {
// Don't send state changes unless there was an actual change
if (old_state != _zmk_keymap_layer_state) {
LOG_DBG("layer_changed: layer %d state %d", layer, state);
ZMK_EVENT_RAISE(create_layer_state_changed(layer, state));
raise_layer_state_changed(layer, state);
#if ZMK_BLE_IS_CENTRAL
int err = zmk_split_central_send_data(DATA_TAG_KEYMAP_STATE, sizeof(uint32_t),
(uint8_t *)&_zmk_keymap_layer_state);
Expand Down
6 changes: 1 addition & 5 deletions app/src/split/bluetooth/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,6 @@ static uint8_t split_central_chrc_discovery_func(struct bt_conn *conn,
slot->batt_lvl_read_params.single.offset = 0;
bt_gatt_read(conn, &slot->batt_lvl_read_params);
#endif /* IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING) */
}

bool subscribed = slot->run_behavior_handle && slot->subscribe_params.value_handle;

} else if (bt_uuid_cmp(chrc_uuid, BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_DATA_XFER_UUID)) == 0) {
LOG_DBG("Found data transfer handle");
slot->discover_params.uuid = NULL;
Expand Down Expand Up @@ -918,7 +914,7 @@ int zmk_split_central_send_data(enum data_tag tag, uint8_t size, uint8_t *data)
return split_bt_data_xfer_payload(payload);
}

int zmk_split_bt_central_init(const struct device *_arg) {
int zmk_split_bt_central_init(void) {
k_work_queue_start(&split_central_split_run_q, split_central_split_run_q_stack,
K_THREAD_STACK_SIZEOF(split_central_split_run_q_stack),
CONFIG_ZMK_BLE_THREAD_PRIORITY, NULL);
Expand Down
2 changes: 1 addition & 1 deletion app/src/split/bluetooth/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static void split_svc_data_xfer_callback(struct k_work *work) {
LOG_DBG("Size correct, raising event");
struct zmk_split_data_xfer_event event;
memcpy(&event.data_xfer, &data_xfer_payload, sizeof(struct zmk_split_data_xfer_data));
ZMK_EVENT_RAISE(new_zmk_split_data_xfer_event(event));
raise_zmk_split_data_xfer_event(event);
}

static K_WORK_DEFINE(split_svc_data_xfer_work, split_svc_data_xfer_callback);
Expand Down

0 comments on commit f6ef244

Please sign in to comment.