1
0
Fork 0
forked from len0rd/rockbox

add usb_allowed_current() function, so powermanagement code can know when it's allowed to charge from usb

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17688 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2008-06-04 18:55:58 +00:00
parent ea840e2036
commit 27ad822a44
2 changed files with 18 additions and 0 deletions

View file

@ -57,5 +57,10 @@ int usb_core_ack_control(struct usb_ctrlrequest* req);
#ifdef HAVE_HOTSWAP #ifdef HAVE_HOTSWAP
void usb_core_hotswap_event(int volume,bool inserted); void usb_core_hotswap_event(int volume,bool inserted);
#endif #endif
#ifdef HAVE_USB_POWER
unsigned short usb_allowed_current(void);
#endif
#endif #endif

View file

@ -726,3 +726,16 @@ int usb_core_ack_control(struct usb_ctrlrequest* req)
return usb_drv_send(EP_CONTROL, NULL, 0); return usb_drv_send(EP_CONTROL, NULL, 0);
} }
#ifdef HAVE_USB_POWER
unsigned short usb_allowed_current()
{
if (usb_state == CONFIGURED)
{
return 500;
}
else
{
return 100;
}
}
#endif