From c4a67d3f3302f3096bb6b15921c9587643164ba9 Mon Sep 17 00:00:00 2001 From: jack <0x6A73@pm.me> Date: Mon, 19 Jun 2023 09:46:27 -0600 Subject: Remove encoder in-matrix workaround code (#20389) --- keyboards/nightly_boards/n60_s/config.h | 4 - keyboards/nightly_boards/n60_s/encoder_action.c | 47 ------- keyboards/nightly_boards/n60_s/encoder_action.h | 23 ---- keyboards/nightly_boards/n60_s/info.json | 149 +-------------------- .../n60_s/keymaps/ansi_encoder/keymap.c | 34 ----- .../n60_s/keymaps/tsangan_encoder/keymap.c | 34 ----- .../nightly_boards/n60_s/keymaps/via/keymap.c | 27 ++-- .../nightly_boards/n60_s/keymaps/via/rules.mk | 1 + keyboards/nightly_boards/n60_s/n60_s.c | 28 ---- keyboards/nightly_boards/n60_s/n60_s.h | 20 --- keyboards/nightly_boards/n60_s/rules.mk | 3 - 11 files changed, 20 insertions(+), 350 deletions(-) delete mode 100644 keyboards/nightly_boards/n60_s/encoder_action.c delete mode 100644 keyboards/nightly_boards/n60_s/encoder_action.h delete mode 100644 keyboards/nightly_boards/n60_s/keymaps/ansi_encoder/keymap.c delete mode 100644 keyboards/nightly_boards/n60_s/keymaps/tsangan_encoder/keymap.c delete mode 100644 keyboards/nightly_boards/n60_s/n60_s.c delete mode 100644 keyboards/nightly_boards/n60_s/n60_s.h (limited to 'keyboards/nightly_boards/n60_s') diff --git a/keyboards/nightly_boards/n60_s/config.h b/keyboards/nightly_boards/n60_s/config.h index d973424454..cabcb8f14f 100644 --- a/keyboards/nightly_boards/n60_s/config.h +++ b/keyboards/nightly_boards/n60_s/config.h @@ -17,10 +17,6 @@ along with this program. If not, see . #pragma once -/* Encoders */ -#define ENCODERS_CW_KEY { { 1, 5 } } -#define ENCODERS_CCW_KEY { { 0, 5 } } - /* Audio */ #define B7_AUDIO diff --git a/keyboards/nightly_boards/n60_s/encoder_action.c b/keyboards/nightly_boards/n60_s/encoder_action.c deleted file mode 100644 index 522fb58d5a..0000000000 --- a/keyboards/nightly_boards/n60_s/encoder_action.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "encoder_action.h" - -static uint8_t encoder_state[NUM_ENCODERS] = {0}; -static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY; -static keypos_t encoder_ccw[NUM_ENCODERS] = ENCODERS_CCW_KEY; - -void encoder_action_unregister(void) { - for (int index = 0; index < NUM_ENCODERS; ++index) { - if (encoder_state[index]) { - keyevent_t encoder_event = (keyevent_t) { - .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], - .pressed = false, - .time = timer_read(), - .type = KEY_EVENT - }; - encoder_state[index] = 0; - action_exec(encoder_event); - } - } -} - -void encoder_action_register(uint8_t index, bool clockwise) { - keyevent_t encoder_event = (keyevent_t) { - .key = clockwise ? encoder_cw[index] : encoder_ccw[index], - .pressed = true, - .time = timer_read(), - .type = KEY_EVENT - }; - encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); - action_exec(encoder_event); -} diff --git a/keyboards/nightly_boards/n60_s/encoder_action.h b/keyboards/nightly_boards/n60_s/encoder_action.h deleted file mode 100644 index fb22632632..0000000000 --- a/keyboards/nightly_boards/n60_s/encoder_action.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" - -void encoder_action_unregister(void); - -void encoder_action_register(uint8_t index, bool clockwise); \ No newline at end of file diff --git a/keyboards/nightly_boards/n60_s/info.json b/keyboards/nightly_boards/n60_s/info.json index 487fc5457a..0642944b2d 100644 --- a/keyboards/nightly_boards/n60_s/info.json +++ b/keyboards/nightly_boards/n60_s/info.json @@ -10,7 +10,7 @@ }, "matrix_pins": { "cols": ["F7", "F6", "F5", "F4", "F1", "F0", "B0", "B1", "B2", "B3", "B5", "B6", "C6", "C7"], - "rows": ["B4", "D7", "D6", "D0", "E6", null] + "rows": ["B4", "D7", "D6", "D0", "E6"] }, "diode_direction": "COL2ROW", "encoder": { @@ -99,80 +99,6 @@ {"matrix": [4, 13], "x": 13.75, "y": 4, "w": 1.25} ] }, - "LAYOUT_60_ansi_split_bs_rshift_encoder": { - "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0}, - {"matrix": [0, 1], "x": 1, "y": 0}, - {"matrix": [0, 2], "x": 2, "y": 0}, - {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [0, 4], "x": 4, "y": 0}, - {"matrix": [0, 5], "x": 5, "y": 0}, - {"matrix": [0, 6], "x": 6, "y": 0}, - {"matrix": [0, 7], "x": 7, "y": 0}, - {"matrix": [0, 8], "x": 8, "y": 0}, - {"matrix": [0, 9], "x": 9, "y": 0}, - {"matrix": [0, 10], "x": 10, "y": 0}, - {"matrix": [0, 11], "x": 11, "y": 0}, - {"matrix": [0, 12], "x": 12, "y": 0}, - {"matrix": [0, 13], "x": 13, "y": 0}, - {"matrix": [1, 13], "x": 14, "y": 0}, - - {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, - {"matrix": [1, 1], "x": 1.5, "y": 1}, - {"matrix": [1, 2], "x": 2.5, "y": 1}, - {"matrix": [1, 3], "x": 3.5, "y": 1}, - {"matrix": [1, 4], "x": 4.5, "y": 1}, - {"matrix": [1, 5], "x": 5.5, "y": 1}, - {"matrix": [1, 6], "x": 6.5, "y": 1}, - {"matrix": [1, 7], "x": 7.5, "y": 1}, - {"matrix": [1, 8], "x": 8.5, "y": 1}, - {"matrix": [1, 9], "x": 9.5, "y": 1}, - {"matrix": [1, 10], "x": 10.5, "y": 1}, - {"matrix": [1, 11], "x": 11.5, "y": 1}, - {"matrix": [1, 12], "x": 12.5, "y": 1}, - {"matrix": [2, 13], "x": 13.5, "y": 1, "w": 1.5}, - - {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, - {"matrix": [2, 1], "x": 1.75, "y": 2}, - {"matrix": [2, 2], "x": 2.75, "y": 2}, - {"matrix": [2, 3], "x": 3.75, "y": 2}, - {"matrix": [2, 4], "x": 4.75, "y": 2}, - {"matrix": [2, 5], "x": 5.75, "y": 2}, - {"matrix": [2, 6], "x": 6.75, "y": 2}, - {"matrix": [2, 7], "x": 7.75, "y": 2}, - {"matrix": [2, 8], "x": 8.75, "y": 2}, - {"matrix": [2, 9], "x": 9.75, "y": 2}, - {"matrix": [2, 10], "x": 10.75, "y": 2}, - {"matrix": [2, 11], "x": 11.75, "y": 2}, - {"matrix": [2, 12], "x": 12.75, "y": 2, "w": 2.25}, - - {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, - {"matrix": [3, 2], "x": 2.25, "y": 3}, - {"matrix": [3, 3], "x": 3.25, "y": 3}, - {"matrix": [3, 4], "x": 4.25, "y": 3}, - {"matrix": [3, 5], "x": 5.25, "y": 3}, - {"matrix": [3, 6], "x": 6.25, "y": 3}, - {"matrix": [3, 7], "x": 7.25, "y": 3}, - {"matrix": [3, 8], "x": 8.25, "y": 3}, - {"matrix": [3, 9], "x": 9.25, "y": 3}, - {"matrix": [3, 10], "x": 10.25, "y": 3}, - {"matrix": [3, 11], "x": 11.25, "y": 3}, - {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, - {"matrix": [3, 13], "x": 14, "y": 3}, - - {"matrix": [5, 0], "x": 15.25, "y": 3}, - {"matrix": [5, 1], "x": 16.25, "y": 3}, - - {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, - {"matrix": [4, 2], "x": 1.25, "y": 4, "w": 1.25}, - {"matrix": [4, 3], "x": 2.5, "y": 4, "w": 1.25}, - {"matrix": [4, 7], "x": 3.75, "y": 4, "w": 6.25}, - {"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25}, - {"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25}, - {"matrix": [4, 12], "x": 12.5, "y": 4, "w": 1.25}, - {"matrix": [4, 13], "x": 13.75, "y": 4, "w": 1.25} - ] - }, "LAYOUT_60_ansi_split_bs_rshift_tsangan": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0}, @@ -234,79 +160,6 @@ {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, {"matrix": [3, 13], "x": 14, "y": 3}, - {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.5}, - {"matrix": [4, 2], "x": 1.5, "y": 4}, - {"matrix": [4, 3], "x": 2.5, "y": 4, "w": 1.5}, - {"matrix": [4, 7], "x": 4, "y": 4, "w": 7}, - {"matrix": [4, 11], "x": 11, "y": 4, "w": 1.5}, - {"matrix": [4, 12], "x": 12.5, "y": 4}, - {"matrix": [4, 13], "x": 13.5, "y": 4, "w": 1.5} - ] - }, - "LAYOUT_60_ansi_split_bs_rshift_tsangan_encoder": { - "layout": [ - {"matrix": [0, 0], "x": 0, "y": 0}, - {"matrix": [0, 1], "x": 1, "y": 0}, - {"matrix": [0, 2], "x": 2, "y": 0}, - {"matrix": [0, 3], "x": 3, "y": 0}, - {"matrix": [0, 4], "x": 4, "y": 0}, - {"matrix": [0, 5], "x": 5, "y": 0}, - {"matrix": [0, 6], "x": 6, "y": 0}, - {"matrix": [0, 7], "x": 7, "y": 0}, - {"matrix": [0, 8], "x": 8, "y": 0}, - {"matrix": [0, 9], "x": 9, "y": 0}, - {"matrix": [0, 10], "x": 10, "y": 0}, - {"matrix": [0, 11], "x": 11, "y": 0}, - {"matrix": [0, 12], "x": 12, "y": 0}, - {"matrix": [0, 13], "x": 13, "y": 0}, - {"matrix": [1, 13], "x": 14, "y": 0}, - - {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, - {"matrix": [1, 1], "x": 1.5, "y": 1}, - {"matrix": [1, 2], "x": 2.5, "y": 1}, - {"matrix": [1, 3], "x": 3.5, "y": 1}, - {"matrix": [1, 4], "x": 4.5, "y": 1}, - {"matrix": [1, 5], "x": 5.5, "y": 1}, - {"matrix": [1, 6], "x": 6.5, "y": 1}, - {"matrix": [1, 7], "x": 7.5, "y": 1}, - {"matrix": [1, 8], "x": 8.5, "y": 1}, - {"matrix": [1, 9], "x": 9.5, "y": 1}, - {"matrix": [1, 10], "x": 10.5, "y": 1}, - {"matrix": [1, 11], "x": 11.5, "y": 1}, - {"matrix": [1, 12], "x": 12.5, "y": 1}, - {"matrix": [2, 13], "x": 13.5, "y": 1, "w": 1.5}, - - {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, - {"matrix": [2, 1], "x": 1.75, "y": 2}, - {"matrix": [2, 2], "x": 2.75, "y": 2}, - {"matrix": [2, 3], "x": 3.75, "y": 2}, - {"matrix": [2, 4], "x": 4.75, "y": 2}, - {"matrix": [2, 5], "x": 5.75, "y": 2}, - {"matrix": [2, 6], "x": 6.75, "y": 2}, - {"matrix": [2, 7], "x": 7.75, "y": 2}, - {"matrix": [2, 8], "x": 8.75, "y": 2}, - {"matrix": [2, 9], "x": 9.75, "y": 2}, - {"matrix": [2, 10], "x": 10.75, "y": 2}, - {"matrix": [2, 11], "x": 11.75, "y": 2}, - {"matrix": [2, 12], "x": 12.75, "y": 2, "w": 2.25}, - - {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, - {"matrix": [3, 2], "x": 2.25, "y": 3}, - {"matrix": [3, 3], "x": 3.25, "y": 3}, - {"matrix": [3, 4], "x": 4.25, "y": 3}, - {"matrix": [3, 5], "x": 5.25, "y": 3}, - {"matrix": [3, 6], "x": 6.25, "y": 3}, - {"matrix": [3, 7], "x": 7.25, "y": 3}, - {"matrix": [3, 8], "x": 8.25, "y": 3}, - {"matrix": [3, 9], "x": 9.25, "y": 3}, - {"matrix": [3, 10], "x": 10.25, "y": 3}, - {"matrix": [3, 11], "x": 11.25, "y": 3}, - {"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75}, - {"matrix": [3, 13], "x": 14, "y": 3}, - - {"matrix": [5, 0], "x": 15.25, "y": 3}, - {"matrix": [5, 1], "x": 16.25, "y": 3}, - {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.5}, {"matrix": [4, 2], "x": 1.5, "y": 4}, {"matrix": [4, 3], "x": 2.5, "y": 4, "w": 1.5}, diff --git a/keyboards/nightly_boards/n60_s/keymaps/ansi_encoder/keymap.c b/keyboards/nightly_boards/n60_s/keymaps/ansi_encoder/keymap.c deleted file mode 100644 index 9316b20c75..0000000000 --- a/keyboards/nightly_boards/n60_s/keymaps/ansi_encoder/keymap.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base */ - [0] = LAYOUT_60_ansi_split_bs_rshift_encoder( - 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_BSPC, KC_BSPC, - 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 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_RSFT, KC_RSFT, KC_VOLD, KC_VOLU, - KC_LCTL, MO(1), KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RGUI, KC_RCTL - ), - [1] = LAYOUT_60_ansi_split_bs_rshift_encoder( - QK_BOOT, 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_DEL, - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS - ) -}; diff --git a/keyboards/nightly_boards/n60_s/keymaps/tsangan_encoder/keymap.c b/keyboards/nightly_boards/n60_s/keymaps/tsangan_encoder/keymap.c deleted file mode 100644 index cc25ac42e7..0000000000 --- a/keyboards/nightly_boards/n60_s/keymaps/tsangan_encoder/keymap.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base */ - [0] = LAYOUT_60_ansi_split_bs_rshift_tsangan_encoder( - 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_BSPC, KC_BSPC, - 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 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_RSFT, KC_RSFT, KC_VOLD, KC_VOLU, - KC_LCTL, MO(1), KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL - ), - [1] = LAYOUT_60_ansi_split_bs_rshift_tsangan_encoder( - QK_BOOT, 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_DEL, - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ) -}; diff --git a/keyboards/nightly_boards/n60_s/keymaps/via/keymap.c b/keyboards/nightly_boards/n60_s/keymaps/via/keymap.c index d76c734782..54e9888ff6 100644 --- a/keyboards/nightly_boards/n60_s/keymaps/via/keymap.c +++ b/keyboards/nightly_boards/n60_s/keymaps/via/keymap.c @@ -17,32 +17,41 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base */ - [0] = LAYOUT_60_ansi_split_bs_rshift_encoder( + [0] = LAYOUT_60_ansi_split_bs_rshift( 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_BSPC, KC_BSPC, 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 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_LSFT, KC_LSFT, KC_VOLD, KC_VOLU, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_LSFT, KC_LCTL, MO(1), KC_LALT, KC_SPC, KC_LALT, KC_APP, KC_RGUI, KC_LCTL ), - [1] = LAYOUT_60_ansi_split_bs_rshift_encoder( + [1] = LAYOUT_60_ansi_split_bs_rshift( QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, KC_F12, KC_DEL, KC_DEL, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS - ), - [2] = LAYOUT_60_ansi_split_bs_rshift_encoder( + ), + [2] = LAYOUT_60_ansi_split_bs_rshift( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS ), - [3] = LAYOUT_60_ansi_split_bs_rshift_encoder( + [3] = LAYOUT_60_ansi_split_bs_rshift( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS ) }; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______) }, +}; +#endif diff --git a/keyboards/nightly_boards/n60_s/keymaps/via/rules.mk b/keyboards/nightly_boards/n60_s/keymaps/via/rules.mk index 36b7ba9cbc..1189f4ad19 100644 --- a/keyboards/nightly_boards/n60_s/keymaps/via/rules.mk +++ b/keyboards/nightly_boards/n60_s/keymaps/via/rules.mk @@ -1,2 +1,3 @@ VIA_ENABLE = yes LTO_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/nightly_boards/n60_s/n60_s.c b/keyboards/nightly_boards/n60_s/n60_s.c deleted file mode 100644 index dd0d23425b..0000000000 --- a/keyboards/nightly_boards/n60_s/n60_s.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "n60_s.h" - -void matrix_scan_kb(void) { - encoder_action_unregister(); - matrix_scan_user(); -} - -bool encoder_update_kb(uint8_t index, bool clockwise) { -// if (!encoder_update_user(index, clockwise)) return false; - encoder_action_register(index, clockwise); - return true; -}; diff --git a/keyboards/nightly_boards/n60_s/n60_s.h b/keyboards/nightly_boards/n60_s/n60_s.h deleted file mode 100644 index 33cf8e0b68..0000000000 --- a/keyboards/nightly_boards/n60_s/n60_s.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright 2020 Neil Brian Ramirez - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "quantum.h" -#include "encoder_action.h" diff --git a/keyboards/nightly_boards/n60_s/rules.mk b/keyboards/nightly_boards/n60_s/rules.mk index a37378959e..f404ad0163 100644 --- a/keyboards/nightly_boards/n60_s/rules.mk +++ b/keyboards/nightly_boards/n60_s/rules.mk @@ -12,6 +12,3 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = yes # Audio output ENCODER_ENABLE = yes # Enable Rotary Encoders LTO_ENABLE = yes - -# Added encoder Action -SRC += encoder_action.c \ No newline at end of file -- cgit v1.2.3