summaryrefslogtreecommitdiff
path: root/sys/src/9/zynq/timer.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-05 23:48:23 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-05 23:48:23 +0100
commit3cd7978a72baf77bfd08e6a6be2da497393a02a9 (patch)
treec069806ec22d490390383c06345e4d743f40891e /sys/src/9/zynq/timer.c
parent07c7fa6716a2f54f9feab3eb56f8677edb1b033d (diff)
zynq: fix usb by implementing delay() and give proper port speed in portstatus
Diffstat (limited to 'sys/src/9/zynq/timer.c')
-rw-r--r--sys/src/9/zynq/timer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/src/9/zynq/timer.c b/sys/src/9/zynq/timer.c
index 585fe295a..4edd2962d 100644
--- a/sys/src/9/zynq/timer.c
+++ b/sys/src/9/zynq/timer.c
@@ -23,13 +23,19 @@ enum {
uvlong timerhz;
void
-delay(int)
+microdelay(int n)
{
+ ulong now;
+
+ now = µs();
+ while(µs() - now < n);
}
void
-microdelay(int)
+delay(int n)
{
+ while(--n >= 0)
+ microdelay(1000);
}
uvlong