aboutsummaryrefslogtreecommitdiff
path: root/docs/feature_layouts.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/feature_layouts.md')
-rw-r--r--docs/feature_layouts.md15
1 files changed, 7 insertions, 8 deletions
diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md
index 4d75270dc..5763b7380 100644
--- a/docs/feature_layouts.md
+++ b/docs/feature_layouts.md
@@ -43,15 +43,15 @@ The folder name must be added to the keyboard's `rules.mk`:
43 43
44 LAYOUTS = 60_ansi 44 LAYOUTS = 60_ansi
45 45
46`LAYOUTS` can be appended in the subproject's `rules.mk`: 46`LAYOUTS` can be set in any keyboard folder level's `rules.mk`:
47 47
48 LAYOUTS += 60_iso 48 LAYOUTS = 60_iso
49 49
50but the `LAYOUT_<layout>` variable must be defined in `<subproject>.h` as well. 50but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
51 51
52## Tips for making layouts keyboard-agnostic 52## Tips for making layouts keyboard-agnostic
53 53
54Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<subproject>.h` should not be included here) file that is being compiled: 54Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<folder>.h` should not be included here) file that is being compiled:
55 55
56 #include QMK_KEYBOARD_H 56 #include QMK_KEYBOARD_H
57 57
@@ -61,17 +61,16 @@ In your config.h, you can also use this variable to include the keyboard's `conf
61 61
62If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement: 62If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement:
63 63
64* `KEYBOARD_<keyboard>` 64* `KEYBOARD_<folder1>_<folder2>`
65* `SUBPROJECT_<subproject>`
66 65
67For example: 66For example:
68 67
69```c 68```c
70#ifdef KEYBOARD_planck 69#ifdef KEYBOARD_planck
71 #ifdef SUBPROJECT_rev4 70 #ifdef KEYBOARD_planck_rev4
72 planck_rev4_function(); 71 planck_rev4_function();
73 #endif 72 #endif
74#endif 73#endif
75``` 74```
76 75
77Note that the names are lowercase and match the folder/file names for the keyboard/subproject exactly. \ No newline at end of file 76Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly. \ No newline at end of file