Skip to content

Commit

Permalink
refactor(split): introduce CONFIG_ZMK_SPLIT_INIT_PRIORITY
Browse files Browse the repository at this point in the history
  • Loading branch information
xudongzheng committed Dec 30, 2023
1 parent 0bcd50b commit 80b0e2f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/src/split/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion app/src/split/bluetooth/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion app/src/split/bluetooth/peripheral.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion app/src/split/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions docs/docs/config/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

0 comments on commit 80b0e2f

Please sign in to comment.