Skip to content

Define udd_g_ctrlreq in main.c instead of usb_device.c#438

Closed
brentfpage wants to merge 1 commit intoespotek-org:masterfrom
brentfpage:firmware_udd_g_ctrl_declarations
Closed

Define udd_g_ctrlreq in main.c instead of usb_device.c#438
brentfpage wants to merge 1 commit intoespotek-org:masterfrom
brentfpage:firmware_udd_g_ctrl_declarations

Conversation

@brentfpage
Copy link
Copy Markdown
Contributor

@brentfpage brentfpage commented Mar 22, 2026

Update: turned out to be unrelated to the firmware (#439)

It turns out that removing the definition of udd_g_ctrlreq from main.c in the firmware caused mode-changes (e.g., Ch1 scope -> Ch1 and Ch2 scope) to no longer work. This was done in #404 because udd_g_ctrlreq was also defined in usb_device.c, which led to a compilation error. The definition in usb_device.c was kept.

This PR moves the sole definition of udd_g_ctrlreq from usb_device.c to main.c. Mode-changes now work again, but I'm at a loss as to why. How is main.c special apart from containing the entry point for the program (int main(void) {...})?

My bad – mode-changes are non-functional in the repo's current firmware source code (NOT in compiled versions that are packaged with the applications; those are functional), but I'm now almost certain that the revisions above don't fix things. I plan to next check the casts that I made in udc.c in #404 .

@brentfpage brentfpage marked this pull request as draft March 22, 2026 07:49
@brentfpage brentfpage closed this Mar 22, 2026
@brentfpage brentfpage deleted the firmware_udd_g_ctrl_declarations branch March 23, 2026 00:31
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.

1 participant