Skip to content

Commit e58f0eb

Browse files
sandeepmistryfacchinm
authored andcommitted
[bootloader] Allow current USB current values
1 parent 9398c53 commit e58f0eb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bootloaders/zero/board_definitions_arduino_mkrvidor4000.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define USB_VID_LOW 0x41
2828
#define USB_PID_HIGH 0x00
2929
#define USB_PID_LOW 0x56
30+
#define USB_CURRENT_MA 500
3031

3132
/*
3233
* If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by

bootloaders/zero/sam_ba_usb.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
#include "board_driver_usb.h"
2525
#include "sam_ba_cdc.h"
2626

27+
#ifndef USB_CURRENT_MA
28+
// default USB current, report using 100mA, enough for a bootloader
29+
#define USB_CURRENT_MA 100
30+
#endif
31+
2732
/* This data array will be copied into SRAM as its length is inferior to 64 bytes,
2833
* and so can stay in flash.
2934
*/
@@ -67,7 +72,7 @@ char cfgDescriptor[] =
6772
0x01, // CbConfigurationValue
6873
0x00, // CiConfiguration
6974
0x80, // CbmAttributes Bus powered without remote wakeup: 0x80, Self powered without remote wakeup: 0xc0
70-
0x32, // CMaxPower, report using 100mA, enough for a bootloader
75+
(USB_CURRENT_MA / 2), // CMaxPower
7176

7277
/* Communication Class Interface Descriptor Requirement */
7378
0x09, // bLength

0 commit comments

Comments
 (0)