summaryrefslogtreecommitdiff
path: root/examples/device/dynamic_configuration/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device/dynamic_configuration/src/main.c')
-rw-r--r--examples/device/dynamic_configuration/src/main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/device/dynamic_configuration/src/main.c b/examples/device/dynamic_configuration/src/main.c
index 33a603343..b6409c8e1 100644
--- a/examples/device/dynamic_configuration/src/main.c
+++ b/examples/device/dynamic_configuration/src/main.c
@@ -1,4 +1,4 @@
-/*
+/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach (tinyusb.org)
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-#include "bsp/board.h"
+#include "bsp/board_api.h"
#include "tusb.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
@@ -66,8 +70,6 @@ int main(void)
cdc_task();
midi_task();
}
-
- return 0;
}
//--------------------------------------------------------------------+
@@ -98,7 +100,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;
}