From d38740cebf3be17a7d55fc51f5f06752182f96d8 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Sat, 10 Oct 2020 23:32:53 +0200 Subject: Add timestamps to position and behavior events (#147) * Add timestamps to position events and behaviors. - Take original event timestamps into consideration so nested tap-holds have proper timing. - Add position and timestamp to keycode state changed event so the one-shot behavior can properly identify other keypresses and timings. - Add timestamp to position events received from peripheral * reduce number of arguments to behaviors --- app/src/split/bluetooth/central.c | 1 + 1 file changed, 1 insertion(+) (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 cb1b68b..ed52ba0 100644 --- a/app/src/split/bluetooth/central.c +++ b/app/src/split/bluetooth/central.c @@ -60,6 +60,7 @@ static u8_t split_central_notify_func(struct bt_conn *conn, struct bt_gatt_subsc struct position_state_changed *pos_ev = new_position_state_changed(); pos_ev->position = position; pos_ev->state = pressed; + pos_ev->timestamp = k_uptime_get(); LOG_DBG("Trigger key position state change for %d", position); ZMK_EVENT_RAISE(pos_ev); -- cgit v1.2.3