From 2c8c4ccc4719ec698b0de6a2afca351f49de66b5 Mon Sep 17 00:00:00 2001 From: flyingcys Date: Wed, 24 Apr 2024 05:40:22 +0800 Subject: [bsp]support cvitek sdhci drvier (#8849) support cvitek sdhci drvier --- libcpu/risc-v/t-head/c906/tick.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libcpu') diff --git a/libcpu/risc-v/t-head/c906/tick.c b/libcpu/risc-v/t-head/c906/tick.c index 0cb3c79be3..79891adb0e 100644 --- a/libcpu/risc-v/t-head/c906/tick.c +++ b/libcpu/risc-v/t-head/c906/tick.c @@ -49,3 +49,22 @@ int rt_hw_tick_init(void) return 0; } + +/** + * This function will delay for some us. + * + * @param us the delay time of us + */ +void rt_hw_us_delay(rt_uint32_t us) +{ + unsigned long start_time; + unsigned long end_time; + unsigned long run_time; + + start_time = get_ticks(); + end_time = start_time + us * (TIMER_CLK_FREQ / 1000000); + do + { + run_time = get_ticks(); + } while(run_time < end_time); +} \ No newline at end of file -- cgit v1.3.1