mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-05-16 22:30:31 +00:00
Finish stub for effect mapping
This commit is contained in:
parent
f81328068e
commit
019d3f4877
@ -3,76 +3,76 @@
|
|||||||
"reactive": {}
|
"reactive": {}
|
||||||
},
|
},
|
||||||
"effects": {
|
"effects": {
|
||||||
"0x01": {
|
"0x00": {
|
||||||
"key": "SOLID"
|
"key": "SOLID"
|
||||||
},
|
},
|
||||||
"0x02": {
|
"0x01": {
|
||||||
"key": "ALPHAS_MODS"
|
"key": "ALPHAS_MODS"
|
||||||
},
|
},
|
||||||
"0x03": {
|
"0x02": {
|
||||||
"key": "BREATHING"
|
"key": "BREATHING"
|
||||||
},
|
},
|
||||||
"0x04": {
|
"0x03": {
|
||||||
"key": "BAND"
|
"key": "BAND"
|
||||||
},
|
},
|
||||||
"0x05": {
|
"0x04": {
|
||||||
"key": "BAND_PINWHEEL"
|
"key": "BAND_PINWHEEL"
|
||||||
},
|
},
|
||||||
"0x06": {
|
"0x05": {
|
||||||
"key": "BAND_SPIRAL"
|
"key": "BAND_SPIRAL"
|
||||||
},
|
},
|
||||||
"0x07": {
|
"0x06": {
|
||||||
"key": "CYCLE_LEFT_RIGHT"
|
"key": "CYCLE_LEFT_RIGHT"
|
||||||
},
|
},
|
||||||
"0x08": {
|
"0x07": {
|
||||||
"key": "CYCLE_UP_DOWN"
|
"key": "CYCLE_UP_DOWN"
|
||||||
},
|
},
|
||||||
"0x09": {
|
"0x08": {
|
||||||
"key": "CYCLE_OUT_IN"
|
"key": "CYCLE_OUT_IN"
|
||||||
},
|
},
|
||||||
"0x0A": {
|
"0x09": {
|
||||||
"key": "DUAL_BEACON"
|
"key": "DUAL_BEACON"
|
||||||
},
|
},
|
||||||
"0x0B": {
|
"0x0A": {
|
||||||
"key": "WAVE_LEFT_RIGHT"
|
"key": "WAVE_LEFT_RIGHT"
|
||||||
},
|
},
|
||||||
"0x0C": {
|
"0x0B": {
|
||||||
"key": "WAVE_UP_DOWN"
|
"key": "WAVE_UP_DOWN"
|
||||||
},
|
},
|
||||||
|
|
||||||
"0x0D": {
|
"0x0C": {
|
||||||
"key": "SOLID_REACTIVE_SIMPLE",
|
"key": "SOLID_REACTIVE_SIMPLE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x0E": {
|
"0x0D": {
|
||||||
"key": "SOLID_REACTIVE_WIDE",
|
"key": "SOLID_REACTIVE_WIDE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x0F": {
|
"0x0E": {
|
||||||
"key": "SOLID_REACTIVE_MULTIWIDE",
|
"key": "SOLID_REACTIVE_MULTIWIDE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x10": {
|
"0x0F": {
|
||||||
"key": "SOLID_REACTIVE_CROSS",
|
"key": "SOLID_REACTIVE_CROSS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x11": {
|
"0x10": {
|
||||||
"key": "SOLID_REACTIVE_MULTICROSS",
|
"key": "SOLID_REACTIVE_MULTICROSS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x12": {
|
"0x11": {
|
||||||
"key": "SOLID_REACTIVE_NEXUS",
|
"key": "SOLID_REACTIVE_NEXUS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x13": {
|
"0x12": {
|
||||||
"key": "SOLID_REACTIVE_MULTINEXUS",
|
"key": "SOLID_REACTIVE_MULTINEXUS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x14": {
|
"0x13": {
|
||||||
"key": "SOLID_SPLASH",
|
"key": "SOLID_SPLASH",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x15": {
|
"0x14": {
|
||||||
"key": "SOLID_MULTISPLASH",
|
"key": "SOLID_MULTISPLASH",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
}
|
}
|
||||||
|
@ -4,151 +4,151 @@
|
|||||||
"reactive": {}
|
"reactive": {}
|
||||||
},
|
},
|
||||||
"effects": {
|
"effects": {
|
||||||
"0x01": {
|
"0x00": {
|
||||||
"key": "SOLID_COLOR"
|
"key": "SOLID_COLOR"
|
||||||
},
|
},
|
||||||
"0x02": {
|
"0x01": {
|
||||||
"key": "ALPHAS_MODS"
|
"key": "ALPHAS_MODS"
|
||||||
},
|
},
|
||||||
"0x03": {
|
"0x02": {
|
||||||
"key": "GRADIENT_UP_DOWN"
|
"key": "GRADIENT_UP_DOWN"
|
||||||
},
|
},
|
||||||
"0x04": {
|
"0x03": {
|
||||||
"key": "GRADIENT_LEFT_RIGHT"
|
"key": "GRADIENT_LEFT_RIGHT"
|
||||||
},
|
},
|
||||||
"0x05": {
|
"0x04": {
|
||||||
"key": "BREATHING"
|
"key": "BREATHING"
|
||||||
},
|
},
|
||||||
"0x06": {
|
"0x05": {
|
||||||
"key": "BAND_SAT"
|
"key": "BAND_SAT"
|
||||||
},
|
},
|
||||||
"0x07": {
|
"0x06": {
|
||||||
"key": "BAND_VAL"
|
"key": "BAND_VAL"
|
||||||
},
|
},
|
||||||
"0x08": {
|
"0x07": {
|
||||||
"key": "BAND_PINWHEEL_SAT"
|
"key": "BAND_PINWHEEL_SAT"
|
||||||
},
|
},
|
||||||
"0x09": {
|
"0x08": {
|
||||||
"key": "BAND_PINWHEEL_VAL"
|
"key": "BAND_PINWHEEL_VAL"
|
||||||
},
|
},
|
||||||
"0x0A": {
|
"0x09": {
|
||||||
"key": "BAND_SPIRAL_SAT"
|
"key": "BAND_SPIRAL_SAT"
|
||||||
},
|
},
|
||||||
"0x0B": {
|
"0x0A": {
|
||||||
"key": "BAND_SPIRAL_VAL"
|
"key": "BAND_SPIRAL_VAL"
|
||||||
},
|
},
|
||||||
"0x0C": {
|
"0x0B": {
|
||||||
"key": "CYCLE_ALL"
|
"key": "CYCLE_ALL"
|
||||||
},
|
},
|
||||||
"0x0D": {
|
"0x0C": {
|
||||||
"key": "CYCLE_LEFT_RIGHT"
|
"key": "CYCLE_LEFT_RIGHT"
|
||||||
},
|
},
|
||||||
"0x0E": {
|
"0x0D": {
|
||||||
"key": "CYCLE_UP_DOWN"
|
"key": "CYCLE_UP_DOWN"
|
||||||
},
|
},
|
||||||
"0x0F": {
|
"0x0E": {
|
||||||
"key": "CYCLE_OUT_IN"
|
"key": "CYCLE_OUT_IN"
|
||||||
},
|
},
|
||||||
"0x10": {
|
"0x0F": {
|
||||||
"key": "CYCLE_OUT_IN_DUAL"
|
"key": "CYCLE_OUT_IN_DUAL"
|
||||||
},
|
},
|
||||||
"0x11": {
|
"0x10": {
|
||||||
"key": "RAINBOW_MOVING_CHEVRON"
|
"key": "RAINBOW_MOVING_CHEVRON"
|
||||||
},
|
},
|
||||||
"0x12": {
|
"0x11": {
|
||||||
"key": "CYCLE_PINWHEEL"
|
"key": "CYCLE_PINWHEEL"
|
||||||
},
|
},
|
||||||
"0x13": {
|
"0x12": {
|
||||||
"key": "CYCLE_SPIRAL"
|
"key": "CYCLE_SPIRAL"
|
||||||
},
|
},
|
||||||
"0x14": {
|
"0x13": {
|
||||||
"key": "DUAL_BEACON"
|
"key": "DUAL_BEACON"
|
||||||
},
|
},
|
||||||
"0x15": {
|
"0x14": {
|
||||||
"key": "RAINBOW_BEACON"
|
"key": "RAINBOW_BEACON"
|
||||||
},
|
},
|
||||||
"0x16": {
|
"0x15": {
|
||||||
"key": "RAINBOW_PINWHEELS"
|
"key": "RAINBOW_PINWHEELS"
|
||||||
},
|
},
|
||||||
"0x17": {
|
"0x16": {
|
||||||
"key": "RAINDROPS"
|
"key": "RAINDROPS"
|
||||||
},
|
},
|
||||||
"0x18": {
|
"0x17": {
|
||||||
"key": "JELLYBEAN_RAINDROPS"
|
"key": "JELLYBEAN_RAINDROPS"
|
||||||
},
|
},
|
||||||
"0x19": {
|
"0x18": {
|
||||||
"key": "HUE_BREATHING"
|
"key": "HUE_BREATHING"
|
||||||
},
|
},
|
||||||
"0x1A": {
|
"0x19": {
|
||||||
"key": "HUE_PENDULUM"
|
"key": "HUE_PENDULUM"
|
||||||
},
|
},
|
||||||
"0x1B": {
|
"0x1A": {
|
||||||
"key": "HUE_WAVE"
|
"key": "HUE_WAVE"
|
||||||
},
|
},
|
||||||
"0x1C": {
|
"0x1B": {
|
||||||
"key": "PIXEL_FRACTAL"
|
"key": "PIXEL_FRACTAL"
|
||||||
},
|
},
|
||||||
"0x1D": {
|
"0x1C": {
|
||||||
"key": "PIXEL_FLOW"
|
"key": "PIXEL_FLOW"
|
||||||
},
|
},
|
||||||
"0x1E": {
|
"0x1D": {
|
||||||
"key": "PIXEL_RAIN"
|
"key": "PIXEL_RAIN"
|
||||||
},
|
},
|
||||||
|
|
||||||
"0x1F": {
|
"0x1E": {
|
||||||
"key": "TYPING_HEATMAP",
|
"key": "TYPING_HEATMAP",
|
||||||
"group": "framebuffer"
|
"group": "framebuffer"
|
||||||
},
|
},
|
||||||
"0x20": {
|
"0x1F": {
|
||||||
"key": "DIGITAL_RAIN",
|
"key": "DIGITAL_RAIN",
|
||||||
"group": "framebuffer"
|
"group": "framebuffer"
|
||||||
},
|
},
|
||||||
|
|
||||||
"0x21": {
|
"0x20": {
|
||||||
"key": "SOLID_REACTIVE_SIMPLE",
|
"key": "SOLID_REACTIVE_SIMPLE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x22": {
|
"0x21": {
|
||||||
"key": "RGB_MATRIX_SOLID_REACTIVE",
|
"key": "RGB_MATRIX_SOLID_REACTIVE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x23": {
|
"0x22": {
|
||||||
"key": "RGB_MATRIX_SOLID_REACTIVE_WIDE",
|
"key": "RGB_MATRIX_SOLID_REACTIVE_WIDE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x24": {
|
"0x23": {
|
||||||
"key": "SOLID_REACTIVE_MULTIWIDE",
|
"key": "SOLID_REACTIVE_MULTIWIDE",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x25": {
|
"0x24": {
|
||||||
"key": "SOLID_REACTIVE_CROSS",
|
"key": "SOLID_REACTIVE_CROSS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x26": {
|
"0x25": {
|
||||||
"key": "SOLID_REACTIVE_MULTICROSS",
|
"key": "SOLID_REACTIVE_MULTICROSS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x27": {
|
"0x26": {
|
||||||
"key": "SOLID_REACTIVE_NEXUS",
|
"key": "SOLID_REACTIVE_NEXUS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x28": {
|
"0x27": {
|
||||||
"key": "SOLID_REACTIVE_MULTINEXUS",
|
"key": "SOLID_REACTIVE_MULTINEXUS",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x29": {
|
"0x28": {
|
||||||
"key": "SPLASH",
|
"key": "SPLASH",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x2A": {
|
"0x29": {
|
||||||
"key": "MULTISPLASH",
|
"key": "MULTISPLASH",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x2B": {
|
"0x2A": {
|
||||||
"key": "SOLID_SPLASH",
|
"key": "SOLID_SPLASH",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
},
|
},
|
||||||
"0x2C": {
|
"0x2B": {
|
||||||
"key": "SOLID_MULTISPLASH",
|
"key": "SOLID_MULTISPLASH",
|
||||||
"group": "reactive"
|
"group": "reactive"
|
||||||
}
|
}
|
||||||
|
@ -1,129 +1,129 @@
|
|||||||
{
|
{
|
||||||
"effects": {
|
"effects": {
|
||||||
"0x01": {
|
"0x00": {
|
||||||
"key": "STATIC_LIGHT"
|
"key": "STATIC_LIGHT"
|
||||||
},
|
},
|
||||||
"0x02": {
|
"0x01": {
|
||||||
"key": "BREATHING"
|
"key": "BREATHING"
|
||||||
},
|
},
|
||||||
"0x03": {
|
"0x02": {
|
||||||
"key": "BREATHING_2"
|
"key": "BREATHING_2"
|
||||||
},
|
},
|
||||||
"0x04": {
|
"0x03": {
|
||||||
"key": "BREATHING_3"
|
"key": "BREATHING_3"
|
||||||
},
|
},
|
||||||
"0x05": {
|
"0x04": {
|
||||||
"key": "BREATHING_4"
|
"key": "BREATHING_4"
|
||||||
},
|
},
|
||||||
"0x06": {
|
"0x05": {
|
||||||
"key": "RAINBOW_MOOD"
|
"key": "RAINBOW_MOOD"
|
||||||
},
|
},
|
||||||
"0x07": {
|
"0x06": {
|
||||||
"key": "RAINBOW_MOOD_2"
|
"key": "RAINBOW_MOOD_2"
|
||||||
},
|
},
|
||||||
"0x08": {
|
"0x07": {
|
||||||
"key": "RAINBOW_MOOD_3"
|
"key": "RAINBOW_MOOD_3"
|
||||||
},
|
},
|
||||||
"0x09": {
|
"0x08": {
|
||||||
"key": "RAINBOW_SWIRL"
|
"key": "RAINBOW_SWIRL"
|
||||||
},
|
},
|
||||||
"0x0A": {
|
"0x09": {
|
||||||
"key": "RAINBOW_SWIRL_2"
|
"key": "RAINBOW_SWIRL_2"
|
||||||
},
|
},
|
||||||
"0x0B": {
|
"0x0A": {
|
||||||
"key": "RAINBOW_SWIRL_3"
|
"key": "RAINBOW_SWIRL_3"
|
||||||
},
|
},
|
||||||
"0x0C": {
|
"0x0B": {
|
||||||
"key": "RAINBOW_SWIRL_4"
|
"key": "RAINBOW_SWIRL_4"
|
||||||
},
|
},
|
||||||
"0x0D": {
|
"0x0C": {
|
||||||
"key": "RAINBOW_SWIRL_5"
|
"key": "RAINBOW_SWIRL_5"
|
||||||
},
|
},
|
||||||
"0x0E": {
|
"0x0D": {
|
||||||
"key": "RAINBOW_SWIRL_6"
|
"key": "RAINBOW_SWIRL_6"
|
||||||
},
|
},
|
||||||
"0x0F": {
|
"0x0E": {
|
||||||
"key": "SNAKE"
|
"key": "SNAKE"
|
||||||
},
|
},
|
||||||
"0x10": {
|
"0x0F": {
|
||||||
"key": "SNAKE_2"
|
"key": "SNAKE_2"
|
||||||
},
|
},
|
||||||
"0x11": {
|
"0x10": {
|
||||||
"key": "SNAKE_3"
|
"key": "SNAKE_3"
|
||||||
},
|
},
|
||||||
"0x12": {
|
"0x11": {
|
||||||
"key": "SNAKE_4"
|
"key": "SNAKE_4"
|
||||||
},
|
},
|
||||||
"0x13": {
|
"0x12": {
|
||||||
"key": "SNAKE_5"
|
"key": "SNAKE_5"
|
||||||
},
|
},
|
||||||
"0x14": {
|
"0x13": {
|
||||||
"key": "SNAKE_6"
|
"key": "SNAKE_6"
|
||||||
},
|
},
|
||||||
"0x15": {
|
"0x14": {
|
||||||
"key": "KNIGHT"
|
"key": "KNIGHT"
|
||||||
},
|
},
|
||||||
"0x16": {
|
"0x15": {
|
||||||
"key": "KNIGHT_2"
|
"key": "KNIGHT_2"
|
||||||
},
|
},
|
||||||
"0x17": {
|
"0x16": {
|
||||||
"key": "KNIGHT_3"
|
"key": "KNIGHT_3"
|
||||||
},
|
},
|
||||||
"0x18": {
|
"0x17": {
|
||||||
"key": "CHRISTMAS"
|
"key": "CHRISTMAS"
|
||||||
},
|
},
|
||||||
"0x19": {
|
"0x18": {
|
||||||
"key": "STATIC_GRADIENT"
|
"key": "STATIC_GRADIENT"
|
||||||
},
|
},
|
||||||
"0x1A": {
|
"0x19": {
|
||||||
"key": "STATIC_GRADIENT_2"
|
"key": "STATIC_GRADIENT_2"
|
||||||
},
|
},
|
||||||
"0x1B": {
|
"0x1A": {
|
||||||
"key": "STATIC_GRADIENT_3"
|
"key": "STATIC_GRADIENT_3"
|
||||||
},
|
},
|
||||||
"0x1C": {
|
"0x1B": {
|
||||||
"key": "STATIC_GRADIENT_4"
|
"key": "STATIC_GRADIENT_4"
|
||||||
},
|
},
|
||||||
"0x1D": {
|
"0x1C": {
|
||||||
"key": "STATIC_GRADIENT_5"
|
"key": "STATIC_GRADIENT_5"
|
||||||
},
|
},
|
||||||
"0x1E": {
|
"0x1D": {
|
||||||
"key": "STATIC_GRADIENT_6"
|
"key": "STATIC_GRADIENT_6"
|
||||||
},
|
},
|
||||||
"0x1F": {
|
"0x1E": {
|
||||||
"key": "STATIC_GRADIENT_7"
|
"key": "STATIC_GRADIENT_7"
|
||||||
},
|
},
|
||||||
"0x20": {
|
"0x1F": {
|
||||||
"key": "STATIC_GRADIENT_8"
|
"key": "STATIC_GRADIENT_8"
|
||||||
},
|
},
|
||||||
"0x21": {
|
"0x20": {
|
||||||
"key": "STATIC_GRADIENT_9"
|
"key": "STATIC_GRADIENT_9"
|
||||||
},
|
},
|
||||||
"0x22": {
|
"0x21": {
|
||||||
"key": "STATIC_GRADIENT_10"
|
"key": "STATIC_GRADIENT_10"
|
||||||
},
|
},
|
||||||
"0x23": {
|
"0x22": {
|
||||||
"key": "TEST"
|
"key": "RGB_TEST"
|
||||||
},
|
},
|
||||||
"0x24": {
|
"0x23": {
|
||||||
"key": "ALTERNATING"
|
"key": "ALTERNATING"
|
||||||
},
|
},
|
||||||
"0x25": {
|
"0x24": {
|
||||||
"key": "TWINKLE"
|
"key": "TWINKLE"
|
||||||
},
|
},
|
||||||
"0x26": {
|
"0x25": {
|
||||||
"key": "TWINKLE_2"
|
"key": "TWINKLE_2"
|
||||||
},
|
},
|
||||||
"0x27": {
|
"0x26": {
|
||||||
"key": "TWINKLE_3"
|
"key": "TWINKLE_3"
|
||||||
},
|
},
|
||||||
"0x28": {
|
"0x27": {
|
||||||
"key": "TWINKLE_4"
|
"key": "TWINKLE_4"
|
||||||
},
|
},
|
||||||
"0x29": {
|
"0x28": {
|
||||||
"key": "TWINKLE_5"
|
"key": "TWINKLE_5"
|
||||||
},
|
},
|
||||||
"0x2A": {
|
"0x29": {
|
||||||
"key": "TWINKLE_6"
|
"key": "TWINKLE_6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,11 @@ def xap_generate_qmk_inc(cli):
|
|||||||
# Determine our keyboard/keymap
|
# Determine our keyboard/keymap
|
||||||
if not cli.args.keyboard:
|
if not cli.args.keyboard:
|
||||||
cli.log.error('Missing parameter: --keyboard')
|
cli.log.error('Missing parameter: --keyboard')
|
||||||
cli.subcommands['xap-generate-info-h'].print_help()
|
cli.subcommands['xap-generate-qmk-inc'].print_help()
|
||||||
return False
|
return False
|
||||||
if not cli.args.keymap:
|
if not cli.args.keymap:
|
||||||
cli.log.error('Missing parameter: --keymap')
|
cli.log.error('Missing parameter: --keymap')
|
||||||
cli.subcommands['xap-generate-info-h'].print_help()
|
cli.subcommands['xap-generate-qmk-inc'].print_help()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
generate_inline(cli.args.output, cli.args.keyboard, cli.args.keymap)
|
generate_inline(cli.args.output, cli.args.keyboard, cli.args.keymap)
|
||||||
@ -39,11 +39,11 @@ def xap_generate_qmk_h(cli):
|
|||||||
# Determine our keyboard/keymap
|
# Determine our keyboard/keymap
|
||||||
if not cli.args.keyboard:
|
if not cli.args.keyboard:
|
||||||
cli.log.error('Missing parameter: --keyboard')
|
cli.log.error('Missing parameter: --keyboard')
|
||||||
cli.subcommands['xap-generate-info-h'].print_help()
|
cli.subcommands['xap-generate-qmk-h'].print_help()
|
||||||
return False
|
return False
|
||||||
if not cli.args.keymap:
|
if not cli.args.keymap:
|
||||||
cli.log.error('Missing parameter: --keymap')
|
cli.log.error('Missing parameter: --keymap')
|
||||||
cli.subcommands['xap-generate-info-h'].print_help()
|
cli.subcommands['xap-generate-qmk-h'].print_help()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
generate_header(cli.args.output, cli.args.keyboard, cli.args.keymap)
|
generate_header(cli.args.output, cli.args.keyboard, cli.args.keymap)
|
||||||
@ -59,11 +59,11 @@ def xap_generate_qmk_blob_h(cli):
|
|||||||
# Determine our keyboard/keymap
|
# Determine our keyboard/keymap
|
||||||
if not cli.args.keyboard:
|
if not cli.args.keyboard:
|
||||||
cli.log.error('Missing parameter: --keyboard')
|
cli.log.error('Missing parameter: --keyboard')
|
||||||
cli.subcommands['xap-generate-info-h'].print_help()
|
cli.subcommands['xap-generate-qmk-blob-h'].print_help()
|
||||||
return False
|
return False
|
||||||
if not cli.args.keymap:
|
if not cli.args.keymap:
|
||||||
cli.log.error('Missing parameter: --keymap')
|
cli.log.error('Missing parameter: --keymap')
|
||||||
cli.subcommands['xap-generate-info-h'].print_help()
|
cli.subcommands['xap-generate-qmk-blob-h'].print_help()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
generate_blob(cli.args.output, cli.args.keyboard, cli.args.keymap)
|
generate_blob(cli.args.output, cli.args.keyboard, cli.args.keymap)
|
||||||
|
@ -1,9 +1,46 @@
|
|||||||
"""This script generates the XAP protocol generated header to be compiled into QMK.
|
"""This script generates the XAP protocol generated header to be compiled into QMK.
|
||||||
"""
|
"""
|
||||||
|
import re
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from qmk.casing import to_snake
|
from qmk.casing import to_snake
|
||||||
from qmk.commands import dump_lines
|
from qmk.commands import dump_lines
|
||||||
from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE
|
from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE
|
||||||
from qmk.xap.common import merge_xap_defs, route_conditions
|
from qmk.xap.common import merge_xap_defs, route_conditions
|
||||||
|
from qmk.json_schema import json_load
|
||||||
|
|
||||||
|
PREFIX_MAP = {
|
||||||
|
'rgblight': {
|
||||||
|
'ifdef': 'RGBLIGHT_EFFECT',
|
||||||
|
'def': 'RGBLIGHT_MODE',
|
||||||
|
},
|
||||||
|
'rgb_matrix': {
|
||||||
|
'ifdef': 'ENABLE_RGB_MATRIX',
|
||||||
|
'def': 'RGB_MATRIX',
|
||||||
|
},
|
||||||
|
'led_matrix': {
|
||||||
|
'ifdef': 'ENABLE_LED_MATRIX',
|
||||||
|
'def': 'LED_MATRIX',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _get_lighting_spec(xap_defs, feature):
|
||||||
|
version = xap_defs["uses"][feature]
|
||||||
|
spec = json_load(Path(f'data/constants/{feature}_{version}.json'))
|
||||||
|
|
||||||
|
# preprocess for gross rgblight "mode + n"
|
||||||
|
for obj in spec.get('effects', {}).values():
|
||||||
|
define = obj["key"]
|
||||||
|
offset = 0
|
||||||
|
found = re.match("(.*)_(\\d+)$", define)
|
||||||
|
if found:
|
||||||
|
define = found.group(1)
|
||||||
|
offset = int(found.group(2)) - 1
|
||||||
|
obj["define"] = define
|
||||||
|
obj["offset"] = offset
|
||||||
|
|
||||||
|
return spec
|
||||||
|
|
||||||
|
|
||||||
def _get_c_type(xap_type):
|
def _get_c_type(xap_type):
|
||||||
@ -276,6 +313,82 @@ def _append_broadcast_messages(lines, container):
|
|||||||
lines.append(f'void {name}(const void *data, size_t length){{ xap_broadcast({key}, data, length); }}')
|
lines.append(f'void {name}(const void *data, size_t length){{ xap_broadcast({key}, data, length); }}')
|
||||||
|
|
||||||
|
|
||||||
|
def _append_lighting_map(lines, feature, spec):
|
||||||
|
"""TODO:
|
||||||
|
"""
|
||||||
|
ifdef_prefix = PREFIX_MAP[feature]['ifdef']
|
||||||
|
def_prefix = PREFIX_MAP[feature]['def']
|
||||||
|
|
||||||
|
lines.append(f'static uint8_t {feature}_effect_map[][2] = {{')
|
||||||
|
for id, obj in spec.get('effects', {}).items():
|
||||||
|
define = obj["define"]
|
||||||
|
offset = f' + {obj["offset"]}' if obj["offset"] else ''
|
||||||
|
|
||||||
|
lines.append(f'''
|
||||||
|
#ifdef {ifdef_prefix}_{define}
|
||||||
|
{{ {id}, {def_prefix}_{define}{offset}}},
|
||||||
|
#endif''')
|
||||||
|
|
||||||
|
lines.append('};')
|
||||||
|
|
||||||
|
# add helper funcs
|
||||||
|
lines.append(
|
||||||
|
f'''
|
||||||
|
uint8_t {feature}2xap(uint8_t val) {{
|
||||||
|
for(uint8_t i = 0; i < ARRAY_SIZE({feature}_effect_map); i++) {{
|
||||||
|
if ({feature}_effect_map[i][1] == val)
|
||||||
|
return {feature}_effect_map[i][0];
|
||||||
|
}}
|
||||||
|
return 0xFF;
|
||||||
|
}}
|
||||||
|
|
||||||
|
uint8_t xap2{feature}(uint8_t val) {{
|
||||||
|
for(uint8_t i = 0; i < ARRAY_SIZE({feature}_effect_map); i++) {{
|
||||||
|
if ({feature}_effect_map[i][0] == val)
|
||||||
|
return {feature}_effect_map[i][1];
|
||||||
|
}}
|
||||||
|
return 0xFF;
|
||||||
|
}}'''
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _append_lighting_bitmask(lines, feature, spec):
|
||||||
|
"""TODO:
|
||||||
|
"""
|
||||||
|
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'''
|
||||||
|
#ifdef {ifdef_prefix}_{define}
|
||||||
|
| (1ULL << {id})
|
||||||
|
#endif''')
|
||||||
|
lines.append(';')
|
||||||
|
|
||||||
|
|
||||||
|
def _append_lighting_mapping(lines, xap_defs):
|
||||||
|
"""TODO:
|
||||||
|
"""
|
||||||
|
# TODO: remove bodge for always enabled effects
|
||||||
|
lines.append('''
|
||||||
|
#define RGBLIGHT_EFFECT_STATIC_LIGHT
|
||||||
|
#define ENABLE_RGB_MATRIX_SOLID_COLOR
|
||||||
|
#define ENABLE_LED_MATRIX_SOLID
|
||||||
|
''')
|
||||||
|
|
||||||
|
for feature in PREFIX_MAP.keys():
|
||||||
|
spec = _get_lighting_spec(xap_defs, feature)
|
||||||
|
|
||||||
|
lines.append(f"#ifdef {feature.upper()}_ENABLE")
|
||||||
|
_append_lighting_map(lines, feature, spec)
|
||||||
|
lines.append(f"#endif //{feature.upper()}_ENABLE")
|
||||||
|
|
||||||
|
# TODO: should be inside ifdef but causes build issues
|
||||||
|
_append_lighting_bitmask(lines, feature, spec)
|
||||||
|
|
||||||
|
|
||||||
def generate_inline(output_file, keyboard, keymap):
|
def generate_inline(output_file, keyboard, keymap):
|
||||||
"""Generates the XAP protocol header file, generated during normal build.
|
"""Generates the XAP protocol header file, generated during normal build.
|
||||||
"""
|
"""
|
||||||
@ -284,6 +397,9 @@ def generate_inline(output_file, keyboard, keymap):
|
|||||||
# Preamble
|
# Preamble
|
||||||
lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '']
|
lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '']
|
||||||
|
|
||||||
|
# TODO: gen somewhere else?
|
||||||
|
_append_lighting_mapping(lines, xap_defs)
|
||||||
|
|
||||||
# Add all the generated code
|
# Add all the generated code
|
||||||
_append_broadcast_messages(lines, xap_defs)
|
_append_broadcast_messages(lines, xap_defs)
|
||||||
_append_routing_tables(lines, xap_defs)
|
_append_routing_tables(lines, xap_defs)
|
||||||
|
@ -28,9 +28,7 @@ bool get_config_blob_chunk(uint16_t offset, uint8_t *data, uint8_t data_len) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: return actual values
|
// TODO: move to better location?
|
||||||
#define ENABLED_RGBLIGHT_EFFECTS 0xFFFFFFFF
|
|
||||||
#define ENABLED_RGB_MATRIX_EFFECTS 0xFFFFFFFF
|
|
||||||
#ifdef BACKLIGHT_BREATHING
|
#ifdef BACKLIGHT_BREATHING
|
||||||
# define ENABLED_BACKLIGHT_EFFECTS 0b00000001
|
# define ENABLED_BACKLIGHT_EFFECTS 0b00000001
|
||||||
#else
|
#else
|
||||||
|
@ -182,6 +182,8 @@ bool xap_respond_dynamic_encoder_set_keycode(xap_token_t token, const void *data
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define INVALID_EFFECT 0xFF
|
||||||
|
|
||||||
#if ((defined(BACKLIGHT_ENABLE)))
|
#if ((defined(BACKLIGHT_ENABLE)))
|
||||||
# include "backlight.h"
|
# include "backlight.h"
|
||||||
|
|
||||||
@ -204,66 +206,13 @@ bool xap_respond_get_backlight_config(xap_token_t token, const void *data, size_
|
|||||||
|
|
||||||
extern rgblight_config_t rgblight_config;
|
extern rgblight_config_t rgblight_config;
|
||||||
|
|
||||||
// static uint8_t effect_map[][2] = {
|
uint8_t rgblight2xap(uint8_t val);
|
||||||
// {1, RGBLIGHT_MODE_STATIC_LIGHT},
|
|
||||||
// # ifdef RGBLIGHT_EFFECT_BREATHING
|
|
||||||
// {2, RGBLIGHT_MODE_BREATHING},
|
|
||||||
// {3, RGBLIGHT_MODE_BREATHING + 1},
|
|
||||||
// {4, RGBLIGHT_MODE_BREATHING + 2},
|
|
||||||
// {5, RGBLIGHT_MODE_BREATHING + 3},
|
|
||||||
// # endif
|
|
||||||
// /*...*/
|
|
||||||
// };
|
|
||||||
|
|
||||||
// static uint8_t xap2rgb(uint8_t val) {
|
|
||||||
// for(uint8_t i = 0; i < ARRAY_SIZE(effect_map); i++){
|
|
||||||
// if (effect_map[i][0] == val) {
|
|
||||||
// return effect_map[i][1];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// static uint8_t rgb2xap(uint8_t val) {
|
|
||||||
// for(uint8_t i = 0; i < ARRAY_SIZE(effect_map); i++){
|
|
||||||
// if (effect_map[i][1] == val) {
|
|
||||||
// return effect_map[i][0];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
static uint8_t effect_map[43] = {
|
|
||||||
0, //
|
|
||||||
RGBLIGHT_MODE_STATIC_LIGHT, //
|
|
||||||
# ifdef RGBLIGHT_EFFECT_BREATHING
|
|
||||||
RGBLIGHT_MODE_BREATHING,
|
|
||||||
RGBLIGHT_MODE_BREATHING + 1,
|
|
||||||
RGBLIGHT_MODE_BREATHING + 2,
|
|
||||||
RGBLIGHT_MODE_BREATHING + 3,
|
|
||||||
# endif
|
|
||||||
0,
|
|
||||||
/*...*/
|
|
||||||
};
|
|
||||||
|
|
||||||
// static uint8_t xap2rgb(uint8_t val) {
|
|
||||||
// return effect_map[val];
|
|
||||||
// }
|
|
||||||
|
|
||||||
static uint8_t rgb2xap(uint8_t val) {
|
|
||||||
for (uint8_t i = 0; i < ARRAY_SIZE(effect_map); i++) {
|
|
||||||
if (effect_map[i] == val) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool xap_respond_get_rgblight_config(xap_token_t token, const void *data, size_t length) {
|
bool xap_respond_get_rgblight_config(xap_token_t token, const void *data, size_t length) {
|
||||||
xap_route_lighting_rgblight_get_config_t ret;
|
xap_route_lighting_rgblight_get_config_t ret;
|
||||||
|
|
||||||
ret.enable = rgblight_config.enable;
|
ret.enable = rgblight_config.enable;
|
||||||
ret.mode = rgb2xap(rgblight_config.mode);
|
ret.mode = rgblight2xap(rgblight_config.mode);
|
||||||
ret.hue = rgblight_config.hue;
|
ret.hue = rgblight_config.hue;
|
||||||
ret.sat = rgblight_config.sat;
|
ret.sat = rgblight_config.sat;
|
||||||
ret.val = rgblight_config.val;
|
ret.val = rgblight_config.val;
|
||||||
@ -278,34 +227,13 @@ bool xap_respond_get_rgblight_config(xap_token_t token, const void *data, size_t
|
|||||||
|
|
||||||
extern rgb_config_t rgb_matrix_config;
|
extern rgb_config_t rgb_matrix_config;
|
||||||
|
|
||||||
static uint8_t effect_map[43] = {
|
uint8_t rgb_matrix2xap(uint8_t val);
|
||||||
0, //
|
|
||||||
RGB_MATRIX_SOLID_COLOR, //
|
|
||||||
# ifdef ENABLE_RGB_MATRIX_ALPHAS_MODS
|
|
||||||
RGB_MATRIX_ALPHAS_MODS,
|
|
||||||
# endif
|
|
||||||
0,
|
|
||||||
/*...*/
|
|
||||||
};
|
|
||||||
|
|
||||||
// static uint8_t xap2rgb(uint8_t val) {
|
|
||||||
// return effect_map[val];
|
|
||||||
// }
|
|
||||||
|
|
||||||
static uint8_t rgb2xap(uint8_t val) {
|
|
||||||
for (uint8_t i = 0; i < ARRAY_SIZE(effect_map); i++) {
|
|
||||||
if (effect_map[i] == val) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool xap_respond_get_rgb_matrix_config(xap_token_t token, const void *data, size_t length) {
|
bool xap_respond_get_rgb_matrix_config(xap_token_t token, const void *data, size_t length) {
|
||||||
xap_route_lighting_rgb_matrix_get_config_t ret;
|
xap_route_lighting_rgb_matrix_get_config_t ret;
|
||||||
|
|
||||||
ret.enable = rgb_matrix_config.enable;
|
ret.enable = rgb_matrix_config.enable;
|
||||||
ret.mode = rgb2xap(rgb_matrix_config.mode);
|
ret.mode = rgb_matrix2xap(rgb_matrix_config.mode);
|
||||||
ret.hue = rgb_matrix_config.hsv.h;
|
ret.hue = rgb_matrix_config.hsv.h;
|
||||||
ret.sat = rgb_matrix_config.hsv.s;
|
ret.sat = rgb_matrix_config.hsv.s;
|
||||||
ret.val = rgb_matrix_config.hsv.v;
|
ret.val = rgb_matrix_config.hsv.v;
|
||||||
|
Loading…
Reference in New Issue
Block a user