From 2fe6b74e9001eb2ea0d09e5617dd7d91851ae072 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 15 Apr 2017 10:18:56 -0400 Subject: [PATCH] atmel-samd: HID report descriptor for mouse had to be COMPILER_WORD_ALIGNED. --- .../services/usb/class/hid/device/mouse/udi_hid_mouse.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atmel-samd/asf/common/services/usb/class/hid/device/mouse/udi_hid_mouse.c b/atmel-samd/asf/common/services/usb/class/hid/device/mouse/udi_hid_mouse.c index bd82022ffe..07402f214c 100644 --- a/atmel-samd/asf/common/services/usb/class/hid/device/mouse/udi_hid_mouse.c +++ b/atmel-samd/asf/common/services/usb/class/hid/device/mouse/udi_hid_mouse.c @@ -119,6 +119,12 @@ static bool udi_hid_mouse_setreport(void); //@} //! HID report descriptor for standard HID mouse +//*** CircuitPython: added COMPILER_WORD_ALIGNED to ensure descriptor is word aligned. +// Without this, descriptor sent to host was garbled. +// It appears this is necessary but frequently omitted in UDC_DESC_STORAGE declarations +// in ASF code. +// See comments about buffer alignment in asf/common/services/usb/udc/udd.h +COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udi_hid_mouse_report_desc_t udi_hid_mouse_report_desc = { { 0x05, 0x01, /* Usage Page (Generic Desktop), */