| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c68f1ec commit 6e48498
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -310,17 +310,16 @@ def open(self): | |||
| 310 | 310 | ||
| 311 | 311 | # find endpoints | |
| 312 | 312 | for ep in self.iface: | |
| 313 | - ep_at = ep.bmAttributes | ||
| 314 | - ep_dir = ep.bEndpointAddress & usb.ENDPOINT_DIR_MASK | ||
| 315 | - ep_type = ep_at & usb.ENDPOINT_TYPE_MASK | ||
| 313 | + ep_dir = usb.util.endpoint_direction(ep.bEndpointAddress) | ||
| 314 | + ep_type = usb.util.endpoint_type(ep.bmAttributes) | ||
| 316 | 315 | ||
| 317 | - if (ep_type == usb.ENDPOINT_TYPE_BULK): | ||
| 318 | - if (ep_dir == usb.ENDPOINT_IN): | ||
| 316 | + if (ep_type == usb.util.ENDPOINT_TYPE_BULK): | ||
| 317 | + if (ep_dir == usb.util.ENDPOINT_IN): | ||
| 319 | 318 | self.bulk_in_ep = ep | |
| 320 | - elif (ep_dir == usb.ENDPOINT_OUT): | ||
| 319 | + elif (ep_dir == usb.util.ENDPOINT_OUT): | ||
| 321 | 320 | self.bulk_out_ep = ep | |
| 322 | - elif (ep_type == usb.ENDPOINT_TYPE_INTERRUPT): | ||
| 323 | - if (ep_dir == usb.ENDPOINT_IN): | ||
| 321 | + elif (ep_type == usb.util.ENDPOINT_TYPE_INTR): | ||
| 322 | + if (ep_dir == usb.util.ENDPOINT_IN): | ||
| 324 | 323 | self.interrupt_in_ep = ep | |
| 325 | 324 | ||
| 326 | 325 | if self.bulk_in_ep is None or self.bulk_out_ep is None: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments