summaryrefslogtreecommitdiff
path: root/examples/device/dfu_runtime/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device/dfu_runtime/src/main.c')
-rw-r--r--examples/device/dfu_runtime/src/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/device/dfu_runtime/src/main.c b/examples/device/dfu_runtime/src/main.c
index 4ec3cb188..170dde932 100644
--- a/examples/device/dfu_runtime/src/main.c
+++ b/examples/device/dfu_runtime/src/main.c
@@ -40,7 +40,7 @@
#include <stdio.h>
#include <string.h>
-#include "bsp/board.h"
+#include "bsp/board_api.h"
#include "tusb.h"
//--------------------------------------------------------------------+
@@ -72,6 +72,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
@@ -107,7 +111,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;
}
// Invoked on DFU_DETACH request to reboot to the bootloader