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 /users | |
parent | cc323df9ba8f4361660ee2a60c3261da29c1d172 (diff) |
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 'users')
-rw-r--r-- | users/drashna/readme.md | 27 | ||||
-rw-r--r-- | users/drashna/rules.mk | 6 |
2 files changed, 0 insertions, 33 deletions
diff --git a/users/drashna/readme.md b/users/drashna/readme.md index e3e5d399d8..c4e305e15b 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -3,33 +3,6 @@ Overview This is my personal userspace file. Most of my code exists here, as it's heavily shared. -Userspace Config.h ------------------- - -By default, the userspace feature doesn't include a `config.h` file the way that that keyboards, revisions, keymaps and layouts handle them. This means that if you want global configurations via userspace, it's very difficult to implement. - -The reason for using seperate files here is that the `drashna.h` file doesn't get called in such a way that will actually define QMK settings. Additionally, attempting to add it to the `config.h` files has issues. Namely, the `drashna.h` file requires the `quantum.h` file... but including this to the `config.h` attemps to redefines a bunch of settings and breaks the firmare. Removing the `quantum.h` include means that a number of data structures no longer get added, and the `SAFE_RANGE` value is no longer defined, as well. So we need both a `config.h` for global config, and we need a seperate h file for local settings. - -However, the `rules.mk` file is included when building the firmware. So we can hijack that process to "manually" add a `config.h`. To do so, you would need to add the following to the `rules.mk` in your userspace: - -```c -ifneq ("$(wildcard users/$(KEYMAP)/config.h)","") - CONFIG_H += users/$(KEYMAP)/config.h -endif -``` - -You can replace `$(KEYMAP)` with your name, but it's not necessary. This checks for the existence of `/users/<name>/config.h`, and if it exists, includes it like every other `config.h` file, allowing you to make global `config.h` settings. - -As for the `config.h` file, you want to make sure that it has an "ifdef" in it to make sure it's only used once. So you want something like this: - -```c -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H - -// put stuff here - -#endif -``` Custom userspace handlers ------------------------- diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 53e5da43db..062ecd3c49 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -2,10 +2,4 @@ SRC += drashna.c EXTRAFLAGS += -flto -ifneq ("$(wildcard users/$(KEYMAP)/config.h)","") - CONFIG_H += users/$(KEYMAP)/config.h -endif -ifeq ($(strip $(NO_SECRETS)), yes) - OPT_DEFS += -DNO_SECRETS -endif |