diff options
| author | HiFiPhile <[email protected]> | 2024-04-01 12:35:57 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2024-04-01 12:35:57 +0200 |
| commit | a1f01fcbe0fecb8d1783a105d7f22cba032dfced (patch) | |
| tree | c8174923ef0bdd1016f55ed731df4c2df3257940 /examples/device/usbtmc/src/main.c | |
| parent | dd0350f5499de586a3405fdcec632f059fd7534e (diff) | |
| parent | 82dfe95655c7b7564363a2d5cb2f5e32d431b223 (diff) | |
Merge remote-tracking branch 'upstream/master' into pr/1702
Diffstat (limited to 'examples/device/usbtmc/src/main.c')
| -rw-r--r-- | examples/device/usbtmc/src/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/device/usbtmc/src/main.c b/examples/device/usbtmc/src/main.c index 6945d8743..9d8f0783d 100644 --- a/examples/device/usbtmc/src/main.c +++ b/examples/device/usbtmc/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" #include "usbtmc_app.h" //--------------------------------------------------------------------+ @@ -57,14 +57,16 @@ 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 led_blinking_task(); usbtmc_app_task_iter(); } - - return 0; } //--------------------------------------------------------------------+ @@ -95,7 +97,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; } //--------------------------------------------------------------------+ |
