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.
This commit is contained in:
Pete Johanson
2020-12-20 09:49:42 -05:00
parent c74ae45e17
commit 47f873b038
17 changed files with 247 additions and 20 deletions

View File

@@ -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()
}));
}
}