summaryrefslogtreecommitdiff
path: root/utils/hwstub/stub/stmp/target.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-09-10 23:07:40 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-09-10 23:19:34 +0200
commit3b6d2ac28afc1c987e480790fff1b652f3ade5cd (patch)
treebe89e88b7f2b23acef34e22aa8f94b97104b6328 /utils/hwstub/stub/stmp/target.c
parentacf3af4ae305a70a8f3da777d0dffcccac6db6f7 (diff)
downloadrockbox-3b6d2ac28afc1c987e480790fff1b652f3ade5cd.tar.gz
rockbox-3b6d2ac28afc1c987e480790fff1b652f3ade5cd.zip
hwstub: add delay functions, and plain binary/sb file generation
Change-Id: Idbedb9277b355edcd93975ec5a268428c7b89633
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}