aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/src/endpoints.c
diff options
context:
space:
mode:
authorPeter Johanson <[email protected]>2023-12-07 00:36:02 +0000
committerPete Johanson <[email protected]>2024-03-27 20:59:26 -0700
commit860e53b33ac3b09b233a0ec4c6cb0621895fb16c (patch)
treec34c5e6de1ddce083e2bd0e7f6902422e685410f /app/src/endpoints.c
parentd3fffb9e8913105bc732eb9cbfbd380a9b98167e (diff)
downloadzmk-860e53b33ac3b09b233a0ec4c6cb0621895fb16c.tar.gz
zmk-860e53b33ac3b09b233a0ec4c6cb0621895fb16c.zip
refactor: Promote new endpoints API
* Add ability for external callers to clear the current endpoint.
Diffstat (limited to 'app/src/endpoints.c')
-rw-r--r--app/src/endpoints.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/endpoints.c b/app/src/endpoints.c
index f8452d93fb..7c9d15a31f 100644
--- a/app/src/endpoints.c
+++ b/app/src/endpoints.c
@@ -340,7 +340,7 @@ static int zmk_endpoints_init(void) {
return 0;
}
-static void disconnect_current_endpoint(void) {
+void zmk_endpoints_clear_current(void) {
zmk_hid_keyboard_clear();
zmk_hid_consumer_clear();
#if IS_ENABLED(CONFIG_ZMK_MOUSE)
@@ -356,7 +356,7 @@ static void update_current_endpoint(void) {
if (!zmk_endpoint_instance_eq(new_instance, current_instance)) {
// Cancel all current keypresses so keys don't stay held on the old endpoint.
- disconnect_current_endpoint();
+ zmk_endpoints_clear_current();
current_instance = new_instance;