summaryrefslogtreecommitdiff
path: root/app/include
diff options
context:
space:
mode:
authorPeter Johanson <peter@peterjohanson.com>2021-08-02 21:44:01 -0400
committerPete Johanson <peter@peterjohanson.com>2021-08-03 00:19:05 -0400
commitd05d7ec2d2b40ca40339b4d7cceb31974bac0e94 (patch)
tree37e3f90b46e3e5c01146f1d9c505b7e05d1d5e95 /app/include
parent9d34cf561e11682840e10283f0a6947547a649b5 (diff)
feat(endpoints): Add endpoint select changed event.
Diffstat (limited to 'app/include')
-rw-r--r--app/include/zmk/endpoints.h8
-rw-r--r--app/include/zmk/endpoints_types.h12
-rw-r--r--app/include/zmk/events/endpoint_selection_changed.h18
3 files changed, 31 insertions, 7 deletions
diff --git a/app/include/zmk/endpoints.h b/app/include/zmk/endpoints.h
index 0d2bbce..c886053 100644
--- a/app/include/zmk/endpoints.h
+++ b/app/include/zmk/endpoints.h
@@ -6,13 +6,7 @@
#pragma once
-#include <zmk/keys.h>
-#include <zmk/hid.h>
-
-enum zmk_endpoint {
- ZMK_ENDPOINT_USB,
- ZMK_ENDPOINT_BLE,
-};
+#include <zmk/endpoints_types.h>
int zmk_endpoints_select(enum zmk_endpoint endpoint);
int zmk_endpoints_toggle();
diff --git a/app/include/zmk/endpoints_types.h b/app/include/zmk/endpoints_types.h
new file mode 100644
index 0000000..70804a6
--- /dev/null
+++ b/app/include/zmk/endpoints_types.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2021 The ZMK Contributors
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#pragma once
+
+enum zmk_endpoint {
+ ZMK_ENDPOINT_USB,
+ ZMK_ENDPOINT_BLE,
+};
diff --git a/app/include/zmk/events/endpoint_selection_changed.h b/app/include/zmk/events/endpoint_selection_changed.h
new file mode 100644
index 0000000..38a6a8e
--- /dev/null
+++ b/app/include/zmk/events/endpoint_selection_changed.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2021 The ZMK Contributors
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#pragma once
+
+#include <zephyr.h>
+
+#include <zmk/endpoints_types.h>
+#include <zmk/event_manager.h>
+
+struct zmk_endpoint_selection_changed {
+ enum zmk_endpoint endpoint;
+};
+
+ZMK_EVENT_DECLARE(zmk_endpoint_selection_changed);