1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 14:10:37 +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:
Werner Almesberger 2011-06-10 18:48:16 -03:00
parent 89d13ce8f8
commit 3cc92cc4a6
3 changed files with 4 additions and 2 deletions

View File

@ -62,6 +62,8 @@
#define DFU_USB_PRODUCT USB_PRODUCT
#define BOARD_MAX_mA 40
#define HAS_BOARD_SERNUM
extern uint8_t board_sernum[42];

View File

@ -61,7 +61,7 @@ const uint8_t config_descriptor[] = {
1, /* bConfigurationValue (> 0 !) */
0, /* iConfiguration */
USB_ATTR_BUS_POWERED, /* bmAttributes */
50/2, /* bMaxPower (50 mA) */
((BOARD_MAX_mA)+1)/2, /* bMaxPower */
/* Interface #0 */

View File

@ -73,7 +73,7 @@ const uint8_t config_descriptor[] = {
0, /* iConfiguration */
// USB_ATTR_SELF_POWERED | USB_ATTR_BUS_POWERED,
USB_ATTR_BUS_POWERED, /* bmAttributes */
15, /* bMaxPower */
((BOARD_MAX_mA)+1)/2, /* bMaxPower */
/* Interface #0 */