summaryrefslogtreecommitdiffstats
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)
return;
}
}
+
+void target_udelay(int us)
+{
+ uint32_t cur = HW_DIGCTL_MICROSECONDS;
+ uint32_t end = cur + us;
+ if(cur < end)
+ while(HW_DIGCTL_MICROSECONDS < end) {}
+ else
+ while(HW_DIGCTL_MICROSECONDS >= cur) {}
+}
+
+void target_mdelay(int ms)
+{
+ return target_udelay(ms * 1000);
+}