mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-05-23 17:45:27 +00:00
Minor tidy up of cli
This commit is contained in:
parent
4d6336ccab
commit
c155b16ec9
@ -191,7 +191,7 @@ class XAPShell(cmd.Cmd):
|
|||||||
@cli.argument('-d', '--device', help='device to select - uses format <pid>:<vid>.')
|
@cli.argument('-d', '--device', help='device to select - uses format <pid>:<vid>.')
|
||||||
@cli.argument('-l', '--list', arg_only=True, action='store_true', help='List available devices.')
|
@cli.argument('-l', '--list', arg_only=True, action='store_true', help='List available devices.')
|
||||||
@cli.argument('-i', '--interactive', arg_only=True, action='store_true', help='Start interactive shell.')
|
@cli.argument('-i', '--interactive', arg_only=True, action='store_true', help='Start interactive shell.')
|
||||||
@cli.argument('action', nargs='*', default=['listen'], arg_only=True)
|
@cli.argument('action', nargs='*', arg_only=True, default=['listen'], help='Shell command and any arguments to run standalone')
|
||||||
@cli.subcommand('Acquire debugging information from usb XAP devices.', hidden=False if cli.config.user.developer else True)
|
@cli.subcommand('Acquire debugging information from usb XAP devices.', hidden=False if cli.config.user.developer else True)
|
||||||
def xap(cli):
|
def xap(cli):
|
||||||
"""Acquire debugging information from XAP devices
|
"""Acquire debugging information from XAP devices
|
||||||
@ -206,7 +206,7 @@ def xap(cli):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
dev = devices[0]
|
dev = devices[0]
|
||||||
cli.log.info('Connecting to:%04x:%04x %s %s', dev['vendor_id'], dev['product_id'], dev['manufacturer_string'], dev['product_string'])
|
cli.log.info('Connecting to: %04x:%04x %s %s', dev['vendor_id'], dev['product_id'], dev['manufacturer_string'], dev['product_string'])
|
||||||
device = XAPClient().connect(dev)
|
device = XAPClient().connect(dev)
|
||||||
|
|
||||||
# shell?
|
# shell?
|
||||||
|
@ -67,7 +67,7 @@ class XAPDevice:
|
|||||||
"""Background thread to signal waiting transactions
|
"""Background thread to signal waiting transactions
|
||||||
"""
|
"""
|
||||||
while 1:
|
while 1:
|
||||||
array_alpha = self.dev.read(64, 100)
|
array_alpha = self.dev.read(ResponseStruct.size, 100)
|
||||||
if array_alpha:
|
if array_alpha:
|
||||||
token = int.from_bytes(array_alpha[:2], 'little')
|
token = int.from_bytes(array_alpha[:2], 'little')
|
||||||
event = self.responses.get(token)
|
event = self.responses.get(token)
|
||||||
|
Loading…
Reference in New Issue
Block a user