summaryrefslogtreecommitdiff
path: root/common/cmd_misc.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-10-21 22:41:25 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-10-21 22:41:25 +0200
commit7b5cac0e1958173a390ae6d620a610028cad25f8 (patch)
treed045cc641164a0eca524a862831921790abb43eb /common/cmd_misc.c
parent6902df56a0b493f369153b09d11afcd74a580561 (diff)
parente9f1110051c2c2f8c005cf7fae54194f07197bac (diff)
downloadu-boot-imx-7b5cac0e1958173a390ae6d620a610028cad25f8.zip
u-boot-imx-7b5cac0e1958173a390ae6d620a610028cad25f8.tar.gz
u-boot-imx-7b5cac0e1958173a390ae6d620a610028cad25f8.tar.bz2
Merge with /home/wd/git/u-boot/master
Diffstat (limited to 'common/cmd_misc.c')
-rw-r--r--common/cmd_misc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/common/cmd_misc.c b/common/cmd_misc.c
index 674eafc..67ee9e8 100644
--- a/common/cmd_misc.c
+++ b/common/cmd_misc.c
@@ -31,6 +31,7 @@
int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
+ ulong start = get_timer(0);
ulong delay;
if (argc != 2) {
@@ -38,20 +39,18 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
- delay = simple_strtoul(argv[1], NULL, 10);
+ delay = simple_strtoul(argv[1], NULL, 10) * CFG_HZ;
- while (delay) {
- int i;
- for (i=0; i<1000; ++i) {
- if (ctrlc ()) {
- return (-1);
- }
- udelay (1000);
+ while (get_timer(start) < delay) {
+ if (ctrlc ()) {
+ return (-1);
}
- --delay;
+ udelay (100);
}
+
return 0;
}
+
/* Implemented in $(CPU)/interrupts.c */
#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);