as3525: cache first read of enrd0 register

We need it for correct charger detection if we boot with charger plugged
because there is no edge interrupt

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26936 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-06-18 19:47:58 +00:00
parent 90bc818696
commit 61c90fbf3f

View file

@ -284,7 +284,8 @@ void ascodec_init(void)
VIC_INT_ENABLE = INTERRUPT_AUDIO; VIC_INT_ENABLE = INTERRUPT_AUDIO;
/* detect if USB was connected at startup since there is no transition */ /* detect if USB was connected at startup since there is no transition */
if(ascodec_read(AS3514_IRQ_ENRD0) & USB_STATUS) ascodec_enrd0_shadow = ascodec_read(AS3514_IRQ_ENRD0);
if(ascodec_enrd0_shadow & USB_STATUS)
usb_insert_int(); usb_insert_int();
else else
usb_remove_int(); usb_remove_int();