aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMechMerlin <30334081+mechmerlin@users.noreply.github.com>2021-02-27 22:02:34 -0800
committerGitHub <noreply@github.com>2021-02-28 17:02:34 +1100
commitaf2e1f4e4dd6b98cbeffbb7a71724da69a5232b5 (patch)
treee02f4ae6f4735352e9411a1ef27450156cd2009f
parent4fe8c473fdf50efb77017319847e8fd45fd3f263 (diff)
downloadqmk_firmware-af2e1f4e4dd6b98cbeffbb7a71724da69a5232b5.tar.gz
qmk_firmware-af2e1f4e4dd6b98cbeffbb7a71724da69a5232b5.zip
Banana Split VIA Support (#11944)
* add VIA keymap for bananasplit * refactor code to new standards
-rw-r--r--keyboards/thevankeyboards/bananasplit/bananasplit.c43
-rw-r--r--keyboards/thevankeyboards/bananasplit/bananasplit.h44
-rw-r--r--keyboards/thevankeyboards/bananasplit/config.h22
-rw-r--r--keyboards/thevankeyboards/bananasplit/keymaps/via/keymap.c53
-rw-r--r--keyboards/thevankeyboards/bananasplit/keymaps/via/rules.mk2
-rw-r--r--keyboards/thevankeyboards/bananasplit/readme.md6
-rw-r--r--keyboards/thevankeyboards/bananasplit/rules.mk16
7 files changed, 102 insertions, 84 deletions
diff --git a/keyboards/thevankeyboards/bananasplit/bananasplit.c b/keyboards/thevankeyboards/bananasplit/bananasplit.c
index 1aa8fb174..88917cb74 100644
--- a/keyboards/thevankeyboards/bananasplit/bananasplit.c
+++ b/keyboards/thevankeyboards/bananasplit/bananasplit.c
@@ -1,28 +1,17 @@
1#include "bananasplit.h" 1/* Copyright 2021 MechMerlin <mechmerlin@gmail.com>
2 2 *
3void matrix_init_kb(void) { 3 * This program is free software: you can redistribute it and/or modify
4 // put your keyboard start-up code here 4 * it under the terms of the GNU General Public License as published by
5 // runs once when the firmware starts up 5 * the Free Software Foundation, either version 2 of the License, or
6 6 * (at your option) any later version.
7 matrix_init_user(); 7 *
8} 8 * This program is distributed in the hope that it will be useful,
9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10void matrix_scan_kb(void) { 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // put your looping keyboard code here 11 * GNU General Public License for more details.
12 // runs every cycle (a lot) 12 *
13 13 * You should have received a copy of the GNU General Public License
14 matrix_scan_user(); 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15} 15 */
16 16
17bool process_record_kb(uint16_t keycode, keyrecord_t *record) { 17#include "bananasplit.h"
18 // put your per-action keyboard code here
19 // runs for every action, just before processing by the firmware
20
21 return process_record_user(keycode, record);
22}
23
24void led_set_kb(uint8_t usb_led) {
25 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
26
27 led_set_user(usb_led);
28}
diff --git a/keyboards/thevankeyboards/bananasplit/bananasplit.h b/keyboards/thevankeyboards/bananasplit/bananasplit.h
index 8d545c1f9..7928fe2fa 100644
--- a/keyboards/thevankeyboards/bananasplit/bananasplit.h
+++ b/keyboards/thevankeyboards/bananasplit/bananasplit.h
@@ -14,8 +14,8 @@ GNU General Public License for more details.
14You should have received a copy of the GNU General Public License 14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#ifndef BANANASPLIT_H 17
18#define BANANASPLIT_H 18#pragma once
19 19
20#include "quantum.h" 20#include "quantum.h"
21 21
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
32| K40 | K41 | K42 | K44 | K45 | K46 | K48 | K49 | K4A | K4B | K4C | 32| K40 | K41 | K42 | K44 | K45 | K46 | K48 | K49 | K4A | K4B | K4C |
33------------------------------------------------------------------------------------------- 33-------------------------------------------------------------------------------------------
34*/ 34*/
35#define LAYOUT_base( \ 35#define LAYOUT_base( \
36 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ 36 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
37 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 37 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
38 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ 38 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
@@ -86,14 +86,14 @@ KEYMAP( \
86#define LAYOUT_60_iso( \ 86#define LAYOUT_60_iso( \
87 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ 87 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
88 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 88 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
89 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ 89 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
90 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ 90 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
91 K40, K41, K42, K45, K48, K49, K4B, K4C \ 91 K40, K41, K42, K45, K48, K49, K4B, K4C \
92) { \ 92) { \
93 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ 93 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
94 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ 94 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
95 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ 95 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \
96 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ 96 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \
97 { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO } \ 97 { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO } \
98} 98}
99 99
@@ -112,10 +112,10 @@ KEYMAP( \
112*/ 112*/
113#define LAYOUT_all( \ 113#define LAYOUT_all( \
114 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ 114 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
115 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 115 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
116 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ 116 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
117 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ 117 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
118 K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ 118 K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \
119) { \ 119) { \
120 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ 120 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
121 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ 121 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
@@ -126,17 +126,15 @@ KEYMAP( \
126 126
127#define LAYOUT_hhkb_arrow( \ 127#define LAYOUT_hhkb_arrow( \
128 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ 128 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
129 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ 129 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
130 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ 130 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
131 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D,\ 131 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
132 K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ 132 K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \
133) { \ 133) { \
134 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ 134 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
135 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ 135 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
136 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ 136 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
137 { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ 137 { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
138 { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ 138 { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \
139} 139}
140 140
141
142#endif
diff --git a/keyboards/thevankeyboards/bananasplit/config.h b/keyboards/thevankeyboards/bananasplit/config.h
index 8e7f00035..9cb1fcceb 100644
--- a/keyboards/thevankeyboards/bananasplit/config.h
+++ b/keyboards/thevankeyboards/bananasplit/config.h
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef CONFIG_H 18#pragma once
19#define CONFIG_H
20 19
21#include "config_common.h" 20#include "config_common.h"
22 21
@@ -55,22 +54,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
55/* Locking resynchronize hack */ 54/* Locking resynchronize hack */
56#define LOCKING_RESYNC_ENABLE 55#define LOCKING_RESYNC_ENABLE
57 56
58/*
59 * Feature disable options
60 * These options are also useful to firmware size reduction.
61 */
62
63/* disable debug print */
64//#define NO_DEBUG
65
66/* disable print */
67//#define NO_PRINT
68
69/* disable action features */
70//#define NO_ACTION_LAYER
71//#define NO_ACTION_TAPPING
72//#define NO_ACTION_ONESHOT
73//#define NO_ACTION_MACRO
74//#define NO_ACTION_FUNCTION
75
76#endif
diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/via/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/via/keymap.c
new file mode 100644
index 000000000..3094f6955
--- /dev/null
+++ b/keyboards/thevankeyboards/bananasplit/keymaps/via/keymap.c
@@ -0,0 +1,53 @@
1/* Copyright 2021 MechMerlin <mechmerlin@gmail.com>
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#include QMK_KEYBOARD_H
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_60_ansi(
21 KC_GRV, 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,
22 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,
23 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,
24 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
25 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL
26 ),
27
28 [1] = LAYOUT_60_ansi(
29 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, \
30 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, \
31 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, \
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
33 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
34 ),
35
36 [2] = LAYOUT_60_ansi(
37 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, \
38 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, \
39 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, \
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
41 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
42 ),
43
44 [3] = LAYOUT_60_ansi(
45 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, \
46 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, \
47 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, \
48 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
49 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
50 ),
51
52
53};
diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/via/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/via/rules.mk
new file mode 100644
index 000000000..36b7ba9cb
--- /dev/null
+++ b/keyboards/thevankeyboards/bananasplit/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes
diff --git a/keyboards/thevankeyboards/bananasplit/readme.md b/keyboards/thevankeyboards/bananasplit/readme.md
index 41d0d407d..699a43cbd 100644
--- a/keyboards/thevankeyboards/bananasplit/readme.md
+++ b/keyboards/thevankeyboards/bananasplit/readme.md
@@ -2,9 +2,9 @@
2 2
3A 60% PCB featuring a split spacebar. 3A 60% PCB featuring a split spacebar.
4 4
5Keyboard Maintainer: QMK Community 5* Keyboard Maintainer: QMK Community
6Hardware Supported: BananaSplit60 PCB 6* Hardware Supported: BananaSplit60 PCB
7Hardware Availability: https://thevankeyboards.com/products/gb-bananasplit-60-keyboard-kit?variant=42149104910 7* Hardware Availability: [TheVan Keyboards](https://thevankeyboards.com/)
8 8
9Make example for this keyboard (after setting up your build environment): 9Make example for this keyboard (after setting up your build environment):
10 10
diff --git a/keyboards/thevankeyboards/bananasplit/rules.mk b/keyboards/thevankeyboards/bananasplit/rules.mk
index 4530a87f6..9d62db53f 100644
--- a/keyboards/thevankeyboards/bananasplit/rules.mk
+++ b/keyboards/thevankeyboards/bananasplit/rules.mk
@@ -14,16 +14,12 @@ BOOTLOADER = atmel-dfu
14# Build Options 14# Build Options
15# comment out to disable the options. 15# comment out to disable the options.
16# 16#
17BOOTMAGIC_ENABLE = yes # 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 = yes # Console for debug 20CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration 21COMMAND_ENABLE = yes # Commands for debug and configuration
22#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 22NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
23NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
24BACKLIGHT_ENABLE = yes 23BACKLIGHT_ENABLE = yes
25 24
26# Optimize size but this may cause error "relocation truncated to fit"
27#EXTRALDFLAGS = -Wl,--relax
28
29LAYOUTS = 60_ansi 60_iso 25LAYOUTS = 60_ansi 60_iso