mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-07 10:53:17 +02:00
Initial rework of steno feature (#26273)
This commit is contained in:
@@ -170,6 +170,18 @@ def generate_led_animations_config(feature, led_feature_json, config_h_lines, en
|
||||
config_h_lines.append(generate_flag(f'{enable_prefix}{animation.upper()}', led_feature_json['animations'][animation]))
|
||||
|
||||
|
||||
def generate_stenography_config(kb_info_json, config_h_lines):
|
||||
"""Generate the config.h lines for stenography."""
|
||||
if 'mode' in kb_info_json['stenography'].get('default', {}):
|
||||
mode_map = {
|
||||
'geminipr': 'STENO_MODE_GEMINI',
|
||||
'txbolt': 'STENO_MODE_BOLT',
|
||||
}
|
||||
mode = kb_info_json['stenography']['default']['mode']
|
||||
value = mode_map.get(mode, f'STENO_MODE_{mode.upper()}')
|
||||
config_h_lines.append(generate_define('STENO_DEFAULT_MODE', value))
|
||||
|
||||
|
||||
@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON to be compiled and flashed or a pre-compiled binary firmware file (bin/hex) to be flashed.')
|
||||
@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@@ -214,5 +226,8 @@ def generate_config_h(cli):
|
||||
if 'rgblight' in kb_info_json:
|
||||
generate_led_animations_config('rgblight', kb_info_json['rgblight'], config_h_lines, 'RGBLIGHT_EFFECT_', 'RGBLIGHT_MODE_')
|
||||
|
||||
if 'stenography' in kb_info_json:
|
||||
generate_stenography_config(kb_info_json, config_h_lines)
|
||||
|
||||
# Show the results
|
||||
dump_lines(cli.args.output, config_h_lines, cli.args.quiet)
|
||||
|
||||
Reference in New Issue
Block a user