Skip to content

Commit b9855db

Browse files
committed
first changeset towards allowing parallel HOGP connections
1 parent 924e59d commit b9855db

29 files changed

Lines changed: 706 additions & 902 deletions

device/.vscode/c_cpp_properties.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
"cppStandard": "gnu++20",
1111
"configurationProvider": "nordic-semiconductor.nrf-connect",
1212
"browse": {
13-
"limitSymbolsToIncludedHeaders": true
13+
"limitSymbolsToIncludedHeaders": true,
14+
"path": [
15+
"${workspaceFolder}/src/**"
16+
]
1417
}
1518
}
1619
],

device/prj.conf.overlays/ble_hid.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CONFIG_BT_KEYS_SAVE_AGING_COUNTER_ON_PAIRING=y
66
CONFIG_BT_MAX_PAIRED=20
77

88
# use BLE HID over GATT from c2usb
9-
CONFIG_C2USB_BLUETOOTH=y
9+
CONFIG_C2USB_HOGP=y
1010
CONFIG_C2USB_HOGP_LOG_LEVEL_DBG=y
1111
# battery status to generic client
1212
CONFIG_BT_BAS=y

device/prj.conf.overlays/c2usb.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CONFIG_C2USB_UDC_MAC_LOG_LEVEL_DBG=y
1010

1111
CONFIG_WARN_EXPERIMENTAL=n
1212

13+
CONFIG_C2USB_HID_BOOT_PROTOCOL=y
1314
CONFIG_C2USB_UDC_MAC=y
1415

1516
# Apply config requires deep stack, and since Agent expects response code,

device/src/bt_manager.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ void BtManager_StartBt() {
6565
return;
6666
}
6767

68-
if (DEVICE_IS_UHK80_RIGHT) {
69-
if (HOGP_Enable()) {
70-
LOG_INF("HOGP service enabled successfully");
71-
} else {
72-
LOG_ERR("Failed to enable HOGP service");
73-
}
74-
}
75-
7668
BtManager_StartScanningAndAdvertising();
7769
}
7870

@@ -103,12 +95,6 @@ void BtManager_StopBt() {
10395

10496
k_sleep(K_MSEC(10));
10597

106-
107-
if (DEVICE_IS_UHK80_RIGHT) {
108-
LOG_WRN("Disabling HOGP service.");
109-
HOGP_Disable();
110-
}
111-
11298
BtAdvertise_DisableAdvertisingIcon();
11399

114100
LOG_INF("OOB: Bluetooth stopped");

device/src/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ void mainRuntime(void) {
250250

251251
// 6.6mA
252252

253-
HID_SetGamepadActive(false);
254253
USB_Enable(); // +2.2mA, 8.8mA; has to be after USB_SetSerialNumber
255254

256255
// 8.8mA

nrfsdk.code-workspace

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
"path": "."
1010
},
1111
{
12-
"name": "workspace",
13-
"path": ".."
12+
"path": "../zephyr"
13+
},
14+
{
15+
"path": "../c2usb/c2usb"
16+
},
17+
{
18+
"path": "../modules/lib/hid-rp/hid-rp"
1419
}
1520
],
1621
"settings": {
@@ -33,6 +38,9 @@
3338
"*.hpp": "cpp",
3439
"*.cpp": "cpp"
3540
},
41+
"C_Cpp.files.exclude": {
42+
"${workspaceFolder:c2usb}/c2usb/**/*.test.cpp": true
43+
},
3644
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
3745
"C_Cpp.workspaceParsingPriority": "high",
3846
"C_Cpp.autoAddFileAssociations": false,

patches/core/0006-cmake-don-t-flush-top-level-compiler-flags.patch renamed to patches/core/0001-cmake-don-t-flush-top-level-compiler-flags.patch

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
From 2c8942648651f955bba2990e92354b04a46e07b7 Mon Sep 17 00:00:00 2001
1+
From c1aa6de8d459d59d6903943f9fcd540ca535604e Mon Sep 17 00:00:00 2001
22
From: Benedek Kupper <kupper.benedek@gmail.com>
3-
Date: Mon, 23 Feb 2026 20:03:41 +0100
3+
Date: Fri, 10 Jul 2026 16:19:13 +0200
44
Subject: [PATCH] cmake: don't flush top-level compiler flags
55

66
This was preventing CMAKE_C_FLAGS_RELEASE and similar from being set in the presets.
77

88
---
9-
cmake/extension/mcux.cmake | 2 +-
10-
1 file changed, 1 insertion(+), 1 deletion(-)
9+
cmake/extension/mcux.cmake | 1 -
10+
1 file changed, 1 deletion(-)
1111

1212
diff --git a/cmake/extension/mcux.cmake b/cmake/extension/mcux.cmake
13-
index db62e4e..8b2b203 100644
13+
index 57c92ef5..5607bace 100644
1414
--- a/cmake/extension/mcux.cmake
1515
+++ b/cmake/extension/mcux.cmake
16-
@@ -71,7 +71,7 @@ macro(project project_name)
17-
# valiate compiler version
18-
# The reason to validate compiler version here is that cmake engine code will get CMAKE_C_COMPILER_VERSION and CMAKE_CXX_COMPILER_VERSION just in "project" macro invocation.
19-
_validate_compiler_version()
16+
@@ -133,7 +133,6 @@ macro(project project_name)
17+
if(NOT (DEFINED MCUX_SKIP_COMPILER_CHECKS AND MCUX_SKIP_COMPILER_CHECKS))
18+
_validate_compiler_version()
19+
endif()
2020
- clear_default_added_compiler_flags()
21-
+
2221
# parse arguments
2322
set(options NO_DEFAULT_CONFIG)
2423
set(single_value PROJECT_BOARD_PORT_PATH PROJECT_DEVICE_PORT_PATH PROJECT_TYPE CUSTOM_LINKER)

patches/core/0005-cmake-set-_IS_TOP_LEVEL-project-variables.patch

Lines changed: 0 additions & 76 deletions
This file was deleted.

patches/etl/0001-delegate-allow-constructing-from-non-capturing-lambd.patch

Lines changed: 0 additions & 183 deletions
This file was deleted.

right/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ CONFIG_USB_DEVICE_CONFIG_LOW_POWER_MODE=y
1818
CONFIG_USB_DEVICE_CONFIG_REMOTE_WAKEUP=y
1919
CONFIG_C2USB_MCUX_MAC=y
2020
CONFIG_C2USB_MCUX_USB_COEXISTENCE=y
21+
CONFIG_C2USB_HID_BOOT_PROTOCOL=y
2122

2223
# disable board (and device) specific source files, as the project has its own sources
2324
# examples/_common/project_segments/common/Kconfig.prjseg

0 commit comments

Comments
 (0)