Skip to content

Commit 1adfcf9

Browse files
xudongzhengpetejohanson
authored andcommittedMay 29, 2023
refactor(split): fix inconsistency in Kconfig names
1 parent 5aac274 commit 1adfcf9

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed
 

‎app/include/zmk/ble.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#if ZMK_BLE_IS_CENTRAL
1717
#define ZMK_BLE_PROFILE_COUNT (CONFIG_BT_MAX_PAIRED - 1)
18-
#define ZMK_BLE_SPLIT_PERIPHERAL_COUNT 1
18+
#define ZMK_SPLIT_BLE_PERIPHERAL_COUNT 1
1919
#else
2020
#define ZMK_BLE_PROFILE_COUNT CONFIG_BT_MAX_PAIRED
2121
#endif

‎app/src/keymap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ int zmk_keymap_apply_position_state(uint8_t source, int layer, uint32_t position
218218
#endif
219219
case BEHAVIOR_LOCALITY_GLOBAL:
220220
#if ZMK_BLE_IS_CENTRAL
221-
for (int i = 0; i < ZMK_BLE_SPLIT_PERIPHERAL_COUNT; i++) {
221+
for (int i = 0; i < ZMK_SPLIT_BLE_PERIPHERAL_COUNT; i++) {
222222
zmk_split_bt_invoke_behavior(i, &binding, event, pressed);
223223
}
224224
#endif

‎app/src/split/bluetooth/Kconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ config ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE
2121
int "Max number of key position state events to queue when received from peripherals"
2222
default 5
2323

24-
config ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_STACK_SIZE
24+
config ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_STACK_SIZE
2525
int "BLE split central write thread stack size"
2626
default 512
2727

28-
config ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_QUEUE_SIZE
28+
config ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_QUEUE_SIZE
2929
int "Max number of behavior run events to queue to send to the peripheral(s)"
3030
default 5
3131

‎app/src/split/bluetooth/central.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct peripheral_slot {
4747
uint8_t changed_positions[POSITION_STATE_DATA_LEN];
4848
};
4949

50-
static struct peripheral_slot peripherals[ZMK_BLE_SPLIT_PERIPHERAL_COUNT];
50+
static struct peripheral_slot peripherals[ZMK_SPLIT_BLE_PERIPHERAL_COUNT];
5151

5252
static const struct bt_uuid_128 split_service_uuid = BT_UUID_INIT_128(ZMK_SPLIT_BT_SERVICE_UUID);
5353

@@ -65,7 +65,7 @@ void peripheral_event_work_callback(struct k_work *work) {
6565
K_WORK_DEFINE(peripheral_event_work, peripheral_event_work_callback);
6666

6767
int peripheral_slot_index_for_conn(struct bt_conn *conn) {
68-
for (int i = 0; i < ZMK_BLE_SPLIT_PERIPHERAL_COUNT; i++) {
68+
for (int i = 0; i < ZMK_SPLIT_BLE_PERIPHERAL_COUNT; i++) {
6969
if (peripherals[i].conn == conn) {
7070
return i;
7171
}
@@ -84,7 +84,7 @@ struct peripheral_slot *peripheral_slot_for_conn(struct bt_conn *conn) {
8484
}
8585

8686
int release_peripheral_slot(int index) {
87-
if (index < 0 || index >= ZMK_BLE_SPLIT_PERIPHERAL_COUNT) {
87+
if (index < 0 || index >= ZMK_SPLIT_BLE_PERIPHERAL_COUNT) {
8888
return -EINVAL;
8989
}
9090

@@ -131,7 +131,7 @@ int release_peripheral_slot(int index) {
131131
}
132132

133133
int reserve_peripheral_slot() {
134-
for (int i = 0; i < ZMK_BLE_SPLIT_PERIPHERAL_COUNT; i++) {
134+
for (int i = 0; i < ZMK_SPLIT_BLE_PERIPHERAL_COUNT; i++) {
135135
if (peripherals[i].state == PERIPHERAL_SLOT_STATE_OPEN) {
136136
// Be sure the slot is fully reinitialized.
137137
release_peripheral_slot(i);
@@ -504,7 +504,7 @@ static struct bt_conn_cb conn_callbacks = {
504504
};
505505

506506
K_THREAD_STACK_DEFINE(split_central_split_run_q_stack,
507-
CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_STACK_SIZE);
507+
CONFIG_ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_STACK_SIZE);
508508

509509
struct k_work_q split_central_split_run_q;
510510

@@ -515,7 +515,7 @@ struct zmk_split_run_behavior_payload_wrapper {
515515

516516
K_MSGQ_DEFINE(zmk_split_central_split_run_msgq,
517517
sizeof(struct zmk_split_run_behavior_payload_wrapper),
518-
CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_QUEUE_SIZE, 4);
518+
CONFIG_ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_QUEUE_SIZE, 4);
519519

520520
void split_central_split_run_callback(struct k_work *work) {
521521
struct zmk_split_run_behavior_payload_wrapper payload_wrapper;

‎docs/docs/config/system.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ Following split keyboard settings are defined in [zmk/app/src/split/Kconfig](htt
9797
| `CONFIG_ZMK_SPLIT_BLE` | bool | Use BLE to communicate between split keyboard halves | y |
9898
| `CONFIG_ZMK_SPLIT_ROLE_CENTRAL` | bool | `y` for central device, `n` for peripheral | |
9999
| `CONFIG_ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE` | int | Max number of key state events to queue when received from peripherals | 5 |
100-
| `CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_STACK_SIZE` | int | Stack size of the BLE split central write thread | 512 |
101-
| `CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_QUEUE_SIZE` | int | Max number of behavior run events to queue to send to the peripheral(s) | 5 |
100+
| `CONFIG_ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_STACK_SIZE` | int | Stack size of the BLE split central write thread | 512 |
101+
| `CONFIG_ZMK_SPLIT_BLE_CENTRAL_SPLIT_RUN_QUEUE_SIZE` | int | Max number of behavior run events to queue to send to the peripheral(s) | 5 |
102102
| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE` | int | Stack size of the BLE split peripheral notify thread | 650 |
103103
| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_PRIORITY` | int | Priority of the BLE split peripheral notify thread | 5 |
104104
| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_POSITION_QUEUE_SIZE` | int | Max number of key state events to queue to send to the central | 10 |

0 commit comments

Comments
 (0)
Please sign in to comment.