summaryrefslogtreecommitdiff
path: root/utils/hwstub/stub/stmp/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/stub/stmp/target.c')
-rw-r--r--utils/hwstub/stub/stmp/target.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/hwstub/stub/stmp/target.c b/utils/hwstub/stub/stmp/target.c
index 390480a71c..9b005063bd 100644
--- a/utils/hwstub/stub/stmp/target.c
+++ b/utils/hwstub/stub/stmp/target.c
@@ -273,3 +273,18 @@ void target_exit(void)
273 return; 273 return;
274 } 274 }
275} 275}
276
277void target_udelay(int us)
278{
279 uint32_t cur = HW_DIGCTL_MICROSECONDS;
280 uint32_t end = cur + us;
281 if(cur < end)
282 while(HW_DIGCTL_MICROSECONDS < end) {}
283 else
284 while(HW_DIGCTL_MICROSECONDS >= cur) {}
285}
286
287void target_mdelay(int ms)
288{
289 return target_udelay(ms * 1000);
290}