diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 1afca568..58b1efbe 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -79,17 +79,9 @@ target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/behaviors/behavior_bac target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/battery_state_changed.c) target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/battery.c) -if (CONFIG_ZMK_SPLIT_BLE) - if (NOT CONFIG_ZMK_SPLIT_ROLE_CENTRAL) - target_sources(app PRIVATE src/split_listener.c) - target_sources(app PRIVATE src/split/bluetooth/service.c) - target_sources(app PRIVATE src/split/bluetooth/peripheral.c) - target_sources(app PRIVATE src/events/split_peripheral_status_changed.c) - endif() - if (CONFIG_ZMK_SPLIT_ROLE_CENTRAL) - target_sources(app PRIVATE src/split/bluetooth/central.c) - endif() -endif() +target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_peripheral_status_changed.c) +add_subdirectory(src/split) + target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/usb.c) target_sources_ifdef(CONFIG_ZMK_USB app PRIVATE src/usb_hid.c) target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c) diff --git a/app/src/split/CMakeLists.txt b/app/src/split/CMakeLists.txt new file mode 100644 index 00000000..27abb82a --- /dev/null +++ b/app/src/split/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2022 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if (CONFIG_ZMK_SPLIT_BLE) + add_subdirectory(bluetooth) +endif() \ No newline at end of file diff --git a/app/src/split/bluetooth/CMakeLists.txt b/app/src/split/bluetooth/CMakeLists.txt new file mode 100644 index 00000000..241a9b8d --- /dev/null +++ b/app/src/split/bluetooth/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2022 The ZMK Contributors +# 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() \ No newline at end of file diff --git a/app/src/split_listener.c b/app/src/split/bluetooth/split_listener.c similarity index 100% rename from app/src/split_listener.c rename to app/src/split/bluetooth/split_listener.c