From 13e01c7dca1e72097be1723676b086be29d0e622 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 6 Jun 2019 10:39:37 +0700 Subject: add TU_ prefix to compiler ATTR to prevent name conflict with application --- src/class/hid/hid.h | 6 +++--- src/class/hid/hid_device.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/class/hid') diff --git a/src/class/hid/hid.h b/src/class/hid/hid.h index 902c01ef5..04b255ea8 100644 --- a/src/class/hid/hid.h +++ b/src/class/hid/hid.h @@ -44,7 +44,7 @@ * @{ */ /// USB HID Descriptor -typedef struct ATTR_PACKED +typedef struct TU_ATTR_PACKED { uint8_t bLength; /**< Numeric expression that is the total size of the HID descriptor */ uint8_t bDescriptorType; /**< Constant name specifying type of HID descriptor. */ @@ -150,7 +150,7 @@ typedef enum * @{ */ /// Standard HID Boot Protocol Mouse Report. -typedef struct ATTR_PACKED +typedef struct TU_ATTR_PACKED { uint8_t buttons; /**< buttons mask for currently pressed buttons in the mouse. */ int8_t x; /**< Current delta x movement of the mouse. */ @@ -178,7 +178,7 @@ typedef enum * @{ */ /// Standard HID Boot Protocol Keyboard Report. -typedef struct ATTR_PACKED +typedef struct TU_ATTR_PACKED { uint8_t modifier; /**< Keyboard modifier (KEYBOARD_MODIFER_* masks). */ uint8_t reserved; /**< Reserved for OEM use, always set to 0. */ diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h index be7999770..75cc0969d 100644 --- a/src/class/hid/hid_device.h +++ b/src/class/hid/hid_device.h @@ -82,12 +82,12 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize); // Invoked when received SET_PROTOCOL request ( mode switch Boot <-> Report ) -ATTR_WEAK void tud_hid_boot_mode_cb(uint8_t boot_mode); +TU_ATTR_WEAK void tud_hid_boot_mode_cb(uint8_t boot_mode); // Invoked when received SET_IDLE request. return false will stall the request // - Idle Rate = 0 : only send report if there is changes, i.e skip duplication // - Idle Rate > 0 : skip duplication, but send at least 1 report every idle rate (in unit of 4 ms). -ATTR_WEAK bool tud_hid_set_idle_cb(uint8_t idle_rate); +TU_ATTR_WEAK bool tud_hid_set_idle_cb(uint8_t idle_rate); /* --------------------------------------------------------------------+ * HID Report Descriptor Template -- cgit v1.3.1