as3525: correctly detect usb status if we boot with USB plugged

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26118 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-05-17 21:17:46 +00:00
parent 949d99546e
commit 7dd0297a4d

View file

@ -190,6 +190,12 @@ void ascodec_init(void)
VIC_INT_ENABLE = INTERRUPT_AUDIO;
#endif
/* detect if USB was connected at startup since there is no transition */
if(ascodec_read(AS3514_IRQ_ENRD0) & USB_STATUS)
usb_insert_int();
else
usb_remove_int();
/* Generate irq for usb+charge status change */
ascodec_write(AS3514_IRQ_ENRD0,
#ifdef CONFIG_CHARGING /* m200v4 can't charge */