From 78e567896bd13527ccffc1b48bfc64f29cc51a46 Mon Sep 17 00:00:00 2001 From: John Lindquist Date: Mon, 1 Jun 2015 15:55:34 -0600 Subject: [PATCH 01/20] Update PCB_GUIDE.md --- keyboard/planck/PCB_GUIDE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 833e144b3b..f757407463 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -15,6 +15,11 @@ 1. Install AVR GCC with your favorite package manager. 2. Install [DFU-Programmer][dfu-prog]. +##Verify Your Installation +1. Clone the following repository: https://github.com/jackhumbert/tmk_keyboard +2. Open a Terminal and `cd` into `tmk_keyboard/keyboard/planck` +3. Run `make`. This should output a lot of information about the build process. + ## Using the built-in functions Here is a list of some of the functions avaiable from the command line: From 44bc2eefa39c0d49c8cf068a56e545b9bbd7f4c2 Mon Sep 17 00:00:00 2001 From: angerthosenear Date: Mon, 1 Jun 2015 17:46:08 -0500 Subject: [PATCH 02/20] Create extended_keymap_angerthosenear.c Adding my keymap to the available keymaps list. --- .../extended_keymap_angerthosenear.c | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c diff --git a/keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c b/keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c new file mode 100644 index 0000000000..34710d60df --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c @@ -0,0 +1,50 @@ +#include "extended_keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, BL_STEP, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* WASD + NumPad */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_PMNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PPLS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PENT, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_SPC, KC_P0, FUNC(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_DEL}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; From 59f2001b311dc85fc5b6b8851080b0bb70f2aadf Mon Sep 17 00:00:00 2001 From: cr3473 Date: Tue, 2 Jun 2015 12:12:44 -0700 Subject: [PATCH 03/20] Added ability to set the MATRIX in build/make --- keyboard/planck/Makefile | 9 +++++++-- keyboard/planck/{matrix.c => matrix_handwired.c} | 0 2 files changed, 7 insertions(+), 2 deletions(-) rename keyboard/planck/{matrix.c => matrix_handwired.c} (100%) diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 964e6832ea..ad25854e6d 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -47,13 +47,18 @@ TOP_DIR = ../.. # Directory keyboard dependent files exist TARGET_DIR = . +# Default to PCB matrix +ifndef MATRIX + MATRIX=matrix_pcb.c +endif +$(warning MATRIX: $(MATRIX)) # # project specific files ifdef COMMON SRC = keymap_common.c \ - matrix_pcb.c \ + $(MATRIX) \ led.c \ backlight.c @@ -66,7 +71,7 @@ endif else SRC = extended_keymap_common.c \ - matrix_pcb.c \ + $(MATRIX) \ led.c \ backlight.c diff --git a/keyboard/planck/matrix.c b/keyboard/planck/matrix_handwired.c similarity index 100% rename from keyboard/planck/matrix.c rename to keyboard/planck/matrix_handwired.c From 5ca7538578607d58abc79527c2ee7ccd2a3b24fd Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 27 May 2015 12:25:38 -0400 Subject: [PATCH 04/20] catching up --- keyboard/atomic/keymap_ricky.c | 15 +++++++ .../extended_keymaps/extended_keymap_daniel.c | 40 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 keyboard/atomic/keymap_ricky.c create mode 100644 keyboard/planck/extended_keymaps/extended_keymap_daniel.c diff --git a/keyboard/atomic/keymap_ricky.c b/keyboard/atomic/keymap_ricky.c new file mode 100644 index 0000000000..fcc91a1fa5 --- /dev/null +++ b/keyboard/atomic/keymap_ricky.c @@ -0,0 +1,15 @@ +#include "keymap_common.h" + +// JCK: Semi-Standard layout + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + [0] = KEYMAP_JCK(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, PSCR, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, INS, \ + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, DEL, \ + LCTL, LGUI, LALT, SPC, RALT, RCTL, LEFT, DOWN, RGHT) +}; +const uint16_t PROGMEM fn_actions[] = { +}; + diff --git a/keyboard/planck/extended_keymaps/extended_keymap_daniel.c b/keyboard/planck/extended_keymaps/extended_keymap_daniel.c new file mode 100644 index 0000000000..63ead6a02a --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_daniel.c @@ -0,0 +1,40 @@ +#include "extended_keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* RAISE */ + {KC_GRV, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_EQL}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, S(KC_MINS), KC_BSLS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[2] = { /* LOWER */ + {S(KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, S(KC_EQL)}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ENT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(1), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(2) // to LOWER +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; From caa7727e96fee5105ee8dd0cd501f91a2015b887 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 27 May 2015 22:43:34 -0400 Subject: [PATCH 05/20] daniel --- .../planck/extended_keymaps/extended_keymap_daniel.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/keyboard/planck/extended_keymaps/extended_keymap_daniel.c b/keyboard/planck/extended_keymaps/extended_keymap_daniel.c index 63ead6a02a..f83a62a924 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_daniel.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_daniel.c @@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, - {BL_STEP, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {FUNC(3), KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} // Space is repeated to accommadate for both spacebar wiring positions }, [1] = { /* RAISE */ @@ -19,6 +19,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ENT}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions } }; @@ -26,6 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_MOMENTARY(1), // to RAISE [2] = ACTION_LAYER_MOMENTARY(2) // to LOWER + [3] = ACTION_LAYER_MOMENTARY(3) // to LOWER }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) From dd3598dce6072a88b0e3f9738ef02701eb618d1b Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 27 May 2015 23:15:08 -0400 Subject: [PATCH 06/20] daniel --- keyboard/planck/extended_keymaps/extended_keymap_daniel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/planck/extended_keymaps/extended_keymap_daniel.c b/keyboard/planck/extended_keymaps/extended_keymap_daniel.c index f83a62a924..d3565495f5 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_daniel.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_daniel.c @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_MOMENTARY(1), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(2) // to LOWER + [2] = ACTION_LAYER_MOMENTARY(2), // to LOWER [3] = ACTION_LAYER_MOMENTARY(3) // to LOWER }; From a53efa45619ac81f516908a7a16c1e7aaaa04269 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 30 May 2015 13:31:52 -0400 Subject: [PATCH 07/20] Create PCB_GUIDE.md --- keyboard/planck/PCB_GUIDE.md | 110 +++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 keyboard/planck/PCB_GUIDE.md diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md new file mode 100644 index 0000000000..e4c307b44a --- /dev/null +++ b/keyboard/planck/PCB_GUIDE.md @@ -0,0 +1,110 @@ +# Planck Firmware Guide + +## Setting up the environment + +### Windows +1. Install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. +2. Install [DFU-Programmer][dfu-prog] (the -win one). +3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. + +### Mac +1. Install [CrossPack](https://www.obdev.at/downloads/crosspack/CrossPack-AVR-20131216.dmg). +2. Install [DFU-Programmer][dfu-prog]. + +### Linux +1. Install AVR GCC with your favorite package manager. +2. Install [DFU-Programmer][dfu-prog]. + +## Using the built-in functions + +Here is a list of some of the functions avaiable from the command line: + +* `make clean`: clean the environment - may be required in-between builds +* `make`: compile the code +* `make COMMON=true`: compile with the common (non-extended) keymap +* `make KEYMAP=`: compile with the extended keymap file `extended_keymaps_extended_keymap_.c` +* `make COMMON=true KEYMAP=`: compile with the common keymap file `common_keymaps/keymap_.c` +* `make dfu`: build and flash the layout to the PCB +* `make dfu-force`: build and force-flash the layout to the PCB (may be require for first flash) + +Generally, the instructions to flash the PCB are as follows: + +1. Make changes to the appropriate keymap file +2. Save the file +3. `make clean` +4. Press the reset button on the PCB/press the key with the `RESET` keycode +5. `make dfu` - use the necessary `KEYMAP=` or `COMMON=true` here. + +## Extended keymap + +### Keymap + +Unlike the common keymap, prefixing the keycodes with `KC_` is required. A full list of the keycodes is available [here](https://github.com/jackhumbert/tmk_keyboard/blob/master/doc/keycode.txt). For the keycodes available only in the extended keymap, see this [header file](https://github.com/jackhumbert/tmk_keyboard/blob/master/keyboard/planck/extended_keymap_common.h). + +You can use modifiers with keycodes like this: + + LCTL(KC_C) + +Which will generate Ctrl+c. These are daisy-chainable, meaning you can do things like: + + LCTL(LALT(KC_C)) + +That will generate Ctrl+Alt+c. The entire list of these functions is here: + +* `LCTL()`: Left control +* `LSFT()` / `S()`: Left shift +* `LALT()`: Left alt/opt +* `LGUI()`: Left win/cmd +* `RCTL()`: Right control +* `RSFT()`: Right shift +* `RALT()`: Right alt/opt +* `RGUI()`: Right win/cmd + +`S(KC_1)`-like entries are useful in writing keymaps for the Planck. + +### Other keycodes + +A number of other keycodes have been added that you may find useful: + +* `CM_`: the Colemak equivalent of a key (in place of `KC_`), when using Colemak in software (`CM_O` generates `KC_SCLN`) +* `RESET`: jump to bootloader for flashing (same as press the reset button) +* `BL_STEP`: step through the backlight brightnesses +* `BL_<0-15>`: set backlight brightness to 0-15 +* `BL_DEC`: lower the backlight brightness +* `BL_INC`: raise the backlight brightness +* `BL_TOGG`: toggle the backlight on/off + +### Function layers + +The extended keymap extends the number of function layers from 32 to the near-infinite value of 256. Rather than using `FN` notation (still avaiable, but limited to `FN0`-`FN31`), you can use the `FUNC()` notation. `F()` is a shortcut for this. + +The function actions are unchanged, and you can see the full list of them [here](https://github.com/jackhumbert/tmk_keyboard/blob/master/common/action_code.h). They are explained in detail [here](https://github.com/jackhumbert/tmk_keyboard/blob/master/doc/keymap.md#2-action). + +### Macros + +Macros have been setup in the `extended_keymaps/extended_keymaps_default.c` file so that you can use `M()` to access a macro in the `action_get_macro` section on your keymap. The switch/case structure you see here is required, and is setup for `M(0)` - you'll need to copy and paste the code to look like this (e.g. to support `M(3)`): + + switch(id) { + case 0: + return MACRODOWN(TYPE(KC_A), END); + break; + case 1: + return MACRODOWN(TYPE(KC_B), END); + break; + case 2: + return MACRODOWN(TYPE(KC_C), END); + break; + case 3: + return MACRODOWN(TYPE(KC_D), END); + break; + } + return MACRO_NONE; + +`MACRODOWN()` is a shortcut for `(record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)` which tells the macro to execute when the key is pressed. Without this, the macro will be executed on both the down and up stroke. + +[cygwin]: https://www.cygwin.com/ +[mingw]: http://www.mingw.org/ +[mhv]: https://infernoembedded.com/products/avr-tools +[winavr]: http://winavr.sourceforge.net/ +[crosspack]: http://www.obdev.at/products/crosspack/index.html +[dfu-prog]: http://dfu-programmer.sourceforge.net/ From 68f48fcc58a44727a9da02c861b14ab20bb2c68e Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 30 May 2015 15:47:21 -0400 Subject: [PATCH 08/20] guide --- keyboard/planck/PCB_GUIDE.md | 2 +- keyboard/planck/common_keymaps/keymap_shane.c | 44 +++++++++---------- keyboard/planck/keymap_common.h | 43 ++++++++++++++++++ 3 files changed, 65 insertions(+), 24 deletions(-) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index e4c307b44a..833e144b3b 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -33,7 +33,7 @@ Generally, the instructions to flash the PCB are as follows: 2. Save the file 3. `make clean` 4. Press the reset button on the PCB/press the key with the `RESET` keycode -5. `make dfu` - use the necessary `KEYMAP=` or `COMMON=true` here. +5. `make dfu` - use the necessary `KEYMAP=` and/or `COMMON=true` arguments here. ## Extended keymap diff --git a/keyboard/planck/common_keymaps/keymap_shane.c b/keyboard/planck/common_keymaps/keymap_shane.c index d4e40fe63a..8d5ad68753 100644 --- a/keyboard/planck/common_keymaps/keymap_shane.c +++ b/keyboard/planck/common_keymaps/keymap_shane.c @@ -1,5 +1,3 @@ -// https://github.com/shanecelis/tmk_keyboard/blob/master/keyboard/planck/keymap_shane.c - #include "keymap_common.h" #include "action_layer.h" #include "action.h" @@ -11,30 +9,30 @@ */ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = KEYMAP_AND_SWAP( /* Base */ - TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, - LCTL, A, S, D, F, G, H, J, K, L, SCLN, BSPC, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, - /*ALPHA*/FN3, /*HYPER*/ /*SUPER*/LGUI, /*META*/LALT, LCTL, FN2, FN6, FN1, LEFT, DOWN, UP, RGHT), + TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, + LCTL, A, S, D, F, G, H, J, K, L, SCLN, BSPC, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN5, + /*ALPHA*/FN3, /*HYPER*/ /*SUPER*/LGUI, /*META*/LALT, LCTL, FN2, FN6, FN1, LEFT, DOWN, UP, RGHT), [2] = KEYMAP_AND_SWAP( /* More modifiers */ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RCTL, RALT, RGUI, TRNS), + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RCTL, RALT, RGUI, TRNS), [4] = KEYMAP_AND_SWAP( /* WASD */ - TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, LEFT, DOWN, RIGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, LEFT, DOWN, RIGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), [6] = KEYMAP_AND_SWAP( /* Raise/FN1 */ - FN23, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, EQL, - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, ENT, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, TRNS, - PAUS, TRNS, TRNS, TRNS, TRNS, BSPC, TRNS, MUTE, PGUP, PGDN, MNXT), + FN23, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, EQL, + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, ENT, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, BSLS, TRNS, + PAUS, TRNS, TRNS, TRNS, TRNS, BSPC, TRNS, MUTE, PGUP, PGDN, MNXT), [8] = KEYMAP_AND_SWAP( /* Lower/FN2 */ - ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN19, FN20, TRNS, - TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN24, FN25, LBRC, RBRC, TRNS, TRNS, - FN4, TRNS, TRNS, TRNS, TRNS, ENT, TRNS, MPLY, VOLD, VOLU, MPRV), + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN19, FN20, TRNS, + TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, QUOT, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN24, FN25, LBRC, RBRC, TRNS, TRNS, + FN4, TRNS, TRNS, TRNS, TRNS, ENT, TRNS, MPLY, VOLD, VOLU, MPRV), }; enum function_id { @@ -97,4 +95,4 @@ const uint16_t PROGMEM fn_actions[] = { [24] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), [25] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), [26] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), -}; +}; \ No newline at end of file diff --git a/keyboard/planck/keymap_common.h b/keyboard/planck/keymap_common.h index d888d81733..4a0bcfbb08 100644 --- a/keyboard/planck/keymap_common.h +++ b/keyboard/planck/keymap_common.h @@ -82,5 +82,48 @@ extern const uint16_t fn_actions[]; { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \ } +#define KEYMAP_REVERSE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ + ) { \ + { KC_##K0B, KC_##K0A, KC_##K09, KC_##K08, KC_##K07, KC_##K06, KC_##K05, KC_##K04, KC_##K03, KC_##K02, KC_##K01, KC_##K00 }, \ + { KC_##K1B, KC_##K1A, KC_##K19, KC_##K18, KC_##K17, KC_##K16, KC_##K15, KC_##K14, KC_##K13, KC_##K12, KC_##K11, KC_##K10 }, \ + { KC_##K2B, KC_##K2A, KC_##K29, KC_##K28, KC_##K27, KC_##K26, KC_##K25, KC_##K24, KC_##K23, KC_##K22, KC_##K21, KC_##K20 }, \ + { KC_##K3B, KC_##K3A, KC_##K39, KC_##K38, KC_##K37, KC_##K35, KC_##K35, KC_##K34, KC_##K33, KC_##K32, KC_##K31, KC_##K30 }, \ + } + +#define KEYMAP_AND_REVERSE(args...) KEYMAP(args), KEYMAP_REVERSE(args) + +#define KEYMAP_SWAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ + ) { \ + { KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05 }, \ + { KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15 }, \ + { KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25 }, \ + { KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K35, KC_##K35, KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34 }, \ +} + +#define KEYMAP_AND_SWAP(args...) KEYMAP(args), KEYMAP_SWAP(args) + +/* + Keymap for the Planck 48 key variant. + */ +#define KEYMAP_48( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B }, \ +} + #endif From af4f016b4fe52b7f53d5789cadc9449ab0c96fab Mon Sep 17 00:00:00 2001 From: John Lindquist Date: Mon, 1 Jun 2015 15:55:34 -0600 Subject: [PATCH 09/20] Update PCB_GUIDE.md --- keyboard/planck/PCB_GUIDE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 833e144b3b..f757407463 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -15,6 +15,11 @@ 1. Install AVR GCC with your favorite package manager. 2. Install [DFU-Programmer][dfu-prog]. +##Verify Your Installation +1. Clone the following repository: https://github.com/jackhumbert/tmk_keyboard +2. Open a Terminal and `cd` into `tmk_keyboard/keyboard/planck` +3. Run `make`. This should output a lot of information about the build process. + ## Using the built-in functions Here is a list of some of the functions avaiable from the command line: From cea51941a469d85ed21a209526e493f67c853f3d Mon Sep 17 00:00:00 2001 From: angerthosenear Date: Mon, 1 Jun 2015 17:46:08 -0500 Subject: [PATCH 10/20] Create extended_keymap_angerthosenear.c Adding my keymap to the available keymaps list. --- .../extended_keymap_angerthosenear.c | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c diff --git a/keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c b/keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c new file mode 100644 index 0000000000..34710d60df --- /dev/null +++ b/keyboard/planck/extended_keymaps/extended_keymap_angerthosenear.c @@ -0,0 +1,50 @@ +#include "extended_keymap_common.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, BL_STEP, FUNC(2), KC_SPC, KC_SPC, FUNC(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + // Space is repeated to accommadate for both spacebar wiring positions +}, +[1] = { /* WASD + NumPad */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_PMNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PPLS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PENT, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_SPC, KC_P0, FUNC(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, +[2] = { /* RAISE */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* LOWER */ + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_DEL}, + {KC_TRNS, FUNC(3), FUNC(4), LSFT(RSFT(KC_PAUSE)), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + return MACRODOWN(T(CM_T), END); + break; + } + return MACRO_NONE; +}; From bcb04570eaf80d3eeb89d79dec9336b47d65d622 Mon Sep 17 00:00:00 2001 From: cr3473 Date: Tue, 2 Jun 2015 13:58:45 -0700 Subject: [PATCH 11/20] PCB Guide edits and update to joe's keymap --- keyboard/planck/PCB_GUIDE.md | 7 +- .../extended_keymaps/extended_keymap_joe.c | 71 ++++++++----------- 2 files changed, 35 insertions(+), 43 deletions(-) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index f757407463..efe960abbf 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -22,12 +22,13 @@ ## Using the built-in functions -Here is a list of some of the functions avaiable from the command line: +Here is a list of some of the functions available from the command line: * `make clean`: clean the environment - may be required in-between builds * `make`: compile the code * `make COMMON=true`: compile with the common (non-extended) keymap -* `make KEYMAP=`: compile with the extended keymap file `extended_keymaps_extended_keymap_.c` +* `make MATRIX=`: compile with the referenced matrix file. Default if unspecified is `matrix_pcb.c`. For handwired boards, use `matrix_handwired.c`. +* `make KEYMAP=`: compile with the extended keymap file `extended_keymaps/extended_keymap_.c` * `make COMMON=true KEYMAP=`: compile with the common keymap file `common_keymaps/keymap_.c` * `make dfu`: build and flash the layout to the PCB * `make dfu-force`: build and force-flash the layout to the PCB (may be require for first flash) @@ -81,7 +82,7 @@ A number of other keycodes have been added that you may find useful: ### Function layers -The extended keymap extends the number of function layers from 32 to the near-infinite value of 256. Rather than using `FN` notation (still avaiable, but limited to `FN0`-`FN31`), you can use the `FUNC()` notation. `F()` is a shortcut for this. +The extended keymap extends the number of function layers from 32 to the near-infinite value of 256. Rather than using `FN` notation (still available, but limited to `FN0`-`FN31`), you can use the `FUNC()` notation. `F()` is a shortcut for this. The function actions are unchanged, and you can see the full list of them [here](https://github.com/jackhumbert/tmk_keyboard/blob/master/common/action_code.h). They are explained in detail [here](https://github.com/jackhumbert/tmk_keyboard/blob/master/doc/keymap.md#2-action). diff --git a/keyboard/planck/extended_keymaps/extended_keymap_joe.c b/keyboard/planck/extended_keymaps/extended_keymap_joe.c index 9de6cf3964..ca91d44178 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_joe.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_joe.c @@ -2,50 +2,43 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = { /* Joe colemak */ - {FUNC(3), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, - {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, - {FUNC(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, FUNC(1), KC_SPC, KC_SPC, FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {F(3), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {F(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, [1] = { /* Joe soft Colemak */ - {FUNC(3), CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_MINS}, - {KC_BSPC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_ENT }, - {FUNC(15), CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, FUNC(1), KC_SPC, KC_SPC, FUNC(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {F(3), CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_MINS}, + {KC_BSPC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_ENT }, + {F(15), CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, [2] = { /* Joe NUMPAD */ - {FUNC(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_9), LSFT(KC_0), KC_P7, KC_P8, KC_P9, KC_PSLS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_5), KC_PEQL, KC_P4, KC_P5, KC_P6, KC_PAST}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PCMM, KC_P1, KC_P2, KC_P3, KC_PMNS}, - {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), KC_P0, KC_PDOT, KC_PENT, KC_PPLS} + {F(3), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LSFT(KC_9), LSFT(KC_0), KC_P7, KC_P8, KC_P9, KC_PSLS}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LSFT(KC_5), KC_PEQL, KC_P4, KC_P5, KC_P6, KC_PAST}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PCMM, KC_P1, KC_P2, KC_P3, KC_PMNS}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_TRNS, KC_TRNS, F(2), KC_P0, KC_PDOT, KC_PENT, KC_PPLS} }, [4] = { /* Joe LOWER fn1 */ - {KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(28), FUNC(27), FUNC(26), FUNC(25)}, - {KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS }, - {KC_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_EQL }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), KC_HOME, KC_PGDN, KC_PGUP, KC_END } + {KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(3), M(2), M(1), M(0) }, + {KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, + {KC_BSLS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC, KC_EQL }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_TRNS, KC_TRNS, F(2), KC_HOME, KC_PGDN, KC_PGUP, KC_END } }, [5] = { /* Joe UPPER fn2 */ {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, RESET }, - {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_MENU, KC_CAPS, KC_INS, KC_PSCR, KC_TRNS, LCTL(KC_PGUP), LCTL(KC_PGDN) }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_UP)), LCTL(LALT(KC_RGHT))} + {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, RESET }, + {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_MENU, KC_CAPS, KC_INS, KC_PSCR, KC_NO, LCTL(KC_PGUP), LCTL(KC_PGDN) }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_NO, KC_NO, F(2), LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_UP)), LCTL(LALT(KC_RGHT))} }, [6] = { /* Joe SPECIAL fn3 */ - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LCTL(LSFT(CM_U)), KC_TRNS, KC_TRNS, KC_SLEP}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {FUNC(6), FUNC(7), FUNC(8), KC_TRNS, FUNC(1), KC_TRNS, KC_TRNS, FUNC(2), KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} + {KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {KC_NO, KC_MPLY, KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET }, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {F(6), F(7), F(8), KC_NO, F(1), KC_TRNS, KC_TRNS, F(2), KC_NO, KC_PWR, KC_WAKE, KC_SLEP} } }; -enum macro_id { - M_Q0, - M_Q1, - M_Q2, - M_Q3 -}; - const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_MOMENTARY(4), // fn1 [2] = ACTION_LAYER_MOMENTARY(5), // fn2 @@ -60,29 +53,27 @@ const uint16_t PROGMEM fn_actions[] = { /* tab on tap, shift on hold */ [15] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB), - - /* smiley macros */ - [25] = ACTION_MACRO(M_Q0), - [26] = ACTION_MACRO(M_Q1), - [27] = ACTION_MACRO(M_Q2), - [28] = ACTION_MACRO(M_Q3), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch (id) { - case M_Q0: + case 0: /* :) */ return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_0), UP(KC_LSFT), END ); - case M_Q1: + break; + case 1: /* :( */ return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_9), UP(KC_LSFT), END ); - case M_Q2: + break; + case 2: /* (: | :) */ return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_9), TYPE(KC_SCLN), TYPE(KC_SPC), TYPE(KC_SPC), TYPE(KC_SCLN), TYPE(KC_0), UP(KC_LSFT), TYPE(KC_LEFT), TYPE(KC_LEFT), TYPE(KC_LEFT), END ); - case M_Q3: + break; + case 3: /* :( | ): */ return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_SCLN), TYPE(KC_9), TYPE(KC_SPC), TYPE(KC_SPC), TYPE(KC_0), TYPE(KC_SCLN), UP(KC_LSFT), TYPE(KC_LEFT), TYPE(KC_LEFT), TYPE(KC_LEFT), END ); + break; default: break; } From 1a6414937507c147a3daee57dd373a6422da750c Mon Sep 17 00:00:00 2001 From: cr3473 Date: Wed, 3 Jun 2015 13:20:14 -0700 Subject: [PATCH 12/20] revert to DEL only on upper layer :) --- keyboard/planck/extended_keymaps/extended_keymap_joe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/planck/extended_keymaps/extended_keymap_joe.c b/keyboard/planck/extended_keymaps/extended_keymap_joe.c index ca91d44178..7bfd0b772a 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_joe.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_joe.c @@ -21,13 +21,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, [4] = { /* Joe LOWER fn1 */ {KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(3), M(2), M(1), M(0) }, - {KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, + {KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, {KC_BSLS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC, KC_EQL }, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_TRNS, KC_TRNS, F(2), KC_HOME, KC_PGDN, KC_PGUP, KC_END } }, [5] = { /* Joe UPPER fn2 */ {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, RESET }, + {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO }, {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_MENU, KC_CAPS, KC_INS, KC_PSCR, KC_NO, LCTL(KC_PGUP), LCTL(KC_PGDN) }, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_NO, KC_NO, F(2), LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_UP)), LCTL(LALT(KC_RGHT))} }, From bec97387a13fef7ab5644c30d4c8352bc7a62966 Mon Sep 17 00:00:00 2001 From: cr3473 Date: Wed, 3 Jun 2015 13:33:36 -0700 Subject: [PATCH 13/20] added screenlock mapping --- keyboard/planck/extended_keymaps/extended_keymap_joe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboard/planck/extended_keymaps/extended_keymap_joe.c b/keyboard/planck/extended_keymaps/extended_keymap_joe.c index 7bfd0b772a..47904a104e 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_joe.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_joe.c @@ -32,10 +32,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_NO, KC_NO, F(2), LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_UP)), LCTL(LALT(KC_RGHT))} }, [6] = { /* Joe SPECIAL fn3 */ - {KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, - {KC_NO, KC_MPLY, KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET }, - {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, - {F(6), F(7), F(8), KC_NO, F(1), KC_TRNS, KC_TRNS, F(2), KC_NO, KC_PWR, KC_WAKE, KC_SLEP} + {KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {KC_NO, KC_MPLY, KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET }, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {F(6), F(7), F(8), KC_NO, F(1), KC_TRNS, KC_TRNS, F(2), KC_PWR, KC_WAKE, KC_SLEP, LCTL(LALT(KC_L))} } }; From 3bc50429a74d558af13865c0a700f49aa49a8bd5 Mon Sep 17 00:00:00 2001 From: cr3473 Date: Thu, 4 Jun 2015 15:04:12 -0700 Subject: [PATCH 14/20] added mouse scroll keymapping rearranged mouse button layout --- keyboard/planck/extended_keymaps/extended_keymap_joe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/planck/extended_keymaps/extended_keymap_joe.c b/keyboard/planck/extended_keymaps/extended_keymap_joe.c index 47904a104e..eaeaf3c990 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_joe.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_joe.c @@ -27,8 +27,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, [5] = { /* Joe UPPER fn2 */ {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO }, - {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_MENU, KC_CAPS, KC_INS, KC_PSCR, KC_NO, LCTL(KC_PGUP), LCTL(KC_PGDN) }, + {KC_DEL, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_WH_U, KC_BTN4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO }, + {KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_L, KC_WH_D, KC_WH_R, KC_NO, KC_NO, KC_NO, LCTL(KC_PGUP), LCTL(KC_PGDN) }, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_NO, KC_NO, F(2), LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_UP)), LCTL(LALT(KC_RGHT))} }, [6] = { /* Joe SPECIAL fn3 */ From ae2e7fdf26f9d26678bbe746ac3f1d4d076dd8e9 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 7 Jun 2015 13:40:11 -0400 Subject: [PATCH 15/20] Update PCB_GUIDE.md --- keyboard/planck/PCB_GUIDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index efe960abbf..59fc65bd08 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -3,12 +3,12 @@ ## Setting up the environment ### Windows -1. Install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. +1. Install [WinAVR Tools](http://sourceforge.net/projects/winavr/) for AVR GCC compiler. 2. Install [DFU-Programmer][dfu-prog] (the -win one). 3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. ### Mac -1. Install [CrossPack](https://www.obdev.at/downloads/crosspack/CrossPack-AVR-20131216.dmg). +1. Install [CrossPack](http://www.obdev.at/products/crosspack/index.html) or install Xcode from the App Store. 2. Install [DFU-Programmer][dfu-prog]. ### Linux From 77a7b180df3d3e8aafe7190c8ae851a004cc8797 Mon Sep 17 00:00:00 2001 From: Sean Hunter Date: Tue, 9 Jun 2015 10:12:57 +0100 Subject: [PATCH 16/20] Current smh keymap --- keyboard/planck/common_keymaps/keymap_sean.c | 56 +++++++++----------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/keyboard/planck/common_keymaps/keymap_sean.c b/keyboard/planck/common_keymaps/keymap_sean.c index 4fe07f701a..cb2ef8f138 100644 --- a/keyboard/planck/common_keymaps/keymap_sean.c +++ b/keyboard/planck/common_keymaps/keymap_sean.c @@ -14,44 +14,40 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT), [2] = KEYMAP( /* fn1 lower */ - F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, + F1, F2, F3, F4, F5, NO, NO, F6, F7, F8, F9, F10, 1, 2, 3, 4, 5, F18, DEL, 6, 7, 8, 9, 0, - FN3, FN4, TRNS, GRV, MINS, TRNS, TRNS, BSLS, LBRC, RBRC, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN5, HOME, PGDN, PGUP, END), + FN3, FN4, FN28, GRV, MINS, TRNS, INS, BSLS, LBRC, RBRC, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END), [3] = KEYMAP( /* fn2 raise */ - F1, F2, F3, F4, F5, TRNS, TRNS, F6, F7, F8, F9, F10, - F11, F12, F13, F14, F15, F18, DEL, F16, F17, F18, F19, F20, - FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, LSFT,PAUSE, RSFT, - LEFT, DOWN, UP, RGHT, FN5, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), - - [4] = KEYMAP( /* lower + raise */ - LEFT, DOWN, UP, RGHT, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, UP, RGHT, - HOME, PGDN, PGUP, END, TRNS, F18, DEL, TRNS, HOME, PGDN, PGUP, END, - FN3, FN4, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, EJCT, PWR, MPLY, RSFT, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MNXT, VOLD, VOLU, MUTE), + MRWD, MPLY, MFFD, NO, NO, FN21, FN22, EJCT, PWR, LSFT,PAUSE, RSFT, + FN11, FN12, FN13, FN14, FN15, F18, DEL, FN16, FN17, FN18, FN19, FN20, + FN3, FN4, FN28, FN23, FN24, TRNS, INS, FN25, FN26, FN27, MPRV, MNXT, + TRNS, TRNS, TRNS, TRNS, FN1, TRNS, FN2, NO, VOLD, VOLU, MUTE), }; + const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay LOWER [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay RAISE [3] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(1), - [5] = ACTION_LAYER_MOMENTARY(4), // to Fn overlay LOWER + RAISE - [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), - [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), - [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), - [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), - [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), - [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), - [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), - [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), - [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), - [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), - [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), - [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), - [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), - [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), - [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), - [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_SLSH), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + [26] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [27] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), }; From 138156d4a0be4470f9653d7191d152c16f0678fc Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Tue, 30 Jun 2015 17:35:18 +1000 Subject: [PATCH 17/20] Update for Atomic PCB Rev 0 --- keyboard/atomic/Makefile | 4 +- keyboard/atomic/backlight.c | 49 ++++++++++++++ keyboard/atomic/config.h | 4 ++ keyboard/atomic/keymap_common.h | 18 +++++- keyboard/atomic/keymap_grid.c | 40 ++++++++++++ keyboard/atomic/matrix.c | 109 +++++++++++++++++++------------- keyboard/planck/matrix_pcb.c | 14 ++-- 7 files changed, 184 insertions(+), 54 deletions(-) create mode 100644 keyboard/atomic/backlight.c create mode 100644 keyboard/atomic/keymap_grid.c diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index c4e0cb45d7..0d5baa9fa1 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -50,7 +50,8 @@ TARGET_DIR = . # project specific files SRC = keymap_common.c \ matrix.c \ - led.c + led.c \ + backlight.c ifdef KEYMAP SRC := keymap_$(KEYMAP).c $(SRC) @@ -121,6 +122,7 @@ CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # Optimize size but this may cause error "relocation truncated to fit" diff --git a/keyboard/atomic/backlight.c b/keyboard/atomic/backlight.c new file mode 100644 index 0000000000..06f103b4ac --- /dev/null +++ b/keyboard/atomic/backlight.c @@ -0,0 +1,49 @@ + +#include +#include "backlight.h" + +#define CHANNEL OCR1C + +void backlight_init_ports() +{ + + // Setup PB7 as output and output low. + DDRB |= (1<<7); + PORTB &= ~(1<<7); + + // Use full 16-bit resolution. + ICR1 = 0xFFFF; + + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + + // Pin PB7 = OCR1C (Timer 1, Channel C) + // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 + // (i.e. start high, go low when counter matches.) + // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 + // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 + + TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; + TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + + backlight_init(); +} + +void backlight_set(uint8_t level) +{ + if ( level == 0 ) + { + // Turn off PWM control on PB7, revert to output low. + TCCR1A &= ~(_BV(COM1C1)); + // CHANNEL = level << OFFSET | 0x0FFF; + CHANNEL = ((1 << level) - 1); + } + else + { + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + // CHANNEL = level << OFFSET | 0x0FFF; + CHANNEL = ((1 << level) - 1); + } +} \ No newline at end of file diff --git a/keyboard/atomic/config.h b/keyboard/atomic/config.h index 5ea953805f..41f7bd8b9f 100644 --- a/keyboard/atomic/config.h +++ b/keyboard/atomic/config.h @@ -34,6 +34,10 @@ along with this program. If not, see . /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +/* number of backlight levels */ +/* NOTE: this is the max value of 0..BACKLIGHT_LEVELS so really 16 levels. */ +#define BACKLIGHT_LEVELS 15 + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboard/atomic/keymap_common.h b/keyboard/atomic/keymap_common.h index c582c0135f..cfb0cb3611 100644 --- a/keyboard/atomic/keymap_common.h +++ b/keyboard/atomic/keymap_common.h @@ -80,7 +80,23 @@ extern const uint16_t fn_actions[]; // MLO: Semi-Grid layout -// KLN: Grid layout +// GRD: Grid layout + +#define KEYMAP_GRD( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \ +} + + // PKR: Standard layout diff --git a/keyboard/atomic/keymap_grid.c b/keyboard/atomic/keymap_grid.c new file mode 100644 index 0000000000..9d42272e64 --- /dev/null +++ b/keyboard/atomic/keymap_grid.c @@ -0,0 +1,40 @@ +#include "keymap_common.h" + +// GRD: Grid layout + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP_GRD(FN29, FN30, FN31, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSLS, GRV, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSPC, DEL, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, ENT, PGUP, \ + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, RSFT, UP, PGDN, \ + LCTL, LALT, LGUI, SPC, SPC, SPC, SPC, SPC, SPC, RALT, APP, RCTL, LEFT, DOWN, RGHT), \ + +}; +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay + [3] = ACTION_DEFAULT_LAYER_SET(0), + [4] = ACTION_DEFAULT_LAYER_SET(1), + + [9] = ACTION_MODS_KEY(MOD_LSFT | MOD_RSFT, KC_PAUSE), + + [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1), + [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2), + [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3), + [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4), + [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5), + [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6), + [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7), + [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8), + [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9), + [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0), + [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), + [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), + [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), + [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), + [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), + [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), + + [29] = ACTION_BACKLIGHT_TOGGLE(), + [30] = ACTION_BACKLIGHT_INCREASE(), + [31] = ACTION_BACKLIGHT_DECREASE() +}; diff --git a/keyboard/atomic/matrix.c b/keyboard/atomic/matrix.c index 98102cb694..fd233ff53f 100644 --- a/keyboard/atomic/matrix.c +++ b/keyboard/atomic/matrix.c @@ -59,6 +59,16 @@ uint8_t matrix_cols(void) void matrix_init(void) { + // To use PORTF disable JTAG with writing JTD bit twice within four cycles. + MCUCR |= (1< Date: Mon, 20 Jul 2015 13:53:02 -0700 Subject: [PATCH 18/20] added 1337 layer :) --- .../planck/extended_keymaps/extended_keymap_joe.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/keyboard/planck/extended_keymaps/extended_keymap_joe.c b/keyboard/planck/extended_keymaps/extended_keymap_joe.c index eaeaf3c990..c560d8a3a4 100644 --- a/keyboard/planck/extended_keymaps/extended_keymap_joe.c +++ b/keyboard/planck/extended_keymaps/extended_keymap_joe.c @@ -19,6 +19,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PCMM, KC_P1, KC_P2, KC_P3, KC_PMNS}, {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_TRNS, KC_TRNS, F(2), KC_P0, KC_PDOT, KC_PENT, KC_PPLS} }, + [3] = { /* Joe 1337 haxOr5*/ + {F(3), KC_Q, KC_W, KC_F, KC_P, KC_6, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_4, KC_R, KC_5, KC_7, KC_D, KC_H, KC_N, KC_3, KC_1, KC_0, KC_ENT }, + {F(15), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, + {KC_LCTL, KC_LGUI, KC_LALT, KC_LSFT, F(1), KC_SPC, KC_SPC, F(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + }, [4] = { /* Joe LOWER fn1 */ {KC_GRV, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(3), M(2), M(1), M(0) }, {KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS}, @@ -32,10 +38,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), KC_NO, KC_NO, F(2), LCTL(LALT(KC_LEFT)), LCTL(LALT(KC_DOWN)), LCTL(LALT(KC_UP)), LCTL(LALT(KC_RGHT))} }, [6] = { /* Joe SPECIAL fn3 */ - {KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, - {KC_NO, KC_MPLY, KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET }, - {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, - {F(6), F(7), F(8), KC_NO, F(1), KC_TRNS, KC_TRNS, F(2), KC_PWR, KC_WAKE, KC_SLEP, LCTL(LALT(KC_L))} + {KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {KC_NO, KC_MPLY, KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET }, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, + {F(6), F(7), F(8), F(9), F(1), KC_TRNS, KC_TRNS, F(2), KC_POWER, KC_WAKE, KC_SLEP, LCTL(LALT(KC_L))} } }; @@ -50,6 +56,7 @@ const uint16_t PROGMEM fn_actions[] = { [6] = ACTION_DEFAULT_LAYER_SET(0), [7] = ACTION_DEFAULT_LAYER_SET(1), [8] = ACTION_DEFAULT_LAYER_SET(2), + [9] = ACTION_DEFAULT_LAYER_SET(3), /* tab on tap, shift on hold */ [15] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_TAB), From 1f52d60ef1d9aa551cb3db41999bec6bf71cf5f2 Mon Sep 17 00:00:00 2001 From: Ante Vukorepa Date: Sat, 25 Jul 2015 17:11:31 +0200 Subject: [PATCH 19/20] Fixed brightness control; Reduced number of brightness levels to 4. --- keyboard/planck/backlight.c | 22 +++++++++++++++++----- keyboard/planck/config.h | 9 +++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/keyboard/planck/backlight.c b/keyboard/planck/backlight.c index 06f103b4ac..f69364b2af 100644 --- a/keyboard/planck/backlight.c +++ b/keyboard/planck/backlight.c @@ -36,14 +36,26 @@ void backlight_set(uint8_t level) { // Turn off PWM control on PB7, revert to output low. TCCR1A &= ~(_BV(COM1C1)); - // CHANNEL = level << OFFSET | 0x0FFF; - CHANNEL = ((1 << level) - 1); + CHANNEL = 0x0; + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); } - else + else if ( level == BACKLIGHT_LEVELS ) { + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); // Turn on PWM control of PB7 TCCR1A |= _BV(COM1C1); - // CHANNEL = level << OFFSET | 0x0FFF; - CHANNEL = ((1 << level) - 1); + // Set the brightness + CHANNEL = 0xFFFF; + } + else + { + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + // Set the brightness + CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2)); } } \ No newline at end of file diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index 4e49a2b897..7e95afddea 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -35,8 +35,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* number of backlight levels */ -/* NOTE: this is the max value of 0..BACKLIGHT_LEVELS so really 16 levels. */ -#define BACKLIGHT_LEVELS 15 +#define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 @@ -51,18 +50,16 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) - - /* * Feature disable options * These options are also useful to firmware size reduction. */ /* disable debug print */ -//#define NO_DEBUG +#define NO_DEBUG /* disable print */ -//#define NO_PRINT +#define NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER From e12c0de608be5b3239222735bb6403e0fda3fb26 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 3 Aug 2015 14:19:24 -0400 Subject: [PATCH 20/20] Update PCB_GUIDE.md --- keyboard/planck/PCB_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 59fc65bd08..c3004c75a4 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -8,7 +8,7 @@ 3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. ### Mac -1. Install [CrossPack](http://www.obdev.at/products/crosspack/index.html) or install Xcode from the App Store. +1. Install [CrossPack](http://www.obdev.at/products/crosspack/index.html) or install Xcode from the App Store and install the Command Line Tools from `Xcode->Preferences->Downloads`. 2. Install [DFU-Programmer][dfu-prog]. ### Linux