aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIzumemori <[email protected]>2024-08-13 01:06:24 +0200
committerGitHub <[email protected]>2024-08-13 09:06:24 +1000
commit40f2575b567234e78d2e13451fc90b7e04ef7049 (patch)
tree54caf673a06535f1886035c5374cc5d574dfaeee
parent45397a44e31b56189d35cbd77a20252cb2140aa1 (diff)
downloadqmk_firmware-40f2575b567234e78d2e13451fc90b7e04ef7049.tar.gz
qmk_firmware-40f2575b567234e78d2e13451fc90b7e04ef7049.zip
Fix NKRO and Mouse Emulation on arm_atsam (#23945)
-rw-r--r--tmk_core/protocol/arm_atsam/main_arm_atsam.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c
index 8abcfd6090..15592bf908 100644
--- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c
+++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c
@@ -88,7 +88,13 @@ void send_nkro(report_nkro_t *report) {
__disable_irq();
__DMB();
- memcpy(udi_hid_nkro_report, report, UDI_HID_NKRO_REPORT_SIZE);
+ /*
+ Skipping ahead `sizeof(report->report_id)` bytes
+ since `report_id` is not used by this driver
+ */
+ void *report_no_report_id = (void *)((char *)report + sizeof(report->report_id));
+
+ memcpy(udi_hid_nkro_report, report_no_report_id, UDI_HID_NKRO_REPORT_SIZE);
udi_hid_nkro_b_report_valid = 1;
udi_hid_nkro_send_report();
@@ -105,7 +111,17 @@ void send_mouse(report_mouse_t *report) {
__disable_irq();
__DMB();
+# ifdef MOUSE_SHARED_EP
+ /*
+ Skipping ahead `sizeof(report->report_id)` bytes
+ since `report_id` is not used by this driver
+ */
+ void *report_no_report_id = (void *)((char *)report + sizeof(report->report_id));
+
+ memcpy(udi_hid_mou_report, report_no_report_id, UDI_HID_MOU_REPORT_SIZE);
+# else
memcpy(udi_hid_mou_report, report, UDI_HID_MOU_REPORT_SIZE);
+# endif
udi_hid_mou_b_report_valid = 1;
udi_hid_mou_send_report();