diff options
| author | hathach <[email protected]> | 2023-11-29 17:21:21 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-11-29 17:21:21 +0700 |
| commit | 1c1c2dc3b95b36136373f74380b90646d4847718 (patch) | |
| tree | 2f5b26393cfbe648cb6eb15ea0a03b5003091496 /examples/host/bare_api/src | |
| parent | 00484d18a5b89eb3a0e7cc138f34142f3464016d (diff) | |
| parent | 9c9ebb342d2d3cb0396ff4ad8c7b09acd2aee75e (diff) | |
Merge branch 'master' into codeql
Diffstat (limited to 'examples/host/bare_api/src')
| -rw-r--r-- | examples/host/bare_api/src/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/host/bare_api/src/main.c b/examples/host/bare_api/src/main.c index bb7fa850e..14725996d 100644 --- a/examples/host/bare_api/src/main.c +++ b/examples/host/bare_api/src/main.c @@ -32,7 +32,7 @@ #include <stdio.h> #include <string.h> -#include "bsp/board.h" +#include "bsp/board_api.h" #include "tusb.h" // English @@ -67,6 +67,10 @@ int main(void) // init host stack on configured roothub port tuh_init(BOARD_TUH_RHPORT); + if (board_init_after_tusb) { + board_init_after_tusb(); + } + while (1) { // tinyusb host task @@ -410,6 +414,7 @@ static int _count_utf8_bytes(const uint16_t *buf, size_t len) { } static void print_utf16(uint16_t *temp_buf, size_t buf_len) { + if ((temp_buf[0] & 0xff) == 0) return; // empty size_t utf16_len = ((temp_buf[0] & 0xff) - 2) / sizeof(uint16_t); size_t utf8_len = (size_t) _count_utf8_bytes(temp_buf + 1, utf16_len); _convert_utf16le_to_utf8(temp_buf + 1, utf16_len, (uint8_t *) temp_buf, sizeof(uint16_t) * buf_len); |
