summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-20 21:59:51 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-20 21:59:51 +0000
commitd2595ec0757607f094c758ed0f72f71cbe174955 (patch)
tree3e2a6e001eb64a743f0427ca4449d1ee05608e24 /firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
parent4633446517c002ed81cdbbc6acb9b8ffd9becc85 (diff)
downloadrockbox-d2595ec0757607f094c758ed0f72f71cbe174955.tar.gz
rockbox-d2595ec0757607f094c758ed0f72f71cbe174955.tar.bz2
rockbox-d2595ec0757607f094c758ed0f72f71cbe174955.zip
Onda VX747: improve the USB insertion detection
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21001 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/usb-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4740.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index e519efc4ab..5ba8dd6981 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -633,9 +633,15 @@ void usb_init_device(void)
}
#ifdef USB_GPIO_IRQ
+static unsigned long last_tick;
void USB_GPIO_IRQ(void)
{
- usb_status_event(usb_detect());
+ /* Prevent enabled-disabled bouncing */
+ if(current_tick - last_tick > HZ/16)
+ {
+ usb_status_event(usb_detect());
+ last_tick = current_tick;
+ }
}
#endif