format
This commit is contained in:
parent
e7d9d6675c
commit
c9eae1d384
3 changed files with 15 additions and 12 deletions
|
@ -174,6 +174,9 @@ def xap(cli):
|
|||
keycode = _xap_transaction(device, 0x04, 0x02, 2, b"\x00\x00\x00")
|
||||
keycode = int.from_bytes(keycode, "little")
|
||||
keycode_map = {
|
||||
# TODO: this should be data driven...
|
||||
0x04: 'KC_A',
|
||||
0x05: 'KC_B',
|
||||
0x29: 'KC_ESCAPE'
|
||||
}
|
||||
print('keycode:' + keycode_map.get(keycode, 'unknown'))
|
||||
|
|
|
@ -114,7 +114,7 @@ def _append_route_capabilities(lines, container, container_id=None, route_stack=
|
|||
|
||||
|
||||
def _append_route_types(lines, container, container_id=None, route_stack=None):
|
||||
"""Handles creating
|
||||
"""Handles creating typedefs used by routes
|
||||
"""
|
||||
if route_stack is None:
|
||||
route_stack = [container]
|
||||
|
@ -126,7 +126,7 @@ def _append_route_types(lines, container, container_id=None, route_stack=None):
|
|||
# Inbound
|
||||
if 'request_struct_members' in container:
|
||||
request_struct_members = container['request_struct_members']
|
||||
lines.append(f'typedef struct {{')
|
||||
lines.append('typedef struct {')
|
||||
for member in request_struct_members:
|
||||
member_type = _get_c_type(member['type'])
|
||||
member_name = to_snake(member['name'])
|
||||
|
@ -141,7 +141,7 @@ def _append_route_types(lines, container, container_id=None, route_stack=None):
|
|||
qualifier = 'const' if 'return_constant' in container else ''
|
||||
if 'return_struct_members' in container:
|
||||
return_struct_members = container['return_struct_members']
|
||||
lines.append(f'typedef struct {{')
|
||||
lines.append('typedef struct {')
|
||||
for member in return_struct_members:
|
||||
member_type = _get_c_type(member['type'])
|
||||
member_name = f'{qualifier} {to_snake(member["name"])}'
|
||||
|
|
Loading…
Reference in a new issue