Skip to content

Commit 240d99f

Browse files
jfischer-nokartben
authored andcommitted
samples: usb: hid-keyboard: allow disabling of remote wakeup
Allow disabling of remote wakeup in cases where a driver does not support remote wakeup or where the functionality is not desired. Signed-off-by: Johann Fischer <[email protected]>
1 parent f376602 commit 240d99f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

samples/subsys/usb/hid-keyboard/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Copyright (c) 2023 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4+
config SAMPLE_USBD_REMOTE_WAKEUP
5+
default y
6+
47
# Source common USB sample options used to initialize new experimental USB
58
# device stack. The scope of these options is limited to USB samples in project
69
# tree, you cannot use them in your own application.

samples/subsys/usb/hid-keyboard/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ CONFIG_USBD_LOG_LEVEL_WRN=y
77
CONFIG_USBD_HID_LOG_LEVEL_WRN=y
88
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
99
CONFIG_SAMPLE_USBD_PID=0x0007
10-
CONFIG_SAMPLE_USBD_REMOTE_WAKEUP=y
1110

1211
CONFIG_GPIO=y
1312
CONFIG_INPUT=y

samples/subsys/usb/hid-keyboard/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ int main(void)
279279
continue;
280280
}
281281

282-
if (usbd_is_suspended(sample_usbd)) {
282+
if (IS_ENABLED(CONFIG_SAMPLE_USBD_REMOTE_WAKEUP) &&
283+
usbd_is_suspended(sample_usbd)) {
283284
/* on a press of any button, send wakeup request */
284285
if (kb_evt.value) {
285286
ret = usbd_wakeup_request(sample_usbd);

0 commit comments

Comments
 (0)