summaryrefslogtreecommitdiff
path: root/examples/device/cdc_uac2
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-11 16:20:14 +0700
committerhathach <[email protected]>2026-03-11 16:20:14 +0700
commitd13f600721671a603579350be1e9c935a0d40547 (patch)
treefbb9402972c3a2925efc554b94e79855d7364dce /examples/device/cdc_uac2
parent5efa72cd57325615efae6a26ff8c9fe8a9c7b3b5 (diff)
parentf2450788b13f8424b2f75e33240ed21329a875ad (diff)
Merge branch 'master' into zlp-hs-on-fs
Diffstat (limited to 'examples/device/cdc_uac2')
-rw-r--r--examples/device/cdc_uac2/src/main.c2
-rw-r--r--examples/device/cdc_uac2/src/tusb_config.h2
-rw-r--r--examples/device/cdc_uac2/src/uac2_app.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/device/cdc_uac2/src/main.c b/examples/device/cdc_uac2/src/main.c
index 22c462be7..cb7b3a142 100644
--- a/examples/device/cdc_uac2/src/main.c
+++ b/examples/device/cdc_uac2/src/main.c
@@ -65,8 +65,6 @@ int main(void)
// printf("Hello, world!\r\n");
#endif
}
-
- return 0;
}
//--------------------------------------------------------------------+
diff --git a/examples/device/cdc_uac2/src/tusb_config.h b/examples/device/cdc_uac2/src/tusb_config.h
index b7ece8b7c..5eb2e8f74 100644
--- a/examples/device/cdc_uac2/src/tusb_config.h
+++ b/examples/device/cdc_uac2/src/tusb_config.h
@@ -160,6 +160,8 @@ extern "C" {
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
// CDC Endpoint transfer buffer size, more is faster
+// Leave it as default size (512 for HS, 64 for FS) unless your host application
+// is able to send ZLP (Zero Length Packet) to terminate transfer !
#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#ifdef __cplusplus
diff --git a/examples/device/cdc_uac2/src/uac2_app.c b/examples/device/cdc_uac2/src/uac2_app.c
index 73a262d0c..7760c402b 100644
--- a/examples/device/cdc_uac2/src/uac2_app.c
+++ b/examples/device/cdc_uac2/src/uac2_app.c
@@ -66,7 +66,7 @@ uint8_t current_resolution;
// In a real application, this would be replaced with actual I2S send/receive callback.
void audio_task(void) {
static uint32_t start_ms = 0;
- uint32_t curr_ms = board_millis();
+ uint32_t curr_ms = tusb_time_millis_api();
if (start_ms == curr_ms) {
return; // not enough time
}
@@ -303,7 +303,7 @@ void led_blinking_task(void)
static bool led_state = false;
// Blink every interval ms
- if (board_millis() - start_ms < blink_interval_ms) {
+ if (tusb_time_millis_api() - start_ms < blink_interval_ms) {
return;
}
start_ms += blink_interval_ms;