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