From 2b3de1bc1a85c9f6ff6b8a92c89e4b2c56f9ef18 Mon Sep 17 00:00:00 2001 From: Xudong Zheng <7pkvm5aw@slicealias.com> Date: Sat, 23 Dec 2023 15:49:32 -0500 Subject: [PATCH] refactor(split): move event listener out of Bluetooth directory --- app/src/split/CMakeLists.txt | 6 +++++- app/src/split/bluetooth/CMakeLists.txt | 4 ++-- app/src/split/{bluetooth/split_listener.c => listener.c} | 0 3 files changed, 7 insertions(+), 3 deletions(-) rename app/src/split/{bluetooth/split_listener.c => listener.c} (100%) diff --git a/app/src/split/CMakeLists.txt b/app/src/split/CMakeLists.txt index 27abb82a..2e243e5c 100644 --- a/app/src/split/CMakeLists.txt +++ b/app/src/split/CMakeLists.txt @@ -1,6 +1,10 @@ # Copyright (c) 2022 The ZMK Contributors # SPDX-License-Identifier: MIT +if (CONFIG_ZMK_SPLIT_BLE AND (NOT CONFIG_ZMK_SPLIT_ROLE_CENTRAL)) + target_sources(app PRIVATE listener.c) +endif() + if (CONFIG_ZMK_SPLIT_BLE) add_subdirectory(bluetooth) -endif() \ No newline at end of file +endif() diff --git a/app/src/split/bluetooth/CMakeLists.txt b/app/src/split/bluetooth/CMakeLists.txt index 6e0ad617..d25ca45d 100644 --- a/app/src/split/bluetooth/CMakeLists.txt +++ b/app/src/split/bluetooth/CMakeLists.txt @@ -2,14 +2,14 @@ # SPDX-License-Identifier: MIT if (NOT CONFIG_ZMK_SPLIT_ROLE_CENTRAL) - target_sources(app PRIVATE split_listener.c) target_sources(app PRIVATE service.c) target_sources(app PRIVATE peripheral.c) endif() + if (CONFIG_ZMK_SPLIT_ROLE_CENTRAL) target_sources(app PRIVATE central.c) endif() if (CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY) target_sources(app PRIVATE central_bas_proxy.c) -endif() \ No newline at end of file +endif() diff --git a/app/src/split/bluetooth/split_listener.c b/app/src/split/listener.c similarity index 100% rename from app/src/split/bluetooth/split_listener.c rename to app/src/split/listener.c