summaryrefslogtreecommitdiff
path: root/examples/host/bare_api
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-08-04 12:07:39 +0700
committerhathach <[email protected]>2023-08-04 12:07:39 +0700
commit81aca17d6e9a17d5f37e7ff04988257a0be4ec3e (patch)
tree22cac9af80dae48e558490cb068132d1c7a679f0 /examples/host/bare_api
parentcfc146e18fe2aa0df4d77d435d4a4b7053361cd7 (diff)
parent61f00c0c4dab0469c2e8ebad8eda1a26ae742e46 (diff)
Merge branch 'master' into blackf407VE
Diffstat (limited to 'examples/host/bare_api')
-rw-r--r--examples/host/bare_api/only.txt1
-rw-r--r--examples/host/bare_api/src/main.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/examples/host/bare_api/only.txt b/examples/host/bare_api/only.txt
index 45da6c3f2..f8aa2186f 100644
--- a/examples/host/bare_api/only.txt
+++ b/examples/host/bare_api/only.txt
@@ -9,3 +9,4 @@ mcu:MIMXRT11XX
mcu:RP2040
mcu:MSP432E4
mcu:RX65X
+mcu:RAXXX
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);