mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-04-22 15:11:27 +00:00
Fix some matrix effects
This commit is contained in:
parent
95185b5fcc
commit
179049dfc9
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"groups": {
|
"groups": {
|
||||||
"reactive": {}
|
"reactive": {
|
||||||
|
"define": "LED_MATRIX_KEYREACTIVE_ENABLED"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"effects": {
|
"effects": {
|
||||||
"0x00": {
|
"0x00": {
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"groups": {
|
"groups": {
|
||||||
"framebuffer": {},
|
"framebuffer": {
|
||||||
"reactive": {}
|
"define": "RGB_MATRIX_FRAMEBUFFER_EFFECTS"
|
||||||
|
},
|
||||||
|
"reactive": {
|
||||||
|
"define": "RGB_MATRIX_KEYREACTIVE_ENABLED"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"effects": {
|
"effects": {
|
||||||
"0x00": {
|
"0x00": {
|
||||||
@ -109,11 +113,11 @@
|
|||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x21": {
|
"0x21": {
|
||||||
"key": "RGB_MATRIX_SOLID_REACTIVE",
|
"key": "SOLID_REACTIVE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x22": {
|
"0x22": {
|
||||||
"key": "RGB_MATRIX_SOLID_REACTIVE_WIDE",
|
"key": "SOLID_REACTIVE_WIDE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x23": {
|
"0x23": {
|
||||||
|
@ -316,6 +316,7 @@ def _append_broadcast_messages(lines, container):
|
|||||||
def _append_lighting_map(lines, feature, spec):
|
def _append_lighting_map(lines, feature, spec):
|
||||||
"""TODO:
|
"""TODO:
|
||||||
"""
|
"""
|
||||||
|
groups = spec.get('groups', {})
|
||||||
ifdef_prefix = PREFIX_MAP[feature]['ifdef']
|
ifdef_prefix = PREFIX_MAP[feature]['ifdef']
|
||||||
def_prefix = PREFIX_MAP[feature]['def']
|
def_prefix = PREFIX_MAP[feature]['def']
|
||||||
|
|
||||||
@ -324,10 +325,19 @@ def _append_lighting_map(lines, feature, spec):
|
|||||||
define = obj["define"]
|
define = obj["define"]
|
||||||
offset = f' + {obj["offset"]}' if obj["offset"] else ''
|
offset = f' + {obj["offset"]}' if obj["offset"] else ''
|
||||||
|
|
||||||
lines.append(f'''
|
line = f'''
|
||||||
#ifdef {ifdef_prefix}_{define}
|
#ifdef {ifdef_prefix}_{define}
|
||||||
{{ {id}, {def_prefix}_{define}{offset}}},
|
{{ {id}, {def_prefix}_{define}{offset}}},
|
||||||
#endif''')
|
#endif'''
|
||||||
|
|
||||||
|
group = groups.get(obj.get("group", None), {}).get('define', None)
|
||||||
|
if group:
|
||||||
|
line = f'''
|
||||||
|
#ifdef {group}
|
||||||
|
{line}
|
||||||
|
#endif'''
|
||||||
|
|
||||||
|
lines.append(line)
|
||||||
|
|
||||||
lines.append('};')
|
lines.append('};')
|
||||||
|
|
||||||
@ -355,16 +365,27 @@ uint8_t xap2{feature}(uint8_t val) {{
|
|||||||
def _append_lighting_bitmask(lines, feature, spec):
|
def _append_lighting_bitmask(lines, feature, spec):
|
||||||
"""TODO:
|
"""TODO:
|
||||||
"""
|
"""
|
||||||
|
groups = spec.get('groups', {})
|
||||||
ifdef_prefix = PREFIX_MAP[feature]['ifdef']
|
ifdef_prefix = PREFIX_MAP[feature]['ifdef']
|
||||||
|
|
||||||
lines.append(f"static const uint64_t ENABLED_{feature.upper()}_EFFECTS = 0")
|
lines.append(f"static const uint64_t ENABLED_{feature.upper()}_EFFECTS = 0")
|
||||||
for id, obj in spec.get('effects', {}).items():
|
for id, obj in spec.get('effects', {}).items():
|
||||||
define = obj["define"]
|
define = obj["define"]
|
||||||
|
|
||||||
lines.append(f'''
|
line = f'''
|
||||||
#ifdef {ifdef_prefix}_{define}
|
#ifdef {ifdef_prefix}_{define}
|
||||||
| (1ULL << {id})
|
| (1ULL << {id})
|
||||||
#endif''')
|
#endif'''
|
||||||
|
|
||||||
|
group = groups.get(obj.get("group", None), {}).get('define', None)
|
||||||
|
if group:
|
||||||
|
line = f'''
|
||||||
|
#ifdef {group}
|
||||||
|
{line}
|
||||||
|
#endif'''
|
||||||
|
|
||||||
|
lines.append(line)
|
||||||
|
|
||||||
lines.append(';')
|
lines.append(';')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user