Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB Device Descriptor Max Power is not configurable #504 #505

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Props3D
Copy link

@Props3D Props3D commented Mar 8, 2025

Looking at Adafruit_USBD_Device.cpp, there's a define macro for the Max Power but it's never used.

at line 85:

#ifndef USB_CONFIG_POWER
#define USB_CONFIG_POWER 100
#endif

At line 186, the power is hardcoded to 100:

  uint8_t const dev_cfg[sizeof(tusb_desc_configuration_t)] = {
      TUD_CONFIG_DESCRIPTOR(1, 0, 0, sizeof(tusb_desc_configuration_t),
                            TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP | TU_BIT(7),
                            100),
  };

I simply replaced the 100 with USB_CONFIG_POWER.

Replacing hardcoded value with define macro
@SmittyHalibut
Copy link

I almost added this change to #493 too. I like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants