mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-29 10:59:42 +02:00
atusb/fw/: define USB bus current (40 mA) in board.h based on measured value
The measured values are: board idle, looping 9 mA LED on + 5 mA TX CW (+3 dBm) +14 mA ------ 28 mA ====== Adding a margin of 12 mA, we get 40 mA. DFU used 30 mA so far, the application 50 mA. - board.h (BOARD_MAX_mA): define maximum USB bus current - descr.c (config_descriptor), usb/dfu.c (config_descriptor): use BOARD_MAX_mA for bMaxPower instead of hard-coding values
This commit is contained in:
parent
89d13ce8f8
commit
3cc92cc4a6
@ -62,6 +62,8 @@
|
|||||||
#define DFU_USB_PRODUCT USB_PRODUCT
|
#define DFU_USB_PRODUCT USB_PRODUCT
|
||||||
|
|
||||||
|
|
||||||
|
#define BOARD_MAX_mA 40
|
||||||
|
|
||||||
#define HAS_BOARD_SERNUM
|
#define HAS_BOARD_SERNUM
|
||||||
|
|
||||||
extern uint8_t board_sernum[42];
|
extern uint8_t board_sernum[42];
|
||||||
|
@ -61,7 +61,7 @@ const uint8_t config_descriptor[] = {
|
|||||||
1, /* bConfigurationValue (> 0 !) */
|
1, /* bConfigurationValue (> 0 !) */
|
||||||
0, /* iConfiguration */
|
0, /* iConfiguration */
|
||||||
USB_ATTR_BUS_POWERED, /* bmAttributes */
|
USB_ATTR_BUS_POWERED, /* bmAttributes */
|
||||||
50/2, /* bMaxPower (50 mA) */
|
((BOARD_MAX_mA)+1)/2, /* bMaxPower */
|
||||||
|
|
||||||
/* Interface #0 */
|
/* Interface #0 */
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ const uint8_t config_descriptor[] = {
|
|||||||
0, /* iConfiguration */
|
0, /* iConfiguration */
|
||||||
// USB_ATTR_SELF_POWERED | USB_ATTR_BUS_POWERED,
|
// USB_ATTR_SELF_POWERED | USB_ATTR_BUS_POWERED,
|
||||||
USB_ATTR_BUS_POWERED, /* bmAttributes */
|
USB_ATTR_BUS_POWERED, /* bmAttributes */
|
||||||
15, /* bMaxPower */
|
((BOARD_MAX_mA)+1)/2, /* bMaxPower */
|
||||||
|
|
||||||
/* Interface #0 */
|
/* Interface #0 */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user