Skip to content

Commit 8329a69

Browse files
committed
Document padding bits in HID report descriptor
Document that the REPORT_COUNT(2) input & feature report fields are just padding to make the HID_PD_PRESENTSTATUS report byte aligned. This will hopefully make the descriptor slightly easier to understand for new developers. Also, remove some trailing whitespace that appear to be accidental.
1 parent 0801b11 commit 8329a69

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/HIDPowerDevice.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,12 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
213213
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
214214
0x09, 0x65, // USAGE (Overload)
215215
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
216-
0x95, 0x02, // REPORT_COUNT (2)
216+
0x95, 0x02, // REPORT_COUNT (2) // padding bits to make the report byte aligned
217217
0x81, 0x01, // INPUT (Constant, Array, Absolute)
218-
0xB1, 0x01, // FEATURE (Constant, Array, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
219-
0xC0, // END_COLLECTION
218+
0xB1, 0x01, // FEATURE (Constant, Array, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
219+
0xC0, // END_COLLECTION
220220
0xC0, // END_COLLECTION
221-
0xC0 // END_COLLECTION
222-
221+
0xC0 // END_COLLECTION
223222
};
224223

225224
HIDPowerDevice_::HIDPowerDevice_(void) {

0 commit comments

Comments
 (0)