summaryrefslogtreecommitdiff
path: root/usb
diff options
context:
space:
mode:
Diffstat (limited to 'usb')
-rw-r--r--usb/hid.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/usb/hid.h b/usb/hid.h
index bb5b9d7..1d3c8c1 100644
--- a/usb/hid.h
+++ b/usb/hid.h
@@ -225,9 +225,10 @@ constexpr auto padding_out(uint8_t size) -> decltype(
}
class USB_HID : public USB_class_driver {
- private:
+ protected:
USB_generic& usb;
+ private:
desc_t report_desc_p;
enum ControlState {
@@ -285,6 +286,11 @@ class USB_HID : public USB_class_driver {
return SetupStatus::Ok;
}
+ // Get feature report.
+ if(bmRequestType == 0xa1 && wIndex == interface_num && bRequest == 0x01 && (wValue & 0xff00) == 0x0300) {
+ return get_feature_report(wValue & 0xff) ? SetupStatus::Ok : SetupStatus::Stall;
+ }
+
return SetupStatus::Unhandled;
}
@@ -329,6 +335,10 @@ class USB_HID : public USB_class_driver {
virtual bool set_feature_report(uint32_t* buf, uint32_t len) {
return false;
}
+
+ virtual bool get_feature_report(uint8_t report_id) {
+ return false;
+ }
};
#endif