aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-04-24 22:42:43 +0100
committerGitHub <noreply@github.com>2020-04-24 22:42:43 +0100
commit28e5969f780ec4a29ee27f55af60fab88369d1c4 (patch)
tree86eaee932c3bd1cc705ba483b76fcd3b89839b1d
parent59246756e50fc7f8c7dbeee11547e9157d165250 (diff)
parent5c9c45619e267e1c43fee483a1a1de54c12989bc (diff)
downloadqmk_firmware-28e5969f780ec4a29ee27f55af60fab88369d1c4.tar.gz
qmk_firmware-28e5969f780ec4a29ee27f55af60fab88369d1c4.zip
Merge pull request #8897 from Maartenwut/ta-65-encoder
Add encoder support to ta-65
-rw-r--r--keyboards/maartenwut/ta65/config.h8
-rw-r--r--keyboards/maartenwut/ta65/keymaps/default/keymap.c45
-rw-r--r--keyboards/maartenwut/ta65/rules.mk31
3 files changed, 58 insertions, 26 deletions
diff --git a/keyboards/maartenwut/ta65/config.h b/keyboards/maartenwut/ta65/config.h
index d54a6273d..729f21a2e 100644
--- a/keyboards/maartenwut/ta65/config.h
+++ b/keyboards/maartenwut/ta65/config.h
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24#define PRODUCT_ID 0x7465 24#define PRODUCT_ID 0x7465
25#define DEVICE_VER 0x0001 25#define DEVICE_VER 0x0001
26#define MANUFACTURER Maartenwut 26#define MANUFACTURER Maartenwut
27#define PRODUCT TA-65 27#define PRODUCT ta-65
28#define DESCRIPTION A universal 65% PCB with underglow. 28#define DESCRIPTION A universal 65% PCB with underglow.
29 29
30/* key matrix size */ 30/* key matrix size */
@@ -37,6 +37,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
37#define MATRIX_COL_PINS {D2,D1,D0,D3,D5,C7,C6,B6,B5,F0,F1,F4,F5,F6,F7,B0} 37#define MATRIX_COL_PINS {D2,D1,D0,D3,D5,C7,C6,B6,B5,F0,F1,F4,F5,F6,F7,B0}
38#define UNUSED_PINS 38#define UNUSED_PINS
39 39
40#define ENCODERS_PAD_A { B2 }
41#define ENCODERS_PAD_B { B1 }
42
43/* Uncomment if your encoder doesn't react to every turn or skips */
44//#define ENCODER_RESOLUTION 2
45
40/* COL2ROW or ROW2COL */ 46/* COL2ROW or ROW2COL */
41#define DIODE_DIRECTION COL2ROW 47#define DIODE_DIRECTION COL2ROW
42 48
diff --git a/keyboards/maartenwut/ta65/keymaps/default/keymap.c b/keyboards/maartenwut/ta65/keymaps/default/keymap.c
index b04172c75..8bb8a14ba 100644
--- a/keyboards/maartenwut/ta65/keymaps/default/keymap.c
+++ b/keyboards/maartenwut/ta65/keymaps/default/keymap.c
@@ -1,17 +1,38 @@
1#include QMK_KEYBOARD_H 1#include QMK_KEYBOARD_H
2 2
3// Each layer gets a name for readability, which is then used in the keymap matrix below.
4// The underscores don't mean anything - you can have a layer called STUFF or any other name.
5// Layer names don't all need to be of the same length, obviously, and you can also skip them
6// entirely and just use numbers.
7#define _MA 0
8
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10 4
11[_MA] = LAYOUT_all( 5[0] = LAYOUT_all(
12 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_GRV, 6 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, KC_INS,
13 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, 7 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
14 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_PGUP, 8 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, KC_PGUP,
15 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, 9 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
16 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT) 10 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT),
11
12[1] = LAYOUT_all(
13 RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
14 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
15 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
16 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
17 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
18
17}; 19};
20
21void encoder_update_user(uint8_t index, bool clockwise) {
22 switch(get_highest_layer(layer_state)){
23 case 1: //Layer 1
24 if (!clockwise) { // Remove ! to reverse direction
25 tap_code(KC_WH_U);
26 } else {
27 tap_code(KC_WH_D);
28 }
29 break;
30 default: //Layer 0
31 if (!clockwise) {
32 tap_code(KC_VOLU);
33 } else {
34 tap_code(KC_VOLD);
35 }
36 break;
37 }
38}
diff --git a/keyboards/maartenwut/ta65/rules.mk b/keyboards/maartenwut/ta65/rules.mk
index db0567bd0..86efb933b 100644
--- a/keyboards/maartenwut/ta65/rules.mk
+++ b/keyboards/maartenwut/ta65/rules.mk
@@ -12,19 +12,24 @@ MCU = atmega32u4
12BOOTLOADER = qmk-dfu 12BOOTLOADER = qmk-dfu
13 13
14# Build Options 14# Build Options
15# comment out to disable the options. 15# change yes to no to disable
16# 16#
17BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration 17BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 18MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control 19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug 20CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = no # Commands for debug and configuration 21COMMAND_ENABLE = no # Commands for debug and configuration
22NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality 23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25MIDI_ENABLE = no # MIDI controls 25NKRO_ENABLE = no # USB Nkey Rollover
26AUDIO_ENABLE = no 26BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
27UNICODE_ENABLE = no # Unicode 27RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
28BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 28MIDI_ENABLE = no # MIDI support
29BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
30AUDIO_ENABLE = no # Audio output on port C6
31FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
32HD44780_ENABLE = no # Enable support for HD44780 based LCDs
33ENCODER_ENABLE = yes
29 34
30LAYOUTS = 65_ansi 65_iso 35LAYOUTS = 65_ansi 65_iso