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

Fix alignment for SAMD #211

Merged
merged 2 commits into from
Aug 9, 2020
Merged

Fix alignment for SAMD #211

merged 2 commits into from
Aug 9, 2020

Conversation

gdsports
Copy link
Contributor

@gdsports gdsports commented Mar 2, 2020

No description provided.

@NicoHood
Copy link
Owner

NicoHood commented Aug 2, 2020

Did you make sure this still works on avr?

@NicoHood
Copy link
Owner

NicoHood commented Aug 2, 2020

Can you please also adapt the changes to the other files? They all require this patch it seems
#194 (comment)

@gdsports
Copy link
Contributor Author

gdsports commented Aug 2, 2020

OK, I will fix for other devices and check to make sure it works on AVR. My plan is to add #define ATTRIBUTE_PACKED to HID-Settings.h. For AVR arch, the #define will do nothing so no change for AVR. For SAMD, it wll expand to force 1 byte alignment. Not sure if this is need for SAM (Due). I will check this also.

@gdsports
Copy link
Contributor Author

gdsports commented Aug 3, 2020

ATTRIBUTE_PACKED is defined in HID-Settings. For AVR, it does nothing. For SAMD and SAM, alignment is set to prevent the insertion of pad bytes.

The following examples tested on Linux Ubuntu 18.04 using an Arduino Zero (SAMD21). Not sure how to test raw HID and alternate keyboard. Examples also tested on an Arduino Leonardo.

  • consumer
  • gamepad
  • absolute mouse
  • improved mouse
  • boot keyboard
  • improved keyboard
  • keyboard led
  • nkrokeyboard

@NicoHood NicoHood merged commit 9310f02 into NicoHood:master Aug 9, 2020
@NicoHood
Copy link
Owner

NicoHood commented Aug 9, 2020

Thanks!

@gdsports gdsports deleted the gamepad branch August 11, 2020 19:44
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.

NKRO is no longer work in SAMD21 Cant get gamepad examples working on SAMD21
2 participants