Skip to content

Commit 2fe6b74

Browse files
committed
atmel-samd: HID report descriptor for mouse had to be COMPILER_WORD_ALIGNED.
1 parent b653c3c commit 2fe6b74

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

atmel-samd/asf/common/services/usb/class/hid/device/mouse/udi_hid_mouse.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ static bool udi_hid_mouse_setreport(void);
119119
//@}
120120

121121
//! HID report descriptor for standard HID mouse
122+
//*** CircuitPython: added COMPILER_WORD_ALIGNED to ensure descriptor is word aligned.
123+
// Without this, descriptor sent to host was garbled.
124+
// It appears this is necessary but frequently omitted in UDC_DESC_STORAGE declarations
125+
// in ASF code.
126+
// See comments about buffer alignment in asf/common/services/usb/udc/udd.h
127+
COMPILER_WORD_ALIGNED
122128
UDC_DESC_STORAGE udi_hid_mouse_report_desc_t udi_hid_mouse_report_desc = {
123129
{
124130
0x05, 0x01, /* Usage Page (Generic Desktop), */

0 commit comments

Comments
 (0)