X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=docs%2Fgetting_started_introduction.md;h=3b6a488ed603f19b32480b966dcd940d2a6bd766;hb=a173eda6d28bd09b2d59448a6532edb7a6c8e358;hp=cf80d40b50e009efd5d8e6f5468fb9d1e998e461;hpb=b4f45766315a84ad5e8a01953f8a10ac0657fe37;p=qmk_firmware.git diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index cf80d40b5..3b6a488ed 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -6,6 +6,10 @@ This page attempts to explain the basic information you need to know to work wit QMK is a fork of [Jun Wako](https://github.com/tmk)'s [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders. +### Userspace Structure + +Within the folder `users` is a directory for each user. This is a place for users to put code that they might use between keyboards. See the docs for [Userspace feature](feature_userspace.md) for more information. + ### Keyboard Project Structure Within the folder `keyboards` and its subfolder `handwired` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within it you'll find the following structure: @@ -25,23 +29,26 @@ In every keymap folder, the following files may be found. Only `keymap.c` is req # The `config.h` File -There are 2 `config.h` locations: +There are 3 possible `config.h` locations: * keyboard (`/keyboards//config.h`) +* userspace (`/users//config.h`) * keymap (`/keyboards//keymaps//config.h`) -If the keymap `config.h` exists, that file is included by the build system and the keyboard `config.h` is not included. If you wish to override settings in your keymap's `config.h` you will need to include some glue code: +The build system automatically picks up the config files in the above order. If you wish to override any setting set by a previous `config.h` you will need to first include some boilerplate code for the settings you wish to change. ``` -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once ``` -If you want to override a setting from the parent `config.h` file, you need to `#undef` and then `#define` the setting again, like this: +Then to override a setting from the previous `config.h` file you must `#undef` and then `#define` the setting again. + +The boilerplate code and setting look like this together: + +``` +#pragma once -```c +// overrides go here! #undef MY_SETTING #define MY_SETTING 4 ```