Skip to content

Allow more flexibility when configuring from config.h#38

Merged
devanlai merged 1 commit intodevanlai:masterfrom
keyboardio:jesse/override-vid-pid-url
Sep 4, 2021
Merged

Allow more flexibility when configuring from config.h#38
devanlai merged 1 commit intodevanlai:masterfrom
keyboardio:jesse/override-vid-pid-url

Conversation

@obra
Copy link
Copy Markdown
Contributor

@obra obra commented Sep 4, 2021

In order to be able to override the VID and PID for a device from inside
its config.h, config.h needs to be included before usb_conf.h

This lets you stick something like this in config.h and have it 'just work'


#define USB_VID 0x1209
#define USB_PID 0x2306

#define INNER_STRINGIFY(str) #str
#define STRINGIFY(str) INNER_STRINGIFY(str)

#define LANDING_PAGE_URL "dfu.keyboard.io?vid=" STRINGIFY(USB_VID) ";pid=" STRINGIFY(USB_PID)  ";version=" STRINGIFY(GIT_BUILD_SHA)

  • GIT_BUILD_SHA needs one more line in the Makefile or for it to be passed in on the commandline

In order to be able to override the VID and PID for a device from inside
its config.h, config.h needs to be included before usb_conf.h
@devanlai
Copy link
Copy Markdown
Owner

devanlai commented Sep 4, 2021

This seems pretty reasonable to me and it builds cleanly.

@devanlai devanlai merged commit 0173069 into devanlai:master Sep 4, 2021
twelho added a commit to twelho/dapboot that referenced this pull request Sep 10, 2021
…o to USB_DFU_ALTN

Assesses review feedback. I could initially not get the macros to work in
usb_conf.c, but they seem to work now even though the changes from pull devanlai#38
have been present in the development tree from the start.
twelho added a commit to twelho/dapboot that referenced this pull request Sep 10, 2021
…o to USB_DFU_ALTN

Assesses review feedback. I could initially not get the macros to work in
usb_conf.c, but they seem to work now even though the changes from pull devanlai#38
have been present in the development tree from the start.
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