From 80b0e2fa791620383bfec37c64901beb4b8ee286 Mon Sep 17 00:00:00 2001 From: Xudong Zheng <7pkvm5aw@slicealias.com> Date: Fri, 29 Dec 2023 23:40:46 -0500 Subject: [PATCH] refactor(split): introduce CONFIG_ZMK_SPLIT_INIT_PRIORITY --- app/src/split/Kconfig | 4 ++++ app/src/split/bluetooth/central.c | 2 +- app/src/split/bluetooth/peripheral.c | 2 +- app/src/split/service.c | 2 +- docs/docs/config/system.md | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/split/Kconfig b/app/src/split/Kconfig index 3f9b3fe05061..fe765a7102ff 100644 --- a/app/src/split/Kconfig +++ b/app/src/split/Kconfig @@ -6,6 +6,10 @@ menuconfig ZMK_SPLIT if ZMK_SPLIT +config ZMK_SPLIT_INIT_PRIORITY + int "Split Init Priority" + default 50 + config ZMK_SPLIT_ROLE_CENTRAL bool "Split central device" diff --git a/app/src/split/bluetooth/central.c b/app/src/split/bluetooth/central.c index 95a4588e48ba..aa32b5bb5a45 100644 --- a/app/src/split/bluetooth/central.c +++ b/app/src/split/bluetooth/central.c @@ -720,4 +720,4 @@ int zmk_split_bt_central_init(const struct device *_arg) { return IS_ENABLED(CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START) ? 0 : start_scanning(); } -SYS_INIT(zmk_split_bt_central_init, APPLICATION, CONFIG_ZMK_BLE_INIT_PRIORITY); +SYS_INIT(zmk_split_bt_central_init, APPLICATION, CONFIG_ZMK_SPLIT_INIT_PRIORITY); diff --git a/app/src/split/bluetooth/peripheral.c b/app/src/split/bluetooth/peripheral.c index 704e2eed4087..32357baac585 100644 --- a/app/src/split/bluetooth/peripheral.c +++ b/app/src/split/bluetooth/peripheral.c @@ -176,4 +176,4 @@ static int zmk_peripheral_ble_init(const struct device *_arg) { return 0; } -SYS_INIT(zmk_peripheral_ble_init, APPLICATION, CONFIG_ZMK_BLE_INIT_PRIORITY); +SYS_INIT(zmk_peripheral_ble_init, APPLICATION, CONFIG_ZMK_SPLIT_INIT_PRIORITY); diff --git a/app/src/split/service.c b/app/src/split/service.c index f2ff5c66db81..19446930da55 100644 --- a/app/src/split/service.c +++ b/app/src/split/service.c @@ -125,4 +125,4 @@ int service_init(const struct device *_arg) { return 0; } -SYS_INIT(service_init, APPLICATION, CONFIG_ZMK_BLE_INIT_PRIORITY); +SYS_INIT(service_init, APPLICATION, CONFIG_ZMK_SPLIT_INIT_PRIORITY); diff --git a/docs/docs/config/system.md b/docs/docs/config/system.md index 9ce539a45b46..00864d26187d 100644 --- a/docs/docs/config/system.md +++ b/docs/docs/config/system.md @@ -116,3 +116,4 @@ Following split keyboard settings are defined in [zmk/app/src/split/Kconfig](htt | `CONFIG_ZMK_SPLIT_PERIPHERAL_STACK_SIZE` | int | Stack size of the split peripheral notify thread | 650 | | `CONFIG_ZMK_SPLIT_PERIPHERAL_PRIORITY` | int | Priority of the split peripheral notify thread | 5 | | `CONFIG_ZMK_SPLIT_PERIPHERAL_POSITION_QUEUE_SIZE` | int | Max number of key state events to queue to send to the central | 10 | +| `CONFIG_ZMK_SPLIT_INIT_PRIORITY` | int | Split init priority | 50 |