diff options
| author | HiFiPhile <[email protected]> | 2025-09-12 11:39:41 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-09-12 11:39:41 +0200 |
| commit | 5755afa690f242988c02932068339ad5ffc4404e (patch) | |
| tree | 499992bf6e696b354d5faea58e75aeb5db842e39 /src/class | |
| parent | d3ab48bd79e53adbe763c924508edda1d60a968d (diff) | |
Fix some IAR warnings
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/class')
| -rw-r--r-- | src/class/hid/hid_host.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/class/hid/hid_host.c b/src/class/hid/hid_host.c index 56fccdd22..a44c83433 100644 --- a/src/class/hid/hid_host.c +++ b/src/class/hid/hid_host.c @@ -519,7 +519,8 @@ bool hidh_open(uint8_t rhport, uint8_t daddr, tusb_desc_interface_t const* desc_ // Assume bNumDescriptors = 1 p_hid->report_desc_type = desc_hid->bReportType; - p_hid->report_desc_len = tu_unaligned_read16(&desc_hid->wReportLength); + // Use offsetof to avoid pointer to the odd/misaligned address + p_hid->report_desc_len = tu_unaligned_read16((uint8_t const*)desc_hid + offsetof(tusb_hid_descriptor_hid_t, wReportLength)); // Per HID Specs: default is Report protocol, though we will force Boot protocol when set_config p_hid->protocol_mode = _hidh_default_protocol; |
