mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-12-12 04:40:58 +00:00
Fix xap_client gen after render_xap_output changes
This commit is contained in:
parent
dc591c751d
commit
751e72c1f9
@ -5,13 +5,15 @@ from enum import IntEnum
|
|||||||
|
|
||||||
# version: 0.0.1
|
# version: 0.0.1
|
||||||
class RgblightModes(IntEnum):
|
class RgblightModes(IntEnum):
|
||||||
{%- for id, effect in specs.rgblight.effects | dictsort %}
|
{% for id, effect in specs.rgblight.effects | dictsort %}
|
||||||
{{ effect.key }} = {{ id }}
|
{{ effect.key }} = {{ id }}
|
||||||
{%- endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
# version: 0.0.1
|
# version: 0.0.1
|
||||||
class RgbMatrixModes(IntEnum):
|
class RgbMatrixModes(IntEnum):
|
||||||
{%- for id, effect in specs.rgb_matrix.effects | dictsort %}
|
{% for id, effect in specs.rgb_matrix.effects | dictsort %}
|
||||||
{{ effect.key }} = {{ id }}
|
{{ effect.key }} = {{ id }}
|
||||||
{%- endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
# noqa: W391
|
@ -5,16 +5,18 @@ class XAPRouteError(Exception):
|
|||||||
|
|
||||||
|
|
||||||
class XAPRoutes():
|
class XAPRoutes():
|
||||||
{%- for id, route in xap.routes | dictsort %}
|
{% for id, route in xap.routes | dictsort %}
|
||||||
{%- if route.routes %}
|
{% if route.routes %}
|
||||||
# {{route.define}}
|
# {{route.define}}
|
||||||
{%- for subid, subroute in route.routes | dictsort %}
|
{% for subid, subroute in route.routes | dictsort %}
|
||||||
{{route.define}}_{{subroute.define}} = b'\x{{ '%02d' % id|int(base=16) }}\x{{ '%02d' % subid|int(base=16) }}'
|
{{route.define}}_{{subroute.define}} = b'\x{{ '%02d' % id|int(base=16) }}\x{{ '%02d' % subid|int(base=16) }}'
|
||||||
{%- if subroute.routes %}
|
{% if subroute.routes %}
|
||||||
{%- for subsubid, subsubroute in subroute.routes | dictsort %}
|
{% for subsubid, subsubroute in subroute.routes | dictsort %}
|
||||||
{{route.define}}_{{subroute.define}}_{{subsubroute.define}} = b'\x{{ '%02d' % id|int(base=16) }}\x{{ '%02d' % subid|int(base=16) }}\x{{ '%02d' % subsubid|int(base=16) }}'
|
{{route.define}}_{{subroute.define}}_{{subsubroute.define}} = b'\x{{ '%02d' % id|int(base=16) }}\x{{ '%02d' % subid|int(base=16) }}\x{{ '%02d' % subsubid|int(base=16) }}'
|
||||||
{%- endfor %}
|
{% endfor %}
|
||||||
{%- endif %}
|
{% endif %}
|
||||||
{%- endfor %}
|
{% endfor %}
|
||||||
{%- endif %}
|
{% endif %}
|
||||||
{%- endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
# noqa: W391
|
@ -4,6 +4,7 @@ from collections import namedtuple
|
|||||||
from enum import IntFlag, IntEnum
|
from enum import IntFlag, IntEnum
|
||||||
from struct import Struct
|
from struct import Struct
|
||||||
|
|
||||||
|
|
||||||
{% macro gen_struct(name, members, fmt) -%}
|
{% macro gen_struct(name, members, fmt) -%}
|
||||||
class {{ name }}(namedtuple('{{ name }}', '{{ members }}')):
|
class {{ name }}(namedtuple('{{ name }}', '{{ members }}')):
|
||||||
fmt = Struct('{{ fmt }}')
|
fmt = Struct('{{ fmt }}')
|
||||||
@ -31,16 +32,16 @@ class {{ name }}(namedtuple('{{ name }}', '{{ members }}')):
|
|||||||
{% for item in type_definitions -%}{{ gen_struct(item.name, item.members, item.fmt) }}{% endfor -%}
|
{% for item in type_definitions -%}{{ gen_struct(item.name, item.members, item.fmt) }}{% endfor -%}
|
||||||
|
|
||||||
# Spec structs
|
# Spec structs
|
||||||
{%- for item in xap.routes.values() recursive -%}
|
{% for item in xap.routes.values() recursive %}
|
||||||
{%- if item.routes -%}
|
{%- if item.routes -%}
|
||||||
{{ loop(item.routes.values()) }}
|
{{ loop(item.routes.values()) }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{% if item.request_struct_members %}
|
{%- if item.request_struct_members %}
|
||||||
# TODO: gen inbound object for {{ item.define | to_snake }}
|
# TODO: gen inbound object for {{ item.define | to_snake }}
|
||||||
{%- endif -%}
|
{% endif -%}
|
||||||
{% if item.return_struct_members %}
|
{%- if item.return_struct_members %}
|
||||||
# TODO: gen outbound object for {{ item.define | to_snake }}
|
# TODO: gen outbound object for {{ item.define | to_snake }}
|
||||||
{%- endif -%}
|
{% endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
|
|
||||||
@ -51,14 +52,16 @@ class XAPSecureStatus(IntEnum):
|
|||||||
|
|
||||||
|
|
||||||
class XAPEventType(IntEnum):
|
class XAPEventType(IntEnum):
|
||||||
{%- for id, message in xap.broadcast_messages.messages | dictsort %}
|
{% for id, message in xap.broadcast_messages.messages | dictsort %}
|
||||||
{{ message.define }} = {{ id }}
|
{{ message.define }} = {{ id }}
|
||||||
{%- endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
class XAPFlags(IntFlag):
|
class XAPFlags(IntFlag):
|
||||||
{%- for bitnum, bitinfo in xap.response_flags.bits | dictsort %}
|
{% for bitnum, bitinfo in xap.response_flags.bits | dictsort %}
|
||||||
{%- if bitinfo.define != "-" %}
|
{% if bitinfo.define != "-" %}
|
||||||
{{ bitinfo.define }} = 1 << {{ bitnum }}
|
{{ bitinfo.define }} = 1 << {{ bitnum }}
|
||||||
{%- endif %}
|
{% endif %}
|
||||||
{%- endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
# noqa: W391
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2022 QMK
|
# Copyright 2023 QMK
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -121,3 +121,5 @@ class RgbMatrixModes(IntEnum):
|
|||||||
MULTISPLASH = 0x29
|
MULTISPLASH = 0x29
|
||||||
SOLID_SPLASH = 0x2A
|
SOLID_SPLASH = 0x2A
|
||||||
SOLID_MULTISPLASH = 0x2B
|
SOLID_MULTISPLASH = 0x2B
|
||||||
|
|
||||||
|
# noqa: W391
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2022 QMK
|
# Copyright 2023 QMK
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -84,3 +84,5 @@ class XAPRoutes():
|
|||||||
AUDIO_GET_CONFIG = b'\x07\x03'
|
AUDIO_GET_CONFIG = b'\x07\x03'
|
||||||
AUDIO_SET_CONFIG = b'\x07\x04'
|
AUDIO_SET_CONFIG = b'\x07\x04'
|
||||||
AUDIO_SAVE_CONFIG = b'\x07\x05'
|
AUDIO_SAVE_CONFIG = b'\x07\x05'
|
||||||
|
|
||||||
|
# noqa: W391
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2022 QMK
|
# Copyright 2023 QMK
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -133,3 +133,5 @@ class XAPEventType(IntEnum):
|
|||||||
class XAPFlags(IntFlag):
|
class XAPFlags(IntFlag):
|
||||||
SUCCESS = 1 << 0
|
SUCCESS = 1 << 0
|
||||||
SECURE_FAILURE = 1 << 1
|
SECURE_FAILURE = 1 << 1
|
||||||
|
|
||||||
|
# noqa: W391
|
||||||
|
Loading…
Reference in New Issue
Block a user