summaryrefslogtreecommitdiff
path: root/app/src/kscan.c
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-12-20 09:49:42 -0500
committerPete Johanson <peter@peterjohanson.com>2022-01-31 23:03:34 -0500
commit47f873b038c6468d29d97f855dfc05818f660418 (patch)
tree446c39fd107800e56e65389d524d772199892845 /app/src/kscan.c
parentc74ae45e1721bc9e63332c07fd0654c0e4126be1 (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.c9
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()
+ }));
}
}