diff options
author | Zach White <skullydazed@gmail.com> | 2021-01-31 12:46:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-31 12:46:00 -0800 |
commit | ef6329af7c7be77b537fbfc5a5cc7105acc679f7 (patch) | |
tree | 911f2baa834648e09baff1e7cc21cafae47a8ce8 /data/mappings | |
parent | 6cada2a35f57629f821852ba629e33e9abee3e74 (diff) | |
download | qmk_firmware-ef6329af7c7be77b537fbfc5a5cc7105acc679f7.tar.gz qmk_firmware-ef6329af7c7be77b537fbfc5a5cc7105acc679f7.zip |
Create a system to map between info.json and config.h/rules.mk (#11548)
* generate rules.mk from a json mapping
* generate rules.mk from a json mapping
* support for config.h from json maps
* improve the mapping system
* document the mapping system
* move data/maps to data/mappings
* fix flake8 errors
* fixup LED_MATRIX_DRIVER
* remove product and description from the vision_division keymap level
* reduce the complexity of generate-rules-mk
* add tests for the generate commands
* fix qmk doctor when submodules are not clean
Diffstat (limited to 'data/mappings')
-rw-r--r-- | data/mappings/info_config.json | 42 | ||||
-rw-r--r-- | data/mappings/info_rules.json | 15 |
2 files changed, 57 insertions, 0 deletions
diff --git a/data/mappings/info_config.json b/data/mappings/info_config.json new file mode 100644 index 000000000..885e6d025 --- /dev/null +++ b/data/mappings/info_config.json | |||
@@ -0,0 +1,42 @@ | |||
1 | # This file maps keys between `config.h` and `info.json`. It is used by QMK | ||
2 | # to correctly and consistently map back and forth between the two systems. | ||
3 | { | ||
4 | # Format: | ||
5 | # <config.h key>: {"info_key": <info.json key>, ["value_type": <value_type>], ["to_json": <true/false>], ["to_c": <true/false>]} | ||
6 | # value_type: one of "array", "array.int", "int", "hex", "list", "mapping" | ||
7 | # to_json: Default `true`. Set to `false` to exclude this mapping from info.json | ||
8 | # to_c: Default `true`. Set to `false` to exclude this mapping from config.h | ||
9 | # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places | ||
10 | "DEBOUNCE": {"info_key": "debounce", "value_type": "int"} | ||
11 | "DEVICE_VER": {"info_key": "usb.device_ver", "value_type": "hex"}, | ||
12 | "DESCRIPTION": {"info_key": "keyboard_folder", "to_json": false}, | ||
13 | "DIODE_DIRECTION": {"info_key": "diode_direction"}, | ||
14 | "LAYOUTS": {"info_key": "layout_aliases", "value_type": "mapping"}, | ||
15 | "LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"}, | ||
16 | "LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"}, | ||
17 | "LED_SCROLL_LOCK_PIN": {"info_key": "indicators.scroll_lock"}, | ||
18 | "MANUFACTURER": {"info_key": "manufacturer"}, | ||
19 | "RGB_DI_PIN": {"info_key": "rgblight.pin"}, | ||
20 | "RGBLED_NUM": {"info_key": "rgblight.led_count", "value_type": "int"}, | ||
21 | "RGBLED_SPLIT": {"info_key": "rgblight.split_count", "value_type": "array.int"}, | ||
22 | "RGBLIGHT_ANIMATIONS": {"info_key": "rgblight.animations.all", "value_type": "bool"}, | ||
23 | "RGBLIGHT_EFFECT_ALTERNATING": {"info_key": "rgblight.animations.alternating", "value_type": "bool"}, | ||
24 | "RGBLIGHT_EFFECT_BREATHING": {"info_key": "rgblight.animations.breathing", "value_type": "bool"}, | ||
25 | "RGBLIGHT_EFFECT_CHRISTMAS": {"info_key": "rgblight.animations.christmas", "value_type": "bool"}, | ||
26 | "RGBLIGHT_EFFECT_KNIGHT": {"info_key": "rgblight.animations.knight", "value_type": "bool"}, | ||
27 | "RGBLIGHT_EFFECT_RAINBOW_MOOD": {"info_key": "rgblight.animations.rainbow_mood", "value_type": "bool"}, | ||
28 | "RGBLIGHT_EFFECT_RAINBOW_SWIRL": {"info_key": "rgblight.animations.rainbow_swirl", "value_type": "bool"}, | ||
29 | "RGBLIGHT_EFFECT_RGB_TEST": {"info_key": "rgblight.animations.rgb_test", "value_type": "bool"}, | ||
30 | "RGBLIGHT_EFFECT_SNAKE": {"info_key": "rgblight.animations.snake", "value_type": "bool"}, | ||
31 | "RGBLIGHT_EFFECT_STATIC_GRADIENT": {"info_key": "rgblight.animations.static_gradient", "value_type": "bool"}, | ||
32 | "RGBLIGHT_EFFECT_TWINKLE": {"info_key": "rgblight.animations.twinkle"}, | ||
33 | "RGBLIGHT_LIMIT_VAL": {"info_key": "rgblight.max_brightness", "value_type": "int"}, | ||
34 | "RGBLIGHT_HUE_STEP": {"info_key": "rgblight.hue_steps", "value_type": "int"}, | ||
35 | "RGBLIGHT_SAT_STEP": {"info_key": "rgblight.saturation_steps", "value_type": "int"}, | ||
36 | "RGBLIGHT_VAL_STEP": {"info_key": "rgblight.brightness_steps", "value_type": "int"}, | ||
37 | "RGBLIGHT_SLEEP": {"info_key": "rgblight.sleep", "value_type": "bool"}, | ||
38 | "RGBLIGHT_SPLIT": {"info_key": "rgblight.split", "value_type": "bool"}, | ||
39 | "PRODUCT": {"info_key": "keyboard_folder", "to_json": false}, | ||
40 | "PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex"}, | ||
41 | "VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex"} | ||
42 | } | ||
diff --git a/data/mappings/info_rules.json b/data/mappings/info_rules.json new file mode 100644 index 000000000..97f772c4d --- /dev/null +++ b/data/mappings/info_rules.json | |||
@@ -0,0 +1,15 @@ | |||
1 | # This file maps keys between `rules.mk` and `info.json`. It is used by QMK | ||
2 | # to correctly and consistently map back and forth between the two systems. | ||
3 | { | ||
4 | # Format: | ||
5 | # <rules.mk key>: {"info_key": <info.json key>, ["value_type": <value_type>], ["to_json": <true/false>], ["to_c": <true/false>]} | ||
6 | # value_type: one of "array", "array.int", "int", "list", "hex", "mapping" | ||
7 | # to_json: Default `true`. Set to `false` to exclude this mapping from info.json | ||
8 | # to_c: Default `true`. Set to `false` to exclude this mapping from rules.mk | ||
9 | # warn_duplicate: Default `true`. Set to `false` to turn off warning when a value exists in both places | ||
10 | "BOARD": {"info_key": "board"}, | ||
11 | "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, | ||
12 | "LAYOUTS": {"info_key": "community_layouts", "value_type": "list"}, | ||
13 | "LED_MATRIX_DRIVER": {"info_key": "led_matrix.driver"}, | ||
14 | "MCU": {"info_key": "processor", "warn_duplicate": false}, | ||
15 | } | ||