summaryrefslogtreecommitdiff
path: root/examples/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-11-10 11:02:20 +0700
committerhathach <[email protected]>2025-11-10 11:02:20 +0700
commit6364a4df7a6e3a2b3583fe11a88665f06d18628b (patch)
tree45e0a0b2f8acfd811cce050475fc828bc2e034d2 /examples/host
parent989acc15287f86bb1fd3f262d69b3dc9c9c28da8 (diff)
parent96f35fc0a559aa09da70e0dede5a43081615723f (diff)
Merge branch 'master' into fork/c1570/improved_docs
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/src/tusb_config.h6
-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/cdc_msc_hid_freertos/src/tusb_config.h6
-rw-r--r--examples/host/device_info/only.txt4
-rw-r--r--examples/host/hid_controller/src/app.h2
-rw-r--r--examples/host/hid_controller/src/tusb_config.h6
-rw-r--r--examples/host/msc_file_explorer/src/main.c1
-rw-r--r--examples/host/msc_file_explorer/src/msc_app.h1
-rw-r--r--examples/host/msc_file_explorer/src/tusb_config.h6
17 files changed, 31 insertions, 23 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/src/tusb_config.h b/examples/host/cdc_msc_hid/src/tusb_config.h
index 2f8cb5e03..75de3511c 100644
--- a/examples/host/cdc_msc_hid/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid/src/tusb_config.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
+#ifndef TUSB_CONFIG_H_
+#define TUSB_CONFIG_H_
#ifdef __cplusplus
extern "C" {
@@ -134,4 +134,4 @@
}
#endif
-#endif /* _TUSB_CONFIG_H_ */
+#endif /* TUSB_CONFIG_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/cdc_msc_hid_freertos/src/tusb_config.h b/examples/host/cdc_msc_hid_freertos/src/tusb_config.h
index 3cdb227e2..8583e7176 100644
--- a/examples/host/cdc_msc_hid_freertos/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid_freertos/src/tusb_config.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
+#ifndef TUSB_CONFIG_H_
+#define TUSB_CONFIG_H_
#ifdef __cplusplus
extern "C" {
@@ -139,4 +139,4 @@
}
#endif
-#endif /* _TUSB_CONFIG_H_ */
+#endif /* TUSB_CONFIG_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/hid_controller/src/tusb_config.h b/examples/host/hid_controller/src/tusb_config.h
index 351fe0178..a5c202fda 100644
--- a/examples/host/hid_controller/src/tusb_config.h
+++ b/examples/host/hid_controller/src/tusb_config.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
+#ifndef TUSB_CONFIG_H_
+#define TUSB_CONFIG_H_
#ifdef __cplusplus
extern "C" {
@@ -119,4 +119,4 @@
}
#endif
-#endif /* _TUSB_CONFIG_H_ */
+#endif /* TUSB_CONFIG_H_ */
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);
diff --git a/examples/host/msc_file_explorer/src/tusb_config.h b/examples/host/msc_file_explorer/src/tusb_config.h
index c1829c300..a9d24c89f 100644
--- a/examples/host/msc_file_explorer/src/tusb_config.h
+++ b/examples/host/msc_file_explorer/src/tusb_config.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef _TUSB_CONFIG_H_
-#define _TUSB_CONFIG_H_
+#ifndef TUSB_CONFIG_H_
+#define TUSB_CONFIG_H_
#ifdef __cplusplus
extern "C" {
@@ -118,4 +118,4 @@
}
#endif
-#endif /* _TUSB_CONFIG_H_ */
+#endif /* TUSB_CONFIG_H_ */