diff options
Diffstat (limited to 'docs/hardware_keyboard_guidelines.md')
| -rw-r--r-- | docs/hardware_keyboard_guidelines.md | 51 |
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 | ||
| 62 | All 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. | 62 | All 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 | ||
| 64 | The `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 | |||
| 79 | The `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 | ||
| 66 | The 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. | 117 | The 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. |
