aboutsummaryrefslogtreecommitdiff
path: root/docs/hardware_keyboard_guidelines.md
diff options
context:
space:
mode:
authorTakeshi ISHII <2170248+mtei@users.noreply.github.com>2020-03-26 13:13:16 +0900
committerGitHub <noreply@github.com>2020-03-25 21:13:16 -0700
commit5bd0a5a58546ab950a038fadc41846a5d9a851e5 (patch)
tree78796afa28f4a602f0da06470ed71f931e44df56 /docs/hardware_keyboard_guidelines.md
parent9fbf17b90e9e9bf23797ef524d9dabaa2adfbad5 (diff)
downloadqmk_firmware-5bd0a5a58546ab950a038fadc41846a5d9a851e5.tar.gz
qmk_firmware-5bd0a5a58546ab950a038fadc41846a5d9a851e5.zip
[Docs] added the description of the reading order of the config.h files. (#8545)
* added the description of the reading order of the config.h files. * Update docs/hardware_keyboard_guidelines.md * Update docs/hardware_keyboard_guidelines.md * Added a description of post_config.h. * sample bug fix * sample update * Update docs/hardware_keyboard_guidelines.md * Update docs/hardware_keyboard_guidelines.md * update docs/hardware_keyboard_guidelines.md * Update docs/hardware_keyboard_guidelines.md
Diffstat (limited to 'docs/hardware_keyboard_guidelines.md')
-rw-r--r--docs/hardware_keyboard_guidelines.md51
1 files changed, 51 insertions, 0 deletions
diff --git a/docs/hardware_keyboard_guidelines.md b/docs/hardware_keyboard_guidelines.md
index 5d9968f6d..4d893074e 100644
--- a/docs/hardware_keyboard_guidelines.md
+++ b/docs/hardware_keyboard_guidelines.md
@@ -61,6 +61,57 @@ This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains
61 61
62All projects need to have a `config.h` file that sets things like the matrix size, product name, USB VID/PID, description and other settings. In general, use this file to set essential information and defaults for your keyboard that will always work. 62All projects need to have a `config.h` file that sets things like the matrix size, product name, USB VID/PID, description and other settings. In general, use this file to set essential information and defaults for your keyboard that will always work.
63 63
64The `config.h` files can also be placed in sub-folders, and the order in which they are read is as follows:
65
66* `keyboards/top_folder/config.h`
67 * `keyboards/top_folder/sub_1/config.h`
68 * `keyboards/top_folder/sub_1/sub_2/config.h`
69 * `keyboards/top_folder/sub_1/sub_2/sub_3/config.h`
70 * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/config.h`
71 * `users/a_user_folder/config.h`
72 * `keyboards/top_folder/keymaps/a_keymap/config.h`
73 * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/post_config.h`
74 * `keyboards/top_folder/sub_1/sub_2/sub_3/post_config.h`
75 * `keyboards/top_folder/sub_1/sub_2/post_config.h`
76 * `keyboards/top_folder/sub_1/post_config.h`
77* `keyboards/top_folder/post_config.h`
78
79The `post_config.h` file can be used for additional post-processing, depending on what is specified in the `config.h` file. For example, if you define the `IOS_DEVICE_ENABLE` macro in your keymap-level `config.h` file as follows, you can configure more detailed settings accordingly in the `post_config.h` file:
80
81* `keyboards/top_folder/keymaps/a_keymap/config.h`
82 ```c
83 #define IOS_DEVICE_ENABLE
84 ```
85* `keyboards/top_folder/post_config.h`
86 ```c
87 #ifndef IOS_DEVICE_ENABLE
88 // USB_MAX_POWER_CONSUMPTION value for this keyboard
89 #define USB_MAX_POWER_CONSUMPTION 400
90 #else
91 // fix iPhone and iPad power adapter issue
92 // iOS device need lessthan 100
93 #define USB_MAX_POWER_CONSUMPTION 100
94 #endif
95
96 #ifdef RGBLIGHT_ENABLE
97 #ifndef IOS_DEVICE_ENABLE
98 #define RGBLIGHT_LIMIT_VAL 200
99 #define RGBLIGHT_VAL_STEP 17
100 #else
101 #define RGBLIGHT_LIMIT_VAL 35
102 #define RGBLIGHT_VAL_STEP 4
103 #endif
104 #ifndef RGBLIGHT_HUE_STEP
105 #define RGBLIGHT_HUE_STEP 10
106 #endif
107 #ifndef RGBLIGHT_SAT_STEP
108 #define RGBLIGHT_SAT_STEP 17
109 #endif
110 #endif
111 ```
112
113?> If you define options using `post_config.h` as in the above example, you should not define the same options in the keyboard- or user-level `config.h`.
114
64### `rules.mk` 115### `rules.mk`
65 116
66The presence of this file means that the folder is a keyboard target and can be used in `make` commands. This is where you setup the build environment for your keyboard and configure the default set of features. 117The presence of this file means that the folder is a keyboard target and can be used in `make` commands. This is where you setup the build environment for your keyboard and configure the default set of features.