summaryrefslogtreecommitdiff
path: root/examples/device/hid_boot_interface/src/main.c
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-08-28 17:46:05 +0700
committerGitHub <[email protected]>2023-08-28 17:46:05 +0700
commit9063ede25f4a013dae8edccc2d953ba2de7ed684 (patch)
tree6f3b8ed3721b60955380514d414228bb567767cb /examples/device/hid_boot_interface/src/main.c
parentaa0fabd51d3ed855ccb337602c6a0083bb50f648 (diff)
parent7bf5923052e5861f54c9cb0581e328f8be26a0a9 (diff)
Merge branch 'master' into nxp_k64
Diffstat (limited to 'examples/device/hid_boot_interface/src/main.c')
-rw-r--r--examples/device/hid_boot_interface/src/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/device/hid_boot_interface/src/main.c b/examples/device/hid_boot_interface/src/main.c
index 1a155996a..7ad5c53c2 100644
--- a/examples/device/hid_boot_interface/src/main.c
+++ b/examples/device/hid_boot_interface/src/main.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-#include "bsp/board.h"
+#include "bsp/board_api.h"
#include "tusb.h"
#include "usb_descriptors.h"
@@ -59,6 +59,10 @@ int main(void)
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
+ if (board_init_after_tusb) {
+ board_init_after_tusb();
+ }
+
while (1)
{
tud_task(); // tinyusb device task
@@ -98,7 +102,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
// Invoked when usb bus is resumed
void tud_resume_cb(void)
{
- blink_interval_ms = BLINK_MOUNTED;
+ blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
}
//--------------------------------------------------------------------+