diff options
Diffstat (limited to 'keyboards/tmo50/keymaps')
| -rw-r--r-- | keyboards/tmo50/keymaps/talljoe/config.h | 33 | ||||
| -rw-r--r-- | keyboards/tmo50/keymaps/talljoe/keymap.c | 44 |
2 files changed, 77 insertions, 0 deletions
diff --git a/keyboards/tmo50/keymaps/talljoe/config.h b/keyboards/tmo50/keymaps/talljoe/config.h new file mode 100644 index 000000000..53d593385 --- /dev/null +++ b/keyboards/tmo50/keymaps/talljoe/config.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* Copyright 2020 Joseph Wasson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define SPACE_COUNT 2 | ||
| 20 | |||
| 21 | #define TEMPLATE_TKL(\ | ||
| 22 | KESC, KF01, KF02, KF03, KF04, KF05, KF06, KF07, KF08, KF09, KF10, KF11, KF12, KSCL, KPRS, KADJ, \ | ||
| 23 | KGRV, K_1 , K_2 , K_3 , K_4 , K_5 , K_6 , K_7 , K_8 , K_9 , K_0 , KMIN, KEQL, KBLS, KINS, KHOM, KPUP, \ | ||
| 24 | KTAB, K_Q , K_W , K_E , K_R , K_T , K_Y , K_U , K_I , K_O , K_P , KLBR, KRBR, KBSP, KDEL, KEND, LPDN, \ | ||
| 25 | KCAP, K_A , K_S , K_D , K_F , K_G , K_H , K_J , K_K , K_L , KSMI, KQUO, KENT, \ | ||
| 26 | KLSH, K_Z , K_X , K_C , K_V , K_B , K_N , K_M , KCMA, KDOT, KSLS, KRSH, K_UP, \ | ||
| 27 | KLCT, KLOS, KLAL, KSP2, KSP3, KSP1, KRAL, KROS, KRCT, KPTT, K_LT, K_DN, K_RT \ | ||
| 28 | ) LAYOUT_all( \ | ||
| 29 | KF01, KTAB, K_Q , K_W , K_E , K_R , K_T , K_Y , K_U , K_I , K_O , K_P , KLBR, KRBR, KBSP, \ | ||
| 30 | KF02, KCAP, K_A , K_S , K_D , K_F , K_G , K_H , K_J , K_K , K_L , KSMI, KQUO, KENT, \ | ||
| 31 | KF03, KLSH, K_Z , K_X , K_C , K_V , K_B , K_N , K_M , KCMA, KDOT, KSLS, KRSH, KADJ, \ | ||
| 32 | KF04, KLOS, KLAL, KSP2, KSP1, KRAL, KESC \ | ||
| 33 | ) | ||
diff --git a/keyboards/tmo50/keymaps/talljoe/keymap.c b/keyboards/tmo50/keymaps/talljoe/keymap.c new file mode 100644 index 000000000..fa6523992 --- /dev/null +++ b/keyboards/tmo50/keymaps/talljoe/keymap.c | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #include "quantum.h" | ||
| 2 | #include "talljoe.h" | ||
| 3 | |||
| 4 | bool process_indicator_led_user(uint32_t state){ | ||
| 5 | return false; | ||
| 6 | } | ||
| 7 | |||
| 8 | #define LED_MASK (_BV(PB0) | _BV(PB1) | _BV(PB2) | _BV(PB3)) | ||
| 9 | #define WHITE (_BV(PB0)) | ||
| 10 | #define YELLOW (_BV(PB1)) | ||
| 11 | #define MAGENTA (_BV(PB2)) | ||
| 12 | #define RED (_BV(PB3)) | ||
| 13 | |||
| 14 | void matrix_scan_keymap(void) { | ||
| 15 | uint32_t lights = WHITE; | ||
| 16 | |||
| 17 | switch(get_highest_layer(layer_state)) | ||
| 18 | { | ||
| 19 | case _NAV: | ||
| 20 | lights |= YELLOW; | ||
| 21 | break; | ||
| 22 | case _NUM: | ||
| 23 | lights |= MAGENTA; | ||
| 24 | break; | ||
| 25 | case _ADJUST: | ||
| 26 | lights |= RED; | ||
| 27 | break; | ||
| 28 | default: { | ||
| 29 | uint8_t default_layer = get_highest_layer(default_layer_state); | ||
| 30 | lights = 0; // no white LED by default. | ||
| 31 | if(default_layer & 1) | ||
| 32 | lights |= YELLOW; | ||
| 33 | if(default_layer & 2) | ||
| 34 | lights |= MAGENTA; | ||
| 35 | if(default_layer & 4) | ||
| 36 | lights |= RED; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | uint32_t port = PORTB; | ||
| 41 | port |= LED_MASK; | ||
| 42 | port &= ~lights; | ||
| 43 | PORTB = port; | ||
| 44 | } | ||
