summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-02 11:36:47 +0700
committerhathach <[email protected]>2026-03-02 11:36:47 +0700
commitac172f7799852bb0fc67246ca26d50e6cc379bd8 (patch)
treed4542725f5f9bb5ccd9b1d2d2aa6880089ac2297
parent8444c25ab6bc841bad81fd04afc1e66a9d57a115 (diff)
fix board test without tusb_time_millis_api()
-rw-r--r--hw/bsp/espressif/boards/family.c10
-rw-r--r--hw/bsp/rp2040/family.c12
2 files changed, 22 insertions, 0 deletions
diff --git a/hw/bsp/espressif/boards/family.c b/hw/bsp/espressif/boards/family.c
index a837417f4..623cdb8b9 100644
--- a/hw/bsp/espressif/boards/family.c
+++ b/hw/bsp/espressif/boards/family.c
@@ -351,5 +351,15 @@ bool tuh_max3421_spi_xfer_api(uint8_t rhport, uint8_t const* tx_buf, uint8_t* rx
ESP_ERROR_CHECK(spi_device_transmit(max3421_spi, &xact));
return true;
}
+#endif
+
+// board test example does not use both device and host stack
+#if !CFG_TUD_ENABLED && !CFG_TUH_ENABLED
+TU_ATTR_WEAK uint32_t tusb_time_millis_api(void) {
+ return osal_time_millis();
+}
+TU_ATTR_WEAK void tusb_time_delay_ms_api(uint32_t ms) {
+ osal_task_delay(ms);
+}
#endif
diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c
index a51b3f758..d68b13dd1 100644
--- a/hw/bsp/rp2040/family.c
+++ b/hw/bsp/rp2040/family.c
@@ -377,3 +377,15 @@ bool tuh_max3421_spi_xfer_api(uint8_t rhport, uint8_t const* tx_buf, uint8_t* rx
}
#endif
+
+
+// board test example does not use both device and host stack
+#if !CFG_TUD_ENABLED && !CFG_TUH_ENABLED
+TU_ATTR_WEAK uint32_t tusb_time_millis_api(void) {
+ return osal_time_millis();
+}
+
+TU_ATTR_WEAK void tusb_time_delay_ms_api(uint32_t ms) {
+ osal_task_delay(ms);
+}
+#endif