Skip to content

Commit

Permalink
feat(split): Add data transfer event
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed May 21, 2024
1 parent ff7e0b7 commit ef8ab95
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ target_sources_ifdef(CONFIG_ZMK_BATTERY_REPORTING app PRIVATE src/battery.c)
target_sources_ifdef(CONFIG_ZMK_HID_INDICATORS app PRIVATE src/events/hid_indicators_changed.c)

target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_peripheral_status_changed.c)
target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_data_xfer_event.c)
add_subdirectory(src/split)

target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/usb.c)
Expand Down
17 changes: 17 additions & 0 deletions app/include/zmk/events/split_data_xfer_event.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#pragma once

#include <zephyr/kernel.h>
#include <zmk/event_manager.h>
#include <zmk/split/bluetooth/service.h>

struct zmk_split_data_xfer_event {
struct zmk_split_data_xfer_data data_xfer;
};

ZMK_EVENT_DECLARE(zmk_split_data_xfer_event);
10 changes: 10 additions & 0 deletions app/src/events/split_data_xfer_event.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <zephyr/kernel.h>
#include <zmk/events/split_data_xfer_event.h>

ZMK_EVENT_IMPL(zmk_split_data_xfer_event);
1 change: 1 addition & 0 deletions app/src/split/bluetooth/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);

#include <zmk/events/sensor_event.h>
#include <zmk/sensors.h>
#include <zmk/events/split_data_xfer_event.h>

#if ZMK_KEYMAP_HAS_SENSORS
static struct sensor_event last_sensor_event;
Expand Down

0 comments on commit ef8ab95

Please sign in to comment.