Browse Source

Fix some missed refactoring

hid
Josh Koike 4 years ago
parent
commit
bbc5f67a73
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      usb_protocol/emitters/descriptors/hid.py
  2. +1
    -1
      usb_protocol/types/descriptors/hid.py

+ 2
- 2
usb_protocol/emitters/descriptors/hid.py View File

@@ -63,7 +63,7 @@ class HIDDescriptor(ComplexDescriptorEmitter):
"null": null,
"volatile": volatile,
})
self.add_report(HIDPrefix.INPUT, ord(item_flags))
self.add_report_item(HIDPrefix.INPUT, ord(item_flags))

def add_output_item(self,
data_constant = False,
@@ -87,7 +87,7 @@ class HIDDescriptor(ComplexDescriptorEmitter):
"null": null,
"volatile": volatile,
})
self.add_report(HIDPrefix.OUTPUT, ord(item_flags))
self.add_report_item(HIDPrefix.OUTPUT, ord(item_flags))

def __init__(self, parent_descriptor):
super().__init__()


+ 1
- 1
usb_protocol/types/descriptors/hid.py View File

@@ -63,7 +63,7 @@ ReportDescriptor = DescriptorFormat(
"bHeader" / construct.BitStruct(
# prefix technically consists of a 4 byte tag and a 2 byte type,
# however, they're all listed together in the HID spec
"prefix" / construct.Enum(construct.BitsInteger(6), HIDPrefixes),
"prefix" / construct.Enum(construct.BitsInteger(6), HIDPrefix),
"bSize" / construct.BitsInteger(2),
),
"data" / construct.Byte[lambda ctx: _hid_item_length[ctx.bHeader.bSize]]


Loading…
Cancel
Save