1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

f4 usb hid: handle SET_IDLE request

The code doesn't do anything useful with the SET_IDLE
but this helps to keep the wireshark USB traces clean
so that the real errors stand out better.
This commit is contained in:
Stacey Sheldon 2013-03-16 23:39:43 -04:00 committed by Alessio Morale
parent c22daec1b0
commit 2165a5afe1

View File

@ -350,6 +350,12 @@ static void PIOS_USB_HID_IF_DeInit(uint32_t usb_hid_id)
static uint8_t hid_protocol;
static uint8_t hid_altset;
struct hid_idle_msg {
uint8_t idle_period;
uint8_t report_id;
};
static struct hid_idle_msg hid_idle;
static uint8_t dummy_report[2];
static bool PIOS_USB_HID_IF_Setup(uint32_t usb_hid_id, struct usb_setup_request *req)
@ -402,6 +408,11 @@ static bool PIOS_USB_HID_IF_Setup(uint32_t usb_hid_id, struct usb_setup_request
case USB_HID_REQ_SET_PROTOCOL:
hid_protocol = (uint8_t)(req->wValue);
break;
case USB_HID_REQ_SET_IDLE:
/* Idle rates are currently ignored but decoded for debugging */
hid_idle.idle_period = req->wValue & 0xFF00 >> 8;
hid_idle.report_id = req->wValue & 0x00FF;
break;
case USB_HID_REQ_GET_PROTOCOL:
PIOS_USBHOOK_CtrlTx(&hid_protocol, 1);
break;