summaryrefslogtreecommitdiff
path: root/src/class/hid
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-07-16 15:34:16 +0700
committerhathach <[email protected]>2020-07-16 15:34:16 +0700
commit5ca748a68e01deec929e846b7263cf736bf891fb (patch)
treebc47216ad0c8bccb370e09f4021758933d17c0a1 /src/class/hid
parentfea6fb73a1ef65afd848ec71d49d65cc87a9eec9 (diff)
rename CFG_TUD_MSC_BUFSIZE to CFG_TUD_MSC_EP_BUFSIZE
rename CFG_TUD_HID_BUFSIZE to CFG_TUD_HID_EP_BUFSIZE
Diffstat (limited to 'src/class/hid')
-rw-r--r--src/class/hid/hid_device.c8
-rw-r--r--src/class/hid/hid_device.h10
2 files changed, 12 insertions, 6 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c
index 526394d4a..c46fc591a 100644
--- a/src/class/hid/hid_device.c
+++ b/src/class/hid/hid_device.c
@@ -48,8 +48,8 @@ typedef struct
uint8_t idle_rate; // up to application to handle idle rate
uint16_t report_desc_len;
- CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_HID_BUFSIZE];
- CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_HID_BUFSIZE];
+ CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_HID_EP_BUFSIZE];
+ CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_HID_EP_BUFSIZE];
tusb_hid_descriptor_hid_t const * hid_descriptor;
} hidd_interface_t;
@@ -86,7 +86,7 @@ bool tud_hid_report(uint8_t report_id, void const* report, uint8_t len)
if (report_id)
{
- len = tu_min8(len, CFG_TUD_HID_BUFSIZE-1);
+ len = tu_min8(len, CFG_TUD_HID_EP_BUFSIZE-1);
p_hid->epin_buf[0] = report_id;
memcpy(p_hid->epin_buf+1, report, len);
@@ -94,7 +94,7 @@ bool tud_hid_report(uint8_t report_id, void const* report, uint8_t len)
}else
{
// If report id = 0, skip ID field
- len = tu_min8(len, CFG_TUD_HID_BUFSIZE);
+ len = tu_min8(len, CFG_TUD_HID_EP_BUFSIZE);
memcpy(p_hid->epin_buf, report, len);
}
diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h
index ad8c9ece4..ad26ab369 100644
--- a/src/class/hid/hid_device.h
+++ b/src/class/hid/hid_device.h
@@ -39,8 +39,14 @@
// Class Driver Default Configure & Validation
//--------------------------------------------------------------------+
-#ifndef CFG_TUD_HID_BUFSIZE
-#define CFG_TUD_HID_BUFSIZE 16
+#if !defined(CFG_TUD_HID_EP_BUFSIZE) & defined(CFG_TUD_HID_BUFSIZE)
+ // TODO warn user to use new name later on
+ // #warning CFG_TUD_HID_BUFSIZE is renamed to CFG_TUD_HID_EP_BUFSIZE
+ #define CFG_TUD_HID_EP_BUFSIZE CFG_TUD_HID_BUFSIZE
+#endif
+
+#ifndef CFG_TUD_HID_EP_BUFSIZE
+ #define CFG_TUD_HID_EP_BUFSIZE 16
#endif
//--------------------------------------------------------------------+