X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=docs%2Ffeature_layouts.md;h=11f5831bbd14a239d2bc23cb45935a2d7b11ba72;hb=c8bdc75e1d3123a4ccf8631d70dc187bfeb7bc09;hp=4d75270dcdf1a3a6ab6e7ebeb0f5cfbe72eb1f06;hpb=dc7d0c7b7442b87600352e083e3da4a08cb2d069;p=qmk_firmware.git diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md index 4d75270dc..11f5831bb 100644 --- a/docs/feature_layouts.md +++ b/docs/feature_layouts.md @@ -43,35 +43,30 @@ The folder name must be added to the keyboard's `rules.mk`: LAYOUTS = 60_ansi -`LAYOUTS` can be appended in the subproject's `rules.mk`: +`LAYOUTS` can be set in any keyboard folder level's `rules.mk`: - LAYOUTS += 60_iso + LAYOUTS = 60_iso -but the `LAYOUT_` variable must be defined in `.h` as well. +but the `LAYOUT_` variable must be defined in `.h` as well. ## Tips for making layouts keyboard-agnostic -Instead of using `#include "planck.h"`, you can use this line to include whatever `.h` (`.h` should not be included here) file that is being compiled: +Instead of using `#include "planck.h"`, you can use this line to include whatever `.h` (`.h` should not be included here) file that is being compiled: #include QMK_KEYBOARD_H -In your config.h, you can also use this variable to include the keyboard's `config.h`: - - #include QMK_KEYBOARD_CONFIG_H - If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement: -* `KEYBOARD_` -* `SUBPROJECT_` +* `KEYBOARD__` For example: ```c #ifdef KEYBOARD_planck - #ifdef SUBPROJECT_rev4 + #ifdef KEYBOARD_planck_rev4 planck_rev4_function(); #endif #endif ``` -Note that the names are lowercase and match the folder/file names for the keyboard/subproject exactly. \ No newline at end of file +Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly.