diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-12-20 09:49:42 -0500 |
---|---|---|
committer | Nick Van Doorn <nick@nv.delivery> | 2021-11-26 09:59:03 -0800 |
commit | 4e4faca67015df3a3e1bf1b9937265f465c5093d (patch) | |
tree | 65557196f4bd4d22532bbda17cb531b468cb8af2 /app/src/kscan.c | |
parent | 67d30762529bee82236446d43b98858072f8afd0 (diff) |
feature(split): behavior locality support.
* GATT characteristic allowing passng data + behavior
label to invoke the behavior on the peripheral side.
* Behaviors have a locality setting to specify where they run.
* Build reset/power/RGB on peripheral.
Diffstat (limited to 'app/src/kscan.c')
-rw-r--r-- | app/src/kscan.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/src/kscan.c b/app/src/kscan.c index 3c9c201..13ad2cc 100644 --- a/app/src/kscan.c +++ b/app/src/kscan.c @@ -6,6 +6,7 @@ #include <zephyr.h> #include <device.h> +#include <bluetooth/addr.h> #include <drivers/kscan.h> #include <logging/log.h> @@ -49,8 +50,12 @@ void zmk_kscan_process_msgq(struct k_work *item) { uint32_t position = zmk_matrix_transform_row_column_to_position(ev.row, ev.column); LOG_DBG("Row: %d, col: %d, position: %d, pressed: %s", ev.row, ev.column, position, (pressed ? "true" : "false")); - ZMK_EVENT_RAISE(new_zmk_position_state_changed((struct zmk_position_state_changed){ - .state = pressed, .position = position, .timestamp = k_uptime_get()})); + ZMK_EVENT_RAISE(new_zmk_position_state_changed((struct zmk_position_state_changed) { +#if IS_ENABLED(CONFIG_ZMK_BLE) + .source = BT_ADDR_LE_NONE, +#endif + .state = pressed, .position = position, .timestamp = k_uptime_get() + })); } } |