diff options
Diffstat (limited to 'firmware/target/coldfire/mpio/hd200/usb-hd200.c')
-rw-r--r-- | firmware/target/coldfire/mpio/hd200/usb-hd200.c | 7 |
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) | |||
48 | 48 | ||
49 | void usb_enable(bool on) | 49 | void usb_enable(bool on) |
50 | { | 50 | { |
51 | /* one second timeout */ | ||
52 | unsigned char timeout = 10; | ||
51 | 53 | ||
52 | if(on) | 54 | if(on) |
53 | { | 55 | { |
@@ -64,7 +66,10 @@ void usb_enable(bool on) | |||
64 | 66 | ||
65 | and_l(~(1<<4),&GPIO1_OUT); /* GPIO36 low */ | 67 | and_l(~(1<<4),&GPIO1_OUT); /* GPIO36 low */ |
66 | 68 | ||
67 | while ( !(GPIO1_READ & (1<<5)) ) {} | 69 | while ( !(GPIO1_READ & (1<<5)) && timeout--) |
70 | { | ||
71 | sleep(HZ/10); | ||
72 | } | ||
68 | sleep(HZ); | 73 | sleep(HZ); |
69 | } | 74 | } |
70 | } | 75 | } |