diff options
author | Drashna Jaelre <drashna@live.com> | 2018-03-31 21:02:40 -0700 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-04-01 00:02:40 -0400 |
commit | 162a67cbc567c11c507bfc153d155f5db2dd19bf (patch) | |
tree | 87200826601b41a4ad51c4195ec1b0f4a9e5853f /docs/feature_userspace.md | |
parent | cc323df9ba8f4361660ee2a60c3261da29c1d172 (diff) | |
download | qmk_firmware-162a67cbc567c11c507bfc153d155f5db2dd19bf.tar.gz qmk_firmware-162a67cbc567c11c507bfc153d155f5db2dd19bf.zip |
Add userspace config.h handling to build script (#2640)
* Add userspace 'config.h' file
* Add more robust docs
* Remove config.h code from drashna userspace
* Spelling error
* Include links to Config Options page
* Remove config.h documentation from userspace doc, as it's no longer needed
Diffstat (limited to 'docs/feature_userspace.md')
-rw-r--r-- | docs/feature_userspace.md | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index 950377423..454481cb2 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md | |||
@@ -3,10 +3,11 @@ | |||
3 | If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure: | 3 | If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure: |
4 | 4 | ||
5 | * `/users/<name>/` (added to the path automatically) | 5 | * `/users/<name>/` (added to the path automatically) |
6 | * `readme.md` | 6 | * `readme.md` (optional, recommended) |
7 | * `rules.mk` (included automatically) | 7 | * `rules.mk` (included automatically) |
8 | * `<name>.h` (optional) | 8 | * `<name>.h` (optional) |
9 | * `<name>.c` (optional) | 9 | * `<name>.c` (optional) |
10 | * `config.h` (optional) | ||
10 | 11 | ||
11 | `<name>.c` will need to be added to the SRC in `rules.mk` like this: | 12 | `<name>.c` will need to be added to the SRC in `rules.mk` like this: |
12 | 13 | ||
@@ -24,10 +25,31 @@ For example, | |||
24 | 25 | ||
25 | Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`. | 26 | Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`. |
26 | 27 | ||
28 | Additionally, `config.h` here will be processed like the same file in your keymap folder. This is handled separately from the `<name>.h` file. | ||
29 | |||
30 | The reason for this, is that `<name>.h` won't be added in time to add settings (such as `#define TAPPING_TERM 100`), and including the `<name.h>` file in any `config.h` files will result in compile issues. | ||
31 | |||
32 | So you should use the `config.h` for QMK settings, and the `<name>.h` file for user or keymap specific settings. | ||
33 | |||
27 | ## Readme | 34 | ## Readme |
28 | 35 | ||
29 | Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses). | 36 | Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses). |
30 | 37 | ||
38 | ## `Config.h` | ||
39 | |||
40 | If you do add a `config,h` file, you want to make sure that it only gets processed once. So you may want to start off with something like this: | ||
41 | |||
42 | ```c | ||
43 | #ifndef USERSPACE_CONFIG_H | ||
44 | #define USERSPACE_CONFIG_H | ||
45 | |||
46 | // Put normal config.h settings here: | ||
47 | |||
48 | #endif // !USERSPACE_CONFIG_H | ||
49 | ``` | ||
50 | |||
51 | You can use any option hre that you could use in your keymap's `config.h` file. You can find a list of vales [here](config_options.md). | ||
52 | |||
31 | ## Example | 53 | ## Example |
32 | 54 | ||
33 | For a brief example, checkout `/users/_example/` , or for a more detailed examples check out [`template.h`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.h) and [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in `/users/drashna/` . | 55 | For a brief example, checkout `/users/_example/` , or for a more detailed examples check out [`template.h`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.h) and [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in `/users/drashna/` . |