aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/usbh/hal_usbh_hid.c
diff options
context:
space:
mode:
authorDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-06 10:21:00 -0300
committerDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-06 10:21:00 -0300
commit9349f7400432ae5a999c524b89da8a835da59b08 (patch)
treecbfdc9866114d3169475724232bc34e260d8a22d /os/hal/src/usbh/hal_usbh_hid.c
parente1357dab69fed9b5eacb40ba18978729f5844566 (diff)
downloadChibiOS-Contrib-9349f7400432ae5a999c524b89da8a835da59b08.tar.gz
ChibiOS-Contrib-9349f7400432ae5a999c524b89da8a835da59b08.tar.bz2
ChibiOS-Contrib-9349f7400432ae5a999c524b89da8a835da59b08.zip
Clean up request type helpers
Diffstat (limited to 'os/hal/src/usbh/hal_usbh_hid.c')
-rw-r--r--os/hal/src/usbh/hal_usbh_hid.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/os/hal/src/usbh/hal_usbh_hid.c b/os/hal/src/usbh/hal_usbh_hid.c
index 9e248cb..e98dff7 100644
--- a/os/hal/src/usbh/hal_usbh_hid.c
+++ b/os/hal/src/usbh/hal_usbh_hid.c
@@ -262,9 +262,8 @@ usbh_urbstatus_t usbhhidGetReport(USBHHIDDriver *hidp,
osalDbgCheck(hidp);
osalDbgAssert((uint8_t)report_type <= USBHHID_REPORTTYPE_FEATURE, "wrong report type");
return usbhControlRequest(hidp->dev,
- USBH_CLASSIN(USBH_REQTYPE_INTERFACE, USBH_HID_REQ_GET_REPORT,
- ((uint8_t)report_type << 8) | report_id, hidp->ifnum),
- len, data);
+ USBH_REQTYPE_CLASSIN(USBH_REQTYPE_RECIP_INTERFACE), USBH_HID_REQ_GET_REPORT,
+ ((uint8_t)report_type << 8) | report_id, hidp->ifnum, len, data);
}
usbh_urbstatus_t usbhhidSetReport(USBHHIDDriver *hidp,
@@ -273,38 +272,37 @@ usbh_urbstatus_t usbhhidSetReport(USBHHIDDriver *hidp,
osalDbgCheck(hidp);
osalDbgAssert((uint8_t)report_type <= USBHHID_REPORTTYPE_FEATURE, "wrong report type");
return usbhControlRequest(hidp->dev,
- USBH_CLASSOUT(USBH_REQTYPE_INTERFACE, USBH_HID_REQ_SET_REPORT,
- ((uint8_t)report_type << 8) | report_id, hidp->ifnum),
- len, (void *)data);
+ USBH_REQTYPE_CLASSOUT(USBH_REQTYPE_RECIP_INTERFACE), USBH_HID_REQ_SET_REPORT,
+ ((uint8_t)report_type << 8) | report_id, hidp->ifnum, len, (void *)data);
}
usbh_urbstatus_t usbhhidGetIdle(USBHHIDDriver *hidp, uint8_t report_id, uint8_t *duration) {
osalDbgCheck(hidp);
return usbhControlRequest(hidp->dev,
- USBH_CLASSIN(USBH_REQTYPE_INTERFACE, USBH_HID_REQ_GET_IDLE, report_id, hidp->ifnum),
- 1, duration);
+ USBH_REQTYPE_CLASSIN(USBH_REQTYPE_RECIP_INTERFACE), USBH_HID_REQ_GET_IDLE,
+ report_id, hidp->ifnum, 1, duration);
}
usbh_urbstatus_t usbhhidSetIdle(USBHHIDDriver *hidp, uint8_t report_id, uint8_t duration) {
osalDbgCheck(hidp);
return usbhControlRequest(hidp->dev,
- USBH_CLASSOUT(USBH_REQTYPE_INTERFACE, USBH_HID_REQ_SET_IDLE,
- (duration << 8) | report_id, hidp->ifnum), 0, NULL);
+ USBH_REQTYPE_CLASSOUT(USBH_REQTYPE_RECIP_INTERFACE), USBH_HID_REQ_SET_IDLE,
+ (duration << 8) | report_id, hidp->ifnum, 0, NULL);
}
usbh_urbstatus_t usbhhidGetProtocol(USBHHIDDriver *hidp, uint8_t *protocol) {
osalDbgCheck(hidp);
return usbhControlRequest(hidp->dev,
- USBH_CLASSIN(USBH_REQTYPE_INTERFACE, USBH_HID_REQ_GET_PROTOCOL, 0, hidp->ifnum),
- 1, protocol);
+ USBH_REQTYPE_CLASSIN(USBH_REQTYPE_RECIP_INTERFACE), USBH_HID_REQ_GET_PROTOCOL,
+ 0, hidp->ifnum, 1, protocol);
}
usbh_urbstatus_t usbhhidSetProtocol(USBHHIDDriver *hidp, uint8_t protocol) {
osalDbgCheck(hidp);
osalDbgAssert(protocol <= 1, "invalid protocol");
return usbhControlRequest(hidp->dev,
- USBH_CLASSOUT(USBH_REQTYPE_INTERFACE, USBH_HID_REQ_SET_PROTOCOL,
- protocol, hidp->ifnum), 0, NULL);
+ USBH_REQTYPE_CLASSOUT(USBH_REQTYPE_RECIP_INTERFACE), USBH_HID_REQ_SET_PROTOCOL,
+ protocol, hidp->ifnum, 0, NULL);
}
void usbhhidObjectInit(USBHHIDDriver *hidp) {