diff options
Diffstat (limited to 'quantum/template')
| -rw-r--r-- | quantum/template/Makefile | 6 | ||||
| -rw-r--r-- | quantum/template/README.md | 6 | ||||
| -rw-r--r-- | quantum/template/config.h | 8 | ||||
| -rw-r--r-- | quantum/template/keymaps/keymap_default.c | 66 | ||||
| -rw-r--r-- | quantum/template/template.h | 12 |
5 files changed, 14 insertions, 84 deletions
diff --git a/quantum/template/Makefile b/quantum/template/Makefile index 99c97a62c..2efa69138 100644 --- a/quantum/template/Makefile +++ b/quantum/template/Makefile | |||
| @@ -53,9 +53,9 @@ TARGET_DIR = . | |||
| 53 | SRC = %KEYBOARD%.c | 53 | SRC = %KEYBOARD%.c |
| 54 | 54 | ||
| 55 | ifdef KEYMAP | 55 | ifdef KEYMAP |
| 56 | SRC := keymaps/keymap_$(KEYMAP).c $(SRC) | 56 | SRC := keymaps/$(KEYMAP).c $(SRC) |
| 57 | else | 57 | else |
| 58 | SRC := keymaps/keymap_default.c $(SRC) | 58 | SRC := keymaps/default.c $(SRC) |
| 59 | endif | 59 | endif |
| 60 | 60 | ||
| 61 | CONFIG_H = config.h | 61 | CONFIG_H = config.h |
| @@ -107,7 +107,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | |||
| 107 | # Atmel DFU loader 4096 | 107 | # Atmel DFU loader 4096 |
| 108 | # LUFA bootloader 4096 | 108 | # LUFA bootloader 4096 |
| 109 | # USBaspLoader 2048 | 109 | # USBaspLoader 2048 |
| 110 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | 110 | OPT_DEFS += -DBOOTLOADER_SIZE=512 |
| 111 | 111 | ||
| 112 | 112 | ||
| 113 | # Build Options | 113 | # Build Options |
diff --git a/quantum/template/README.md b/quantum/template/README.md index ecea7dd69..f34862cd9 100644 --- a/quantum/template/README.md +++ b/quantum/template/README.md | |||
| @@ -88,7 +88,7 @@ Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - | |||
| 88 | 88 | ||
| 89 | ## Macro shortcuts: Send a whole string when pressing just one key | 89 | ## Macro shortcuts: Send a whole string when pressing just one key |
| 90 | 90 | ||
| 91 | Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymap_default.c). | 91 | Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymaps/default.c). |
| 92 | 92 | ||
| 93 | ```c | 93 | ```c |
| 94 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. | 94 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. |
| @@ -171,10 +171,10 @@ Depending on which keymap you would like to use, you will have to compile slight | |||
| 171 | To build with the default keymap, simply run `make`. | 171 | To build with the default keymap, simply run `make`. |
| 172 | 172 | ||
| 173 | ### Other Keymaps | 173 | ### Other Keymaps |
| 174 | Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document (you can find in top README.md) and existent keymap files. | 174 | Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` and see keymap document (you can find in top README.md) and existent keymap files. |
| 175 | 175 | ||
| 176 | To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: | 176 | To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: |
| 177 | ``` | 177 | ``` |
| 178 | $ make KEYMAP=[default|jack|<name>] | 178 | $ make KEYMAP=[default|jack|<name>] |
| 179 | ``` | 179 | ``` |
| 180 | Keymaps follow the format **__keymap\_\<name\>.c__** and are stored in the `keymaps` folder. \ No newline at end of file | 180 | Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder. \ No newline at end of file |
diff --git a/quantum/template/config.h b/quantum/template/config.h index 9afedbcc0..7d6149f43 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h | |||
| @@ -29,14 +29,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 29 | #define DESCRIPTION A custom keyboard | 29 | #define DESCRIPTION A custom keyboard |
| 30 | 30 | ||
| 31 | /* key matrix size */ | 31 | /* key matrix size */ |
| 32 | #define MATRIX_ROWS 4 | 32 | #define MATRIX_ROWS 2 |
| 33 | #define MATRIX_COLS 12 | 33 | #define MATRIX_COLS 3 |
| 34 | 34 | ||
| 35 | // Planck PCB default pin-out | 35 | // Planck PCB default pin-out |
| 36 | // Change this to how you wired your keyboard | 36 | // Change this to how you wired your keyboard |
| 37 | // COLS: Left to right, ROWS: Top to bottom | 37 | // COLS: Left to right, ROWS: Top to bottom |
| 38 | #define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } | 38 | #define COLS (int []){ F1, F0, B0 } |
| 39 | #define ROWS (int []){ D0, D5, B5, B6 } | 39 | #define ROWS (int []){ D0, D5 } |
| 40 | 40 | ||
| 41 | /* COL2ROW or ROW2COL */ | 41 | /* COL2ROW or ROW2COL */ |
| 42 | #define DIODE_DIRECTION COL2ROW | 42 | #define DIODE_DIRECTION COL2ROW |
diff --git a/quantum/template/keymaps/keymap_default.c b/quantum/template/keymaps/keymap_default.c deleted file mode 100644 index 1e6684da7..000000000 --- a/quantum/template/keymaps/keymap_default.c +++ /dev/null | |||
| @@ -1,66 +0,0 @@ | |||
| 1 | // This is the canonical layout file for the Quantum project. If you want to add another keyboard, | ||
| 2 | // this is the style you want to emulate. | ||
| 3 | |||
| 4 | #include "%KEYBOARD%.h" | ||
| 5 | |||
| 6 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 7 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 8 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 9 | // entirely and just use numbers. | ||
| 10 | #define _QW 0 | ||
| 11 | #define _CM 1 | ||
| 12 | #define _DV 2 | ||
| 13 | #define _LW 3 | ||
| 14 | #define _RS 4 | ||
| 15 | |||
| 16 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 17 | [_QW] = { /* Qwerty */ | ||
| 18 | {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, | ||
| 19 | {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, | ||
| 20 | {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, | ||
| 21 | {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} | ||
| 22 | }, | ||
| 23 | [_CM] = { /* Colemak */ | ||
| 24 | {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, | ||
| 25 | {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, | ||
| 26 | {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, | ||
| 27 | {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} | ||
| 28 | }, | ||
| 29 | [_DV] = { /* Dvorak */ | ||
| 30 | {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, | ||
| 31 | {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, | ||
| 32 | {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, | ||
| 33 | {M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} | ||
| 34 | }, | ||
| 35 | [_RS] = { /* RAISE */ | ||
| 36 | {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, | ||
| 37 | {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, | ||
| 38 | {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, | ||
| 39 | {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} | ||
| 40 | }, | ||
| 41 | [_LW] = { /* LOWER */ | ||
| 42 | {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, | ||
| 43 | {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, | ||
| 44 | {KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS}, | ||
| 45 | {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} | ||
| 46 | } | ||
| 47 | }; | ||
| 48 | |||
| 49 | const uint16_t PROGMEM fn_actions[] = { | ||
| 50 | |||
| 51 | }; | ||
| 52 | |||
| 53 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
| 54 | { | ||
| 55 | // MACRODOWN only works in this function | ||
| 56 | switch(id) { | ||
| 57 | case 0: | ||
| 58 | if (record->event.pressed) { | ||
| 59 | register_code(KC_RSFT); | ||
| 60 | } else { | ||
| 61 | unregister_code(KC_RSFT); | ||
| 62 | } | ||
| 63 | break; | ||
| 64 | } | ||
| 65 | return MACRO_NONE; | ||
| 66 | }; | ||
diff --git a/quantum/template/template.h b/quantum/template/template.h index de3edf324..d4d78e4c9 100644 --- a/quantum/template/template.h +++ b/quantum/template/template.h | |||
| @@ -11,16 +11,12 @@ | |||
| 11 | // The first section contains all of the arguements | 11 | // The first section contains all of the arguements |
| 12 | // The second converts the arguments into a two-dimensional array | 12 | // The second converts the arguments into a two-dimensional array |
| 13 | #define KEYMAP( \ | 13 | #define KEYMAP( \ |
| 14 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ | 14 | k00, k01, k02, \ |
| 15 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ | 15 | k10, k11, \ |
| 16 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ | ||
| 17 | k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ | ||
| 18 | ) \ | 16 | ) \ |
| 19 | { \ | 17 | { \ |
| 20 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ | 18 | { k00, k01, k02 }, \ |
| 21 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ | 19 | { k10, KC_NO, k11 }, \ |
| 22 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ | ||
| 23 | { k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \ | ||
| 24 | } | 20 | } |
| 25 | 21 | ||
| 26 | void * matrix_init_user(void); | 22 | void * matrix_init_user(void); |
