Skip to content

[Core] STM32_USB_USE_OTG1 => USB_ENDPOINTS_ARE_REORDERABLE #17647

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

Merged
merged 5 commits into from
Aug 4, 2022

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Jul 12, 2022

Description

Creates a new define -- USB_ENDPOINTS_ARE_REORDERABLE -- which decouples bidirectional endpoints from the previously-(ab)used STM32_USB_USE_OTG1.

Also fixes make <kb>:<km>:dump_vars.

SHA1's match when comparing builds:

                           gmmk/gmmk2/p96/ansi:via - 8eaa98c6771c15326f943749d3185465d2d392e8
                            gmmk/gmmk2/p96/iso:via - 22f3d4a0d85e9d9be4d9dcc7426232ae75bb89c4

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@tzarc tzarc requested a review from a team July 12, 2022 22:35
@github-actions github-actions bot added core keymap via Adds via keymap and/or updates keyboard for via support labels Jul 12, 2022
@tzarc tzarc changed the title [Core] STM32_USB_USE_OTG1 => USB_HAS_BIDIRECTIONAL_ENDPOINTS [Core] STM32_USB_USE_OTG1 => USB_ENDPOINTS_ARE_REORDERABLE Jul 12, 2022
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the endpoint initialization code usb_main.c:

           .inout_ep_config =                                                                                                  \
                {                                                                                                               \
                    stream##_IN_MODE,      /* Interrupt EP */                                                                   \
                    NULL,                  /* SETUP packet notification callback */                                             \
                    qmkusbDataTransmitted, /* IN notification callback */                                                       \
                    qmkusbDataReceived,    /* OUT notification callback */                                                      \
                    stream##_EPSIZE,       /* IN maximum packet size */                                                         \
                    stream##_EPSIZE,       /* OUT maximum packet size */                                                        \
                    NULL,                  /* IN Endpoint state */                                                              \
                    NULL,                  /* OUT endpoint state */                                                             \
                    2,                     /* IN multiplier */                                                                  \
                    NULL                   /* SETUP buffer (not a SETUP endpoint) */                                            \
                },                                                                                                              \

the vendor usb lld driver specific part

                    2,                     /* IN multiplier */                                                                  \
                    NULL                   /* SETUP buffer (not a SETUP endpoint) */        

should be replaced with usb_lld_endpoint_fields define so it can be reusable for e.g. RP2040. (though I have to confirm that it works on that chip).

@KarlK90
Copy link
Member

KarlK90 commented Jul 13, 2022

Curiosity got the better of me: It is just two places usb_patch.txt but RP2040 sadly won't boot up. But doesn't really matter either with 32 endpoints available.

@tzarc tzarc force-pushed the bidirectional-endpoints-define branch from 57de830 to ffa6abb Compare July 14, 2022 16:09
@tzarc tzarc force-pushed the bidirectional-endpoints-define branch from ffa6abb to 4ae5db8 Compare August 4, 2022 10:59
@tzarc tzarc requested a review from KarlK90 August 4, 2022 11:00
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making it mcu independent.

@tzarc tzarc merged commit 543f54a into qmk:develop Aug 4, 2022
@tzarc tzarc deleted the bidirectional-endpoints-define branch August 4, 2022 11:05
nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core keymap via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants