aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandTrawick <RandTrawick@gmail.com>2017-11-27 14:08:53 -0700
committerJack Humbert <jack.humb@gmail.com>2017-11-27 16:08:53 -0500
commit9113f3387a670373919fe62899b0ab27e9d89eba (patch)
tree45580652db3c2ef761b2c29ffc2b7f5c322e7877
parent0bd453b5276714b9a33c6a2060851ea5184c52b2 (diff)
downloadqmk_firmware-9113f3387a670373919fe62899b0ab27e9d89eba.tar.gz
qmk_firmware-9113f3387a670373919fe62899b0ab27e9d89eba.zip
JJ40 updates (#2056)
* my bits * fixed safdb * readme * readme * better name, fixed compile error * fixed matrix user * cleanup
-rw-r--r--keyboards/jj40/config.h6
-rw-r--r--keyboards/jj40/jj40.c12
-rw-r--r--keyboards/jj40/keymaps/fun40/config.h9
-rw-r--r--keyboards/jj40/keymaps/fun40/jj40.h70
-rw-r--r--keyboards/jj40/keymaps/fun40/keymap.c123
-rw-r--r--keyboards/jj40/keymaps/fun40/readme.md4
-rw-r--r--keyboards/jj40/keymaps/fun40/rules.mk20
-rw-r--r--keyboards/jj40/rules.mk3
8 files changed, 247 insertions, 0 deletions
diff --git a/keyboards/jj40/config.h b/keyboards/jj40/config.h
index fdea4a042..42a37c957 100644
--- a/keyboards/jj40/config.h
+++ b/keyboards/jj40/config.h
@@ -29,6 +29,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29#define MATRIX_ROWS 8 29#define MATRIX_ROWS 8
30#define MATRIX_COLS 15 30#define MATRIX_COLS 15
31 31
32/* COL2ROW or ROW2COL */
33#define DIODE_DIRECTION COL2ROW
34
35#define BACKLIGHT_PIN B6
36#define BACKLIGHT_LEVELS 3
37
32#define TAPPING_TOGGLE 3 38#define TAPPING_TOGGLE 3
33 39
34#define NO_UART 1 40#define NO_UART 1
diff --git a/keyboards/jj40/jj40.c b/keyboards/jj40/jj40.c
index 136e023fa..d5add2a6b 100644
--- a/keyboards/jj40/jj40.c
+++ b/keyboards/jj40/jj40.c
@@ -26,3 +26,15 @@ __attribute__ ((weak))
26void matrix_scan_user(void) { 26void matrix_scan_user(void) {
27 /* Nothing to do here... yet */ 27 /* Nothing to do here... yet */
28} 28}
29
30void matrix_init_kb(void) {
31
32 // Call the keymap level matrix init.
33 matrix_init_user();
34
35 // Set our LED pins as output
36 DDRB |= (1<<6);
37}
38
39void matrix_init_user(void) {
40} \ No newline at end of file
diff --git a/keyboards/jj40/keymaps/fun40/config.h b/keyboards/jj40/keymaps/fun40/config.h
new file mode 100644
index 000000000..89807d84a
--- /dev/null
+++ b/keyboards/jj40/keymaps/fun40/config.h
@@ -0,0 +1,9 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#define FORCE_NKRO
7#define PREVENT_STUCK_MODIFIERS
8
9#endif
diff --git a/keyboards/jj40/keymaps/fun40/jj40.h b/keyboards/jj40/keymaps/fun40/jj40.h
new file mode 100644
index 000000000..a6162d9c0
--- /dev/null
+++ b/keyboards/jj40/keymaps/fun40/jj40.h
@@ -0,0 +1,70 @@
1/*
2Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef KEYMAP_COMMON_H
19#define KEYMAP_COMMON_H
20
21#include "quantum.h"
22// #include "keycode.h"
23// #include "action.h"
24
25#define KEYMAP_GRID( \
26 K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
27 K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
28 K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
29 K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312 \
30) \
31{ \
32 { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
33 { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
34 { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
35 { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
36 { K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \
37}
38
39#define KEYMAP_MIT( \
40 K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
41 K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
42 K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
43 K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \
44) \
45{ \
46 { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
47 { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
48 { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
49 { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
50 { K312, K311, K310, K39, K35, K3X, KC_NO, K38, K34, K33, K32, K31 } \
51}
52
53#define KEYMAP_OFFSET( \
54 K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
55 K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
56 K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
57 K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \
58) \
59{ \
60 { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
61 { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
62 { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
63 { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
64 { K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \
65}
66
67#define KEYMAP KEYMAP_GRID
68#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
69
70#endif
diff --git a/keyboards/jj40/keymaps/fun40/keymap.c b/keyboards/jj40/keymaps/fun40/keymap.c
new file mode 100644
index 000000000..f5641e297
--- /dev/null
+++ b/keyboards/jj40/keymaps/fun40/keymap.c
@@ -0,0 +1,123 @@
1#include "jj40.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4#ifdef BACKLIGHT_ENABLE
5 #include "backlight.h"
6#endif
7
8#define _QWERTY 0
9#define _LOWER 1
10#define _RAISE 2
11#define _BL 4 // Backlight
12// #define _ADJUST 3
13#define TG_NKRO MAGIC_TOGGLE_NKRO
14
15
16enum custom_keycodes {
17 QWERTY = SAFE_RANGE,
18 LOWER,
19 RAISE,
20};
21
22const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23/* Qwerty
24 * ,-----------------------------------------------------------------------------------.
25 * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
26 * |------+------+------+------+------+-------------+------+------+------+------+------|
27 * | Tab | A | S | D | F | G | H | J | K | L | ; | " |
28 * |------+------+------+------+------+------|------+------+------+------+------+------|
29 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
30 * |------+------+------+------+------+------+------+------+------+------+------+------|
31 * | Ctrl | Del | Alt | GUI |Lower | Space|Space |Raise | Left | Down | Up |Right |
32 * `-----------------------------------------------------------------------------------'
33 */
34[_QWERTY] = KEYMAP( \
35 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
36 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
37 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \
38 KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, MO(_LOWER),KC_SPC,KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
39),
40
41/* Lower
42 * ,-----------------------------------------------------------------------------------.
43 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
44 * |------+------+------+------+------+-------------+------+------+------+------+------|
45 * | ! | @ | # | $ | % | ^ | & | * | ( | ) | | |
46 * |------+------+------+------+------+-------------+------+------+------+------+------|
47 * | Shift|PrScr |ISO ~ |ISO | | | | | | |bl_on |bl_stp| Enter|
48 * |------+------+------+------+------+------+------+------+------+------+------+------|
49 * | Ctrl | nkro | Alt | NKRO |Lower | PgDn | PgUp |Raise | Next | Vol- | Vol+ | Play |
50 * `-----------------------------------------------------------------------------------'
51 */
52[_LOWER] = KEYMAP( \
53 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
54 KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, \
55 KC_LSFT, KC_PSCR, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, _______, _______, BL_ON, BL_STEP, KC_ENT, \
56 KC_LCTL, MAGIC_TOGGLE_NKRO, KC_LALT, TG_NKRO, _______, KC_PGDN, KC_PGUP, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
57),
58
59/* Raise
60 * ,-----------------------------------------------------------------------------------.
61 * | Caps | + | - | = | ( | ) | | 7 | 8 | 9 | Bksp | Del |
62 * |------+------+------+------+------+-------------+------+------+------+------+------|
63 * | Lock | ~ | _ | | [ | ] | | 4 | 5 | 6 | |Enter |
64 * |------+------+------+------+------+------|------+------+------+------+------+------|
65 * | Ins | ` | \ | | | { | } | | 1 | 2 | 3 | . | |
66 * |------+------+------+------+------+------+------+------+------+------+------+------|
67 * | Ctrl | | Alt | |Lower | | |Raise | 0 | | Home | End |
68 * `-----------------------------------------------------------------------------------'
69 */
70[_RAISE] = KEYMAP( \
71 KC_CAPS, KC_MINS, KC_PLUS, KC_EQL, KC_LPRN, KC_RPRN, _______, KC_7, KC_8, KC_9, KC_BSPC, KC_DEL, \
72 KC_LOCK, KC_TILD, KC_UNDS, _______,KC_LBRC, KC_RBRC, _______, KC_4, KC_5, KC_6, _______, _______, \
73 KC_INS, KC_GRV, KC_BSLS, KC_PIPE, KC_LCBR, KC_RCBR, _______, KC_1, KC_2, KC_3, KC_DOT, _______, \
74 KC_LCTL, _______, KC_LALT, _______, _______, _______, _______, _______, KC_0, _______, KC_HOME, KC_END \
75)
76
77/* Adjust
78 G = git
79 M = mail
80 * ,-----------------------------------------------------------------------------------.
81 * | gAdd |gStash| | const| | Clog | | | Mstk | Mrad |Mgmail| |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | gPush| | | if() | | Clog2| | | | |Mcity | |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | gPull| | | | | | | | | | | |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | | | | |Lower | | |Raise | | | | |
88 * `-----------------------------------------------------------------------------------'
89 */
90
91
92/* Empty
93 * ,-----------------------------------------------------------------------------------.
94 * | | | | | | | | | | | | |
95 * |------+------+------+------+------+-------------+------+------+------+------+------|
96 * | | | | | | | | | | | | |
97 * |------+------+------+------+------+------|------+------+------+------+------+------|
98 * | | | | | | | | | | | | |
99 * |------+------+------+------+------+------+------+------+------+------+------+------|
100 * | | | | |Lower | | |Raise | | | | |
101 * `-----------------------------------------------------------------------------------'
102 */
103};
104
105// Macro actions for each corresponding ID.
106const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
107{
108 // MACRODOWN only works in this function
109 switch (id) {
110 case 0:
111 if (record->event.pressed) {
112 register_code(KC_RSFT);
113#ifdef BACKLIGHT_ENABLE
114 backlight_step();
115#endif
116 }
117 else {
118 unregister_code(KC_RSFT);
119 }
120 break;
121 }
122 return MACRO_NONE;
123};
diff --git a/keyboards/jj40/keymaps/fun40/readme.md b/keyboards/jj40/keymaps/fun40/readme.md
new file mode 100644
index 000000000..f4036fa0e
--- /dev/null
+++ b/keyboards/jj40/keymaps/fun40/readme.md
@@ -0,0 +1,4 @@
1# Fun 40%.
2
3* backlighting on flash
4 * backlight fails on reboot \ No newline at end of file
diff --git a/keyboards/jj40/keymaps/fun40/rules.mk b/keyboards/jj40/keymaps/fun40/rules.mk
new file mode 100644
index 000000000..cd2208edd
--- /dev/null
+++ b/keyboards/jj40/keymaps/fun40/rules.mk
@@ -0,0 +1,20 @@
1
2
3BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
4MOUSEKEY_ENABLE = no # Mouse keys(+4700)
5EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
6CONSOLE_ENABLE = no # Console for debug(+400)
7COMMAND_ENABLE = yes # Commands for debug and configuration
8NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
9BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
10MIDI_ENABLE = no # MIDI controls
11AUDIO_ENABLE = yes # Audio output on port C6
12UNICODE_ENABLE = no # Unicode
13BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
14RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
15
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17
18ifndef QUANTUM_DIR
19 include ../../../../Makefile
20endif
diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk
index 4b0a9e190..c39ebf222 100644
--- a/keyboards/jj40/rules.mk
+++ b/keyboards/jj40/rules.mk
@@ -35,6 +35,9 @@ RGBLIGHT_ENABLE = no
35RGBLIGHT_CUSTOM_DRIVER = no 35RGBLIGHT_CUSTOM_DRIVER = no
36KEY_LOCK_ENABLE = yes 36KEY_LOCK_ENABLE = yes
37 37
38# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
39SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
40
38OPT_DEFS = -DDEBUG_LEVEL=0 41OPT_DEFS = -DDEBUG_LEVEL=0
39OPT_DEFS += -DBOOTLOADER_SIZE=2048 42OPT_DEFS += -DBOOTLOADER_SIZE=2048
40 43