diff options
| author | flyingcys <[email protected]> | 2024-04-24 05:40:22 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-24 05:40:22 +0800 |
| commit | 2c8c4ccc4719ec698b0de6a2afca351f49de66b5 (patch) | |
| tree | 554cb5c90e99e2e8563407b955d80d2976927af3 /libcpu | |
| parent | 62544df5649194eee0456912e23a7c71b0316466 (diff) | |
[bsp]support cvitek sdhci drvier (#8849)
support cvitek sdhci drvier
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/risc-v/t-head/c906/tick.c | 19 |
1 files changed, 19 insertions, 0 deletions
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 |
