-
-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Implement NKRO for VUSB #12010
Implement NKRO for VUSB #12010
Conversation
V-USB is limited to 8-byte endpoints, but there is already precedent for transferring larger data by issuing multiple interrupt transfers in a row. With a dedicated NKRO interface, we can avoid a report ID, so the report would be 16 bytes - fitting right into only two transfers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a dedicated NKRO interface, we can avoid a report ID, so the report would be 16 bytes - fitting right into only two transfers.
This would be nice, but I plan to unify the USB descriptors based on the ones used for LUFA & ChibiOS, so there is not much point in doing that when it'll eventually be merged into the shared interface anyway.
Then maybe there should be a |
The problem is that the microcontrollers that QMK supports only have so many endpoints, VUSB even less, which is why the shared EP stuff exists in the first place. I don't really see much of a use case for a dedicated NKRO interface, but, yes, it could be done. |
Thank you for your contribution! |
COMMAND_ENABLE = yes # Commands for debug and configuration | ||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
NKRO_ENABLE = yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roll these back, optionally putting them into a personal keymap instead.
No need to change these defaults.
I'll test this PR out and then take it over if and try to upstream it, if the code works. |
This code also has an undocumented limitation: only keycodes in the
(Although |
Any word on when this patch will be merged into QMK? I applied the patch to the most recent version and it seems to work, testing on the atmega382p v-usb keyboard plaid.
The use case for me is stenography which all but requires NKRO. Unfortunately QMK's stenography protocol support (though either TX Bolt or GeminiPR) doesn't work because v-usb does not currently have support for virtser (issue #13834). It is true that v-usb only has 3 endpoints, but one only really needs the standard/boot keyboard endpoint, mouse keys and extra keys which is combined into a single endpoint, and the new NKRO endpoint. I think other hardware USB protocols are able to pack mouse, extra keys, and NKRO into a single endpoint which is nice, but not necessary. Just having boot keyboard, mouse/extra keys, and NKRO is sufficient for my use case. Lastly, merging this patch would resolve issue #2775 and pull request #9054. Searching for "v-usb nkro" in the issues made me think that NKRO is impossible over v-usb and the fact that QMK will suppress the build option if one attempts to enable it reinforces this mistaken belief. |
I am aware of that, this is what the LUFA and ChibiOS code does - NKRO, mouse and media keys share a single endpoint. There is a define for giving mousekeys its own endpoint as there are/were apparently some issues with it. The person above was talking about splitting off the NKRO report in a similar way, which is technically possible, but very limiting for V-USB boards. As for virtser, to be honest, I don't see it being possible on V-USB precisely due to this endpoint limitation. It requires two distinct IN endpoints and one OUT. Again, technically there is no problem with this, but you will have used up all three IN endpoints with 6KRO and the two virtser ones, with no space left for NKRO. |
Closing in favour of #22398 now the codebase has moved on. |
V-USB is limited to 8-byte endpoints, but there is already precedent for transferring larger data by issuing multiple interrupt transfers in a row.
With a dedicated NKRO interface, we can avoid a report ID, so the report would be 16 bytes - fitting right into only two transfers.
Enabled on spiderisland/split78 where it was tested.