summaryrefslogtreecommitdiff
path: root/examples/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-11-19 11:32:44 +0700
committerhathach <[email protected]>2025-11-19 11:32:44 +0700
commitfd3161087d76c84fb21e8e2f2d30a81d6b11bfba (patch)
tree527172cad87c76062490e4ecc9277e21d3691224 /examples/host
parentbe4b38c54dc4e23af322ae04eda1f30e5ced0289 (diff)
parentd46f71bdde8b3160b0efaf83598d6b4cf596f787 (diff)
Merge branch 'refs/heads/master' into dwc2_ep0
# Conflicts: # examples/device/dfu/src/usb_descriptors.c # examples/device/dfu_runtime/src/usb_descriptors.c # src/device/usbd_control.c # src/portable/synopsys/dwc2/dcd_dwc2.c
Diffstat (limited to 'examples/host')
-rw-r--r--examples/host/cdc_msc_hid/src/app.h2
-rw-r--r--examples/host/cdc_msc_hid/src/cdc_app.c2
-rw-r--r--examples/host/cdc_msc_hid/src/hid_app.c1
-rw-r--r--examples/host/cdc_msc_hid/src/msc_app.c1
-rw-r--r--examples/host/cdc_msc_hid_freertos/only.txt2
-rw-r--r--examples/host/cdc_msc_hid_freertos/src/app.h2
-rw-r--r--examples/host/cdc_msc_hid_freertos/src/cdc_app.c8
-rw-r--r--examples/host/cdc_msc_hid_freertos/src/main.c2
-rw-r--r--examples/host/cdc_msc_hid_freertos/src/msc_app.c2
-rw-r--r--examples/host/device_info/only.txt4
-rw-r--r--examples/host/hid_controller/src/app.h2
-rw-r--r--examples/host/msc_file_explorer/src/main.c1
-rw-r--r--examples/host/msc_file_explorer/src/msc_app.h1
13 files changed, 19 insertions, 11 deletions
diff --git a/examples/host/cdc_msc_hid/src/app.h b/examples/host/cdc_msc_hid/src/app.h
index bf15c7bea..49783b4ae 100644
--- a/examples/host/cdc_msc_hid/src/app.h
+++ b/examples/host/cdc_msc_hid/src/app.h
@@ -26,6 +26,8 @@
#ifndef TUSB_TINYUSB_EXAMPLES_APP_H
#define TUSB_TINYUSB_EXAMPLES_APP_H
+#include <stdio.h>
+
void cdc_app_task(void);
void hid_app_task(void);
diff --git a/examples/host/cdc_msc_hid/src/cdc_app.c b/examples/host/cdc_msc_hid/src/cdc_app.c
index d3daedffc..4c2c5e807 100644
--- a/examples/host/cdc_msc_hid/src/cdc_app.c
+++ b/examples/host/cdc_msc_hid/src/cdc_app.c
@@ -51,7 +51,7 @@ void cdc_app_task(void) {
for (uint8_t idx = 0; idx < CFG_TUH_CDC; idx++) {
if (tuh_cdc_mounted(idx)) {
// console --> cdc interfaces
- if (count) {
+ if (count > 0) {
tuh_cdc_write(idx, buf, count);
tuh_cdc_write_flush(idx);
}
diff --git a/examples/host/cdc_msc_hid/src/hid_app.c b/examples/host/cdc_msc_hid/src/hid_app.c
index f6a83aeed..eb20356cb 100644
--- a/examples/host/cdc_msc_hid/src/hid_app.c
+++ b/examples/host/cdc_msc_hid/src/hid_app.c
@@ -22,7 +22,6 @@
* THE SOFTWARE.
*
*/
-
#include "bsp/board_api.h"
#include "tusb.h"
#include "app.h"
diff --git a/examples/host/cdc_msc_hid/src/msc_app.c b/examples/host/cdc_msc_hid/src/msc_app.c
index 0e9c99766..dd4e22d7f 100644
--- a/examples/host/cdc_msc_hid/src/msc_app.c
+++ b/examples/host/cdc_msc_hid/src/msc_app.c
@@ -23,6 +23,7 @@
*
*/
+#include <stdio.h>
#include "tusb.h"
//--------------------------------------------------------------------+
diff --git a/examples/host/cdc_msc_hid_freertos/only.txt b/examples/host/cdc_msc_hid_freertos/only.txt
index 576271aff..ef0a1ac96 100644
--- a/examples/host/cdc_msc_hid_freertos/only.txt
+++ b/examples/host/cdc_msc_hid_freertos/only.txt
@@ -1,4 +1,3 @@
-mcu:ESP32P4
mcu:LPC175X_6X
mcu:LPC177X_8X
mcu:LPC18XX
@@ -15,5 +14,6 @@ mcu:STM32F7
mcu:STM32H7
mcu:STM32H7RS
mcu:STM32N6
+family:espressif
family:samd21
family:samd5x_e5x
diff --git a/examples/host/cdc_msc_hid_freertos/src/app.h b/examples/host/cdc_msc_hid_freertos/src/app.h
index 960f7e8cc..8892a1b6b 100644
--- a/examples/host/cdc_msc_hid_freertos/src/app.h
+++ b/examples/host/cdc_msc_hid_freertos/src/app.h
@@ -26,6 +26,8 @@
#ifndef TUSB_TINYUSB_EXAMPLES_APP_H
#define TUSB_TINYUSB_EXAMPLES_APP_H
+#include <stdio.h>
+
void cdc_app_init(void);
void hid_app_init(void);
void msc_app_init(void);
diff --git a/examples/host/cdc_msc_hid_freertos/src/cdc_app.c b/examples/host/cdc_msc_hid_freertos/src/cdc_app.c
index 279efe7b7..0e0105980 100644
--- a/examples/host/cdc_msc_hid_freertos/src/cdc_app.c
+++ b/examples/host/cdc_msc_hid_freertos/src/cdc_app.c
@@ -46,9 +46,9 @@ static void cdc_app_task(void* param);
void cdc_app_init(void) {
#if configSUPPORT_STATIC_ALLOCATION
- xTaskCreateStatic(cdc_app_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
+ (void) xTaskCreateStatic(cdc_app_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
#else
- xTaskCreate(cdc_app_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, NULL);
+ (void) xTaskCreate(cdc_app_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, NULL);
#endif
}
@@ -57,7 +57,9 @@ static size_t get_console_inputs(uint8_t *buf, size_t bufsize) {
size_t count = 0;
while (count < bufsize) {
int ch = board_getchar();
- if (ch <= 0) break;
+ if (ch <= 0) {
+ break;
+ }
buf[count] = (uint8_t) ch;
count++;
diff --git a/examples/host/cdc_msc_hid_freertos/src/main.c b/examples/host/cdc_msc_hid_freertos/src/main.c
index 5dab2bed0..a41de2769 100644
--- a/examples/host/cdc_msc_hid_freertos/src/main.c
+++ b/examples/host/cdc_msc_hid_freertos/src/main.c
@@ -35,7 +35,7 @@
#define USBH_STACK_SIZE 4096
#else
// Increase stack size when debug log is enabled
- #define USBH_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
+ #define USBH_STACK_SIZE (configMINIMAL_STACK_SIZE * (CFG_TUSB_DEBUG ? 4 : 2))
#endif
diff --git a/examples/host/cdc_msc_hid_freertos/src/msc_app.c b/examples/host/cdc_msc_hid_freertos/src/msc_app.c
index a6e3ed4ee..fa864c364 100644
--- a/examples/host/cdc_msc_hid_freertos/src/msc_app.c
+++ b/examples/host/cdc_msc_hid_freertos/src/msc_app.c
@@ -23,6 +23,8 @@
*
*/
+#include <stdio.h>
+
#include "tusb.h"
#include "app.h"
diff --git a/examples/host/device_info/only.txt b/examples/host/device_info/only.txt
index 133a7c9a0..61a08f68d 100644
--- a/examples/host/device_info/only.txt
+++ b/examples/host/device_info/only.txt
@@ -1,7 +1,4 @@
mcu:CH32V20X
-mcu:ESP32S2
-mcu:ESP32S3
-mcu:ESP32P4
mcu:KINETIS_KL
mcu:LPC175X_6X
mcu:LPC177X_8X
@@ -21,5 +18,6 @@ mcu:STM32F7
mcu:STM32H7
mcu:STM32H7RS
mcu:STM32N6
+family:espressif
family:samd21
family:samd5x_e5x
diff --git a/examples/host/hid_controller/src/app.h b/examples/host/hid_controller/src/app.h
index 1f9015cd2..b4d072668 100644
--- a/examples/host/hid_controller/src/app.h
+++ b/examples/host/hid_controller/src/app.h
@@ -26,6 +26,8 @@
#ifndef TUSB_TINYUSB_EXAMPLES_APP_H
#define TUSB_TINYUSB_EXAMPLES_APP_H
+#include <stdio.h>
+
void hid_app_task(void);
#endif
diff --git a/examples/host/msc_file_explorer/src/main.c b/examples/host/msc_file_explorer/src/main.c
index 506c3b015..f9ec0ff5f 100644
--- a/examples/host/msc_file_explorer/src/main.c
+++ b/examples/host/msc_file_explorer/src/main.c
@@ -56,7 +56,6 @@
*/
#include <stdlib.h>
-#include <stdio.h>
#include <string.h>
#include "bsp/board_api.h"
diff --git a/examples/host/msc_file_explorer/src/msc_app.h b/examples/host/msc_file_explorer/src/msc_app.h
index 3ba03d0dc..a99da5b5c 100644
--- a/examples/host/msc_file_explorer/src/msc_app.h
+++ b/examples/host/msc_file_explorer/src/msc_app.h
@@ -27,6 +27,7 @@
#define MSC_APP_H
#include <stdbool.h>
+#include <stdio.h>
bool msc_app_init(void);
void msc_app_task(void);