summaryrefslogtreecommitdiffstats
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/coldfire/mpio/hd200/usb-hd200.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/target/coldfire/mpio/hd200/usb-hd200.c b/firmware/target/coldfire/mpio/hd200/usb-hd200.c
index 9a82359966..9717ef3205 100644
--- a/firmware/target/coldfire/mpio/hd200/usb-hd200.c
+++ b/firmware/target/coldfire/mpio/hd200/usb-hd200.c
@@ -48,6 +48,8 @@ int usb_detect(void)
void usb_enable(bool on)
{
+ /* one second timeout */
+ unsigned char timeout = 10;
if(on)
{
@@ -64,7 +66,10 @@ void usb_enable(bool on)
and_l(~(1<<4),&GPIO1_OUT); /* GPIO36 low */
- while ( !(GPIO1_READ & (1<<5)) ) {}
+ while ( !(GPIO1_READ & (1<<5)) && timeout--)
+ {
+ sleep(HZ/10);
+ }
sleep(HZ);
}
}