diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2016-07-06 22:48:19 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-07-06 22:48:19 -0400 |
| commit | a4bf46f9b1d0a0be0cecb2cd0f0d941aa7c71bd3 (patch) | |
| tree | d06043ac6fe7003ba2e9d7c3ea30378b6a51c3d5 /keyboards/lets_split | |
| parent | c88207884b5fb16c8955b54b4331fc605158b9f2 (diff) | |
| download | qmk_firmware-a4bf46f9b1d0a0be0cecb2cd0f0d941aa7c71bd3.tar.gz qmk_firmware-a4bf46f9b1d0a0be0cecb2cd0f0d941aa7c71bd3.zip | |
default keymap, reset sorted out for now, added serial to makefile
Diffstat (limited to 'keyboards/lets_split')
| -rw-r--r-- | keyboards/lets_split/Makefile | 3 | ||||
| -rw-r--r-- | keyboards/lets_split/config.h | 6 | ||||
| -rw-r--r-- | keyboards/lets_split/keymaps/default/keymap.c | 200 | ||||
| -rw-r--r-- | keyboards/lets_split/lets_split.c | 26 | ||||
| -rw-r--r-- | keyboards/lets_split/lets_split.h | 8 |
5 files changed, 202 insertions, 41 deletions
diff --git a/keyboards/lets_split/Makefile b/keyboards/lets_split/Makefile index d8e283896..b9f07636b 100644 --- a/keyboards/lets_split/Makefile +++ b/keyboards/lets_split/Makefile | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | SRC += matrix.c \ | 1 | SRC += matrix.c \ |
| 2 | i2c.c \ | 2 | i2c.c \ |
| 3 | split_util.c | 3 | split_util.c \ |
| 4 | serial.c | ||
| 4 | 5 | ||
| 5 | # MCU name | 6 | # MCU name |
| 6 | #MCU = at90usb1287 | 7 | #MCU = at90usb1287 |
diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index 5937ca44e..6f90997ab 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h | |||
| @@ -37,7 +37,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 37 | #define MATRIX_ROW_PINS { B5, B4, E6, D7 } | 37 | #define MATRIX_ROW_PINS { B5, B4, E6, D7 } |
| 38 | #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } | 38 | #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } |
| 39 | 39 | ||
| 40 | #define USE_I2C | 40 | #define CATERINA_BOOTLOADER |
| 41 | |||
| 42 | // #define USE_I2C | ||
| 41 | 43 | ||
| 42 | // #define EE_HANDS | 44 | // #define EE_HANDS |
| 43 | 45 | ||
| @@ -51,7 +53,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 51 | //#define MATRIX_HAS_GHOST | 53 | //#define MATRIX_HAS_GHOST |
| 52 | 54 | ||
| 53 | /* number of backlight levels */ | 55 | /* number of backlight levels */ |
| 54 | #define BACKLIGHT_LEVELS 3 | 56 | // #define BACKLIGHT_LEVELS 3 |
| 55 | 57 | ||
| 56 | /* Set 0 if debouncing isn't needed */ | 58 | /* Set 0 if debouncing isn't needed */ |
| 57 | #define DEBOUNCING_DELAY 5 | 59 | #define DEBOUNCING_DELAY 5 |
diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c index 01e3593c2..0d2d94b67 100644 --- a/keyboards/lets_split/keymaps/default/keymap.c +++ b/keyboards/lets_split/keymaps/default/keymap.c | |||
| @@ -1,11 +1,27 @@ | |||
| 1 | #include "lets_split.h" | 1 | #include "lets_split.h" |
| 2 | #include "action_layer.h" | 2 | #include "action_layer.h" |
| 3 | #include "eeconfig.h" | ||
| 3 | 4 | ||
| 4 | #define BASE 0 | 5 | extern keymap_config_t keymap_config; |
| 5 | 6 | ||
| 6 | enum preonic_keycodes { | 7 | // Each layer gets a name for readability, which is then used in the keymap matrix below. |
| 7 | KC_IDK = SAFE_RANGE, | 8 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. |
| 8 | PM_RESET | 9 | // Layer names don't all need to be of the same length, obviously, and you can also skip them |
| 10 | // entirely and just use numbers. | ||
| 11 | #define _QWERTY 0 | ||
| 12 | #define _COLEMAK 1 | ||
| 13 | #define _DVORAK 2 | ||
| 14 | #define _LOWER 3 | ||
| 15 | #define _RAISE 4 | ||
| 16 | #define _ADJUST 16 | ||
| 17 | |||
| 18 | enum custom_keycodes { | ||
| 19 | QWERTY = SAFE_RANGE, | ||
| 20 | COLEMAK, | ||
| 21 | DVORAK, | ||
| 22 | LOWER, | ||
| 23 | RAISE, | ||
| 24 | ADJUST, | ||
| 9 | }; | 25 | }; |
| 10 | 26 | ||
| 11 | // Fillers to make layering more clear | 27 | // Fillers to make layering more clear |
| @@ -14,29 +30,185 @@ enum preonic_keycodes { | |||
| 14 | 30 | ||
| 15 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 16 | 32 | ||
| 17 | [BASE] = KEYMAP( | 33 | /* 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, \ | 34 | * ,-----------------------------------------------------------------------------------. |
| 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, \ | 35 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | |
| 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, \ | 36 | * |------+------+------+------+------+-------------+------+------+------+------+------| |
| 21 | KC_IDK, KC_LCTL, KC_LALT, KC_LGUI, PM_RESET,KC_SPC, KC_SPC, PM_RESET,KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | 37 | * | Esc | A | S | D | F | G | H | J | K | L | ; | " | |
| 38 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 39 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
| 40 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 41 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 42 | * `-----------------------------------------------------------------------------------' | ||
| 43 | */ | ||
| 44 | [_QWERTY] = KEYMAP( \ | ||
| 45 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ | ||
| 46 | KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
| 47 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
| 48 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 49 | ), | ||
| 50 | |||
| 51 | /* Colemak | ||
| 52 | * ,-----------------------------------------------------------------------------------. | ||
| 53 | * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | | ||
| 54 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 55 | * | Esc | A | R | S | T | D | H | N | E | I | O | " | | ||
| 56 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 57 | * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | | ||
| 58 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 59 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 60 | * `-----------------------------------------------------------------------------------' | ||
| 61 | */ | ||
| 62 | [_COLEMAK] = KEYMAP( \ | ||
| 63 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ | ||
| 64 | KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ | ||
| 65 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
| 66 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 67 | ), | ||
| 68 | |||
| 69 | /* Dvorak | ||
| 70 | * ,-----------------------------------------------------------------------------------. | ||
| 71 | * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | | ||
| 72 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 73 | * | Esc | A | O | E | U | I | D | H | T | N | S | / | | ||
| 74 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 75 | * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | | ||
| 76 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 77 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 78 | * `-----------------------------------------------------------------------------------' | ||
| 79 | */ | ||
| 80 | [_DVORAK] = KEYMAP( \ | ||
| 81 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ | ||
| 82 | KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ | ||
| 83 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ | ||
| 84 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 85 | ), | ||
| 86 | |||
| 87 | /* Lower | ||
| 88 | * ,-----------------------------------------------------------------------------------. | ||
| 89 | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | ||
| 90 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 91 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | | ||
| 92 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 93 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | | ||
| 94 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 95 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 96 | * `-----------------------------------------------------------------------------------' | ||
| 97 | */ | ||
| 98 | [_LOWER] = KEYMAP( \ | ||
| 99 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ | ||
| 100 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ | ||
| 101 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ | ||
| 102 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
| 103 | ), | ||
| 104 | |||
| 105 | /* Raise | ||
| 106 | * ,-----------------------------------------------------------------------------------. | ||
| 107 | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
| 108 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 109 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
| 110 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 111 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | | ||
| 112 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 113 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 114 | * `-----------------------------------------------------------------------------------' | ||
| 115 | */ | ||
| 116 | [_RAISE] = KEYMAP( \ | ||
| 117 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ | ||
| 118 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ | ||
| 119 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ | ||
| 120 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
| 121 | ), | ||
| 122 | |||
| 123 | /* Adjust (Lower + Raise) | ||
| 124 | * ,-----------------------------------------------------------------------------------. | ||
| 125 | * | | Reset| | | | | | | | | | Del | | ||
| 126 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 127 | * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | | ||
| 128 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 129 | * | | | | | | | | | | | | | | ||
| 130 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 131 | * | | | | | | | | | | | | | ||
| 132 | * `-----------------------------------------------------------------------------------' | ||
| 133 | */ | ||
| 134 | [_ADJUST] = KEYMAP( \ | ||
| 135 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ | ||
| 136 | _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ | ||
| 137 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 138 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 22 | ) | 139 | ) |
| 23 | 140 | ||
| 141 | |||
| 24 | }; | 142 | }; |
| 25 | 143 | ||
| 144 | #ifdef AUDIO_ENABLE | ||
| 145 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
| 146 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
| 147 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
| 148 | #endif | ||
| 149 | |||
| 150 | void persistant_default_layer_set(uint16_t default_layer) { | ||
| 151 | eeconfig_update_default_layer(default_layer); | ||
| 152 | default_layer_set(default_layer); | ||
| 153 | } | ||
| 154 | |||
| 26 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 155 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 27 | switch (keycode) { | 156 | switch (keycode) { |
| 28 | case KC_IDK: | 157 | case QWERTY: |
| 158 | if (record->event.pressed) { | ||
| 159 | #ifdef AUDIO_ENABLE | ||
| 160 | PLAY_NOTE_ARRAY(tone_qwerty, false, 0); | ||
| 161 | #endif | ||
| 162 | persistant_default_layer_set(1UL<<_QWERTY); | ||
| 163 | } | ||
| 164 | return false; | ||
| 165 | break; | ||
| 166 | case COLEMAK: | ||
| 167 | if (record->event.pressed) { | ||
| 168 | #ifdef AUDIO_ENABLE | ||
| 169 | PLAY_NOTE_ARRAY(tone_colemak, false, 0); | ||
| 170 | #endif | ||
| 171 | persistant_default_layer_set(1UL<<_COLEMAK); | ||
| 172 | } | ||
| 173 | return false; | ||
| 174 | break; | ||
| 175 | case DVORAK: | ||
| 176 | if (record->event.pressed) { | ||
| 177 | #ifdef AUDIO_ENABLE | ||
| 178 | PLAY_NOTE_ARRAY(tone_dvorak, false, 0); | ||
| 179 | #endif | ||
| 180 | persistant_default_layer_set(1UL<<_DVORAK); | ||
| 181 | } | ||
| 182 | return false; | ||
| 183 | break; | ||
| 184 | case LOWER: | ||
| 185 | if (record->event.pressed) { | ||
| 186 | layer_on(_LOWER); | ||
| 187 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 188 | } else { | ||
| 189 | layer_off(_LOWER); | ||
| 190 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 191 | } | ||
| 192 | return false; | ||
| 193 | break; | ||
| 194 | case RAISE: | ||
| 29 | if (record->event.pressed) { | 195 | if (record->event.pressed) { |
| 30 | SEND_STRING("IDK. "); | 196 | layer_on(_RAISE); |
| 197 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 198 | } else { | ||
| 199 | layer_off(_RAISE); | ||
| 200 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 31 | } | 201 | } |
| 32 | return false; | 202 | return false; |
| 33 | break; | 203 | break; |
| 34 | case PM_RESET: | 204 | case ADJUST: |
| 35 | if (record->event.pressed) { | 205 | if (record->event.pressed) { |
| 36 | promicro_bootloader_jmp(true); | 206 | layer_on(_ADJUST); |
| 207 | } else { | ||
| 208 | layer_off(_ADJUST); | ||
| 37 | } | 209 | } |
| 38 | return false; | 210 | return false; |
| 39 | break; | 211 | break; |
| 40 | } | 212 | } |
| 41 | return true; | 213 | return true; |
| 42 | }; \ No newline at end of file | 214 | } \ No newline at end of file |
diff --git a/keyboards/lets_split/lets_split.c b/keyboards/lets_split/lets_split.c index 1859dc20a..574c116a7 100644 --- a/keyboards/lets_split/lets_split.c +++ b/keyboards/lets_split/lets_split.c | |||
| @@ -23,26 +23,8 @@ void matrix_init_kb(void) { | |||
| 23 | matrix_init_user(); | 23 | matrix_init_user(); |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | void promicro_bootloader_jmp(bool program) { | 26 | void shutdown_user(void) { |
| 27 | 27 | PLAY_NOTE_ARRAY(tone_goodbye, false, 0); | |
| 28 | #ifdef AUDIO_ENABLE | 28 | _delay_ms(150); |
| 29 | PLAY_NOTE_ARRAY(tone_goodbye, false, 0); | 29 | stop_all_notes(); |
| 30 | _delay_ms(150); | ||
| 31 | stop_all_notes(); | ||
| 32 | #endif | ||
| 33 | |||
| 34 | uint16_t *const bootKeyPtr = (uint16_t *)0x0800; | ||
| 35 | |||
| 36 | // Value used by Caterina bootloader use to determine whether to run the | ||
| 37 | // sketch or the bootloader programmer. | ||
| 38 | uint16_t bootKey = program ? 0x7777 : 0; | ||
| 39 | |||
| 40 | *bootKeyPtr = bootKey; | ||
| 41 | |||
| 42 | // setup watchdog timeout | ||
| 43 | wdt_enable(WDTO_60MS); | ||
| 44 | |||
| 45 | while(1) {} // wait for watchdog timer to trigger | ||
| 46 | } | 30 | } |
| 47 | |||
| 48 | |||
diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h index e59aed592..fe7ae0767 100644 --- a/keyboards/lets_split/lets_split.h +++ b/keyboards/lets_split/lets_split.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #ifndef LETS_SPLIT_H | ||
| 2 | #define LETS_SPLIT_H | ||
| 3 | |||
| 1 | #include "quantum.h" | 4 | #include "quantum.h" |
| 2 | #include <avr/wdt.h> | ||
| 3 | 5 | ||
| 4 | void promicro_bootloader_jmp(bool program); | 6 | void promicro_bootloader_jmp(bool program); |
| 5 | 7 | ||
| @@ -18,4 +20,6 @@ void promicro_bootloader_jmp(bool program); | |||
| 18 | { k50, k51, k52, k53, k54, k55 }, \ | 20 | { k50, k51, k52, k53, k54, k55 }, \ |
| 19 | { k60, k61, k62, k63, k64, k65 }, \ | 21 | { k60, k61, k62, k63, k64, k65 }, \ |
| 20 | { k70, k71, k72, k73, k74, k75 } \ | 22 | { k70, k71, k72, k73, k74, k75 } \ |
| 21 | } \ No newline at end of file | 23 | } |
| 24 | |||
| 25 | #endif \ No newline at end of file | ||
