X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=docs%2Fgetting_started_introduction.md;h=e183d77eeb57854157d9e7981efc325f18960894;hb=2a231457bd494079c36cf3e07c9b887016adb491;hp=849e992085df661aa2e1f44714a198ee03501cb5;hpb=bb11df6b7a4ef190be62746887f2421718ae2a6e;p=qmk_firmware.git diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md index 849e99208..e183d77ee 100644 --- a/docs/getting_started_introduction.md +++ b/docs/getting_started_introduction.md @@ -2,19 +2,29 @@ This page attempts to explain the basic information you need to know to work with the QMK project. It assumes that you are familiar with navigating a Unix shell, but does not assume you are familiar with C or with compiling using make. -## Basic QMK structure +## Basic QMK Structure 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. -### Keyboard project structure +### Userspace 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: +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`, its subfolder `handwired` and its vendor and manufacture subdirectories e.g. `clueboard` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard/2x1800`. Within it, you'll find the following structure: * `keymaps/`: Different keymaps that can be built -* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile` +* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `rules.mk`. * `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`. +* `info.json`: The file used for setting layout for QMK Configurator. See [Configurator Support](reference_configurator_support.md) for more information. +* `readme.md`: A brief overview of the keyboard. +* `.h`: This file is where the keyboard layout is defined against the keyboard's switch matrix. +* `.c`: This file is where you can find custom code for the keyboard. -### Keymap structure +For more information on project structure, see [QMK Keyboard Guidelines](hardware_keyboard_guidelines.md). + +### Keymap Structure In every keymap folder, the following files may be found. Only `keymap.c` is required, and if the rest of the files are not found the default options will be chosen. @@ -23,25 +33,28 @@ In every keymap folder, the following files may be found. Only `keymap.c` is req * `rules.mk`: the features of QMK that are enabled * `readme.md`: a description of your keymap, how others might use it, and explanations of features. Please upload images to a service like imgur. -# The `config.h` file +# 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 ```