Skip to content

Commit

Permalink
Support 16-bit long transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Jan 2, 2018
1 parent c61eb73 commit c6d7734
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions USBHID.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
0x26, 0xff, 0x00, /* LOGICAL_MAXIMUM (255) */ \
0x75, 0x08, /* REPORT_SIZE (8) */ \
0x95, dataSize, /* REPORT_COUNT (32) */ \
0x91, 0x02, /* FEATURE (Data,Var,Abs) */ \
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */ \

#define HID_CONSUMER_REPORT_DESCRIPTOR(...) \
0x05, 0x0C, /* usage page (consumer device) */ \
Expand Down Expand Up @@ -286,9 +286,9 @@ class HIDReporter {

public:
HIDReporter(uint8_t* _buffer, unsigned _size, uint8_t _reportID);
uint8_t getFeature(uint8_t* out, uint8_t poll=1);
uint8_t getOutput(uint8_t* out, uint8_t poll=1);
uint8_t getData(uint8_t type, uint8_t* out, uint8_t poll=1); // type = HID_REPORT_TYPE_FEATURE or HID_REPORT_TYPE_OUTPUT
uint16_t getFeature(uint8_t* out, uint8_t poll=1);
uint16_t getOutput(uint8_t* out, uint8_t poll=1);
uint16_t getData(uint8_t type, uint8_t* out, uint8_t poll=1); // type = HID_REPORT_TYPE_FEATURE or HID_REPORT_TYPE_OUTPUT
void setFeature(uint8_t* feature);
};

Expand Down
6 changes: 3 additions & 3 deletions usb_hid_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ void HIDReporter::setFeature(uint8_t* in) {
return usb_hid_set_feature(reportID, in);
}

uint8_t HIDReporter::getData(uint8_t type, uint8_t* out, uint8_t poll) {
uint16_t HIDReporter::getData(uint8_t type, uint8_t* out, uint8_t poll) {
return usb_hid_get_data(type, reportID, out, poll);
}

uint8_t HIDReporter::getFeature(uint8_t* out, uint8_t poll) {
uint16_t HIDReporter::getFeature(uint8_t* out, uint8_t poll) {
return usb_hid_get_data(HID_REPORT_TYPE_FEATURE, reportID, out, poll);
}

uint8_t HIDReporter::getOutput(uint8_t* out, uint8_t poll) {
uint16_t HIDReporter::getOutput(uint8_t* out, uint8_t poll) {
return usb_hid_get_data(HID_REPORT_TYPE_OUTPUT, reportID, out, poll);
}

Expand Down

0 comments on commit c6d7734

Please sign in to comment.