diff options
-rw-r--r-- | firmware/export/usb_core.h | 5 | ||||
-rw-r--r-- | firmware/usbstack/usb_core.c | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h index 3629645d53..a6cf086e18 100644 --- a/firmware/export/usb_core.h +++ b/firmware/export/usb_core.h @@ -57,5 +57,10 @@ int usb_core_ack_control(struct usb_ctrlrequest* req); #ifdef HAVE_HOTSWAP void usb_core_hotswap_event(int volume,bool inserted); #endif + +#ifdef HAVE_USB_POWER +unsigned short usb_allowed_current(void); +#endif + #endif diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c index 759a342dd2..654ed95b4d 100644 --- a/firmware/usbstack/usb_core.c +++ b/firmware/usbstack/usb_core.c @@ -726,3 +726,16 @@ int usb_core_ack_control(struct usb_ctrlrequest* req) 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 |