aboutsummaryrefslogtreecommitdiff
path: root/keyboards/jj40
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/jj40')
-rw-r--r--keyboards/jj40/config.h9
-rw-r--r--keyboards/jj40/jj40.c32
-rw-r--r--keyboards/jj40/jj40.h2
-rw-r--r--keyboards/jj40/keymaps/fun40/rules.mk6
-rw-r--r--keyboards/jj40/keymaps/krusli/keymap.c85
-rw-r--r--keyboards/jj40/keymaps/krusli/readme.md2
-rw-r--r--keyboards/jj40/rules.mk9
-rw-r--r--keyboards/jj40/usbconfig.h3
8 files changed, 129 insertions, 19 deletions
diff --git a/keyboards/jj40/config.h b/keyboards/jj40/config.h
index 02339a33f..3152f22be 100644
--- a/keyboards/jj40/config.h
+++ b/keyboards/jj40/config.h
@@ -15,6 +15,8 @@ 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#include "config_common.h"
19
18#ifndef CONFIG_H 20#ifndef CONFIG_H
19#define CONFIG_H 21#define CONFIG_H
20 22
@@ -39,6 +41,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
39 41
40#define NO_UART 1 42#define NO_UART 1
41 43
44/* RGB underglow */
45// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards.
46// The same pin is used on the JJ40, at least.
47#define RGBLED_NUM 5
48#define RGB_DI_PIN E2
49#define RGBLIGHT_ANIMATIONS
50
42/* key combination for command */ 51/* key combination for command */
43#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) 52#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
44 53
diff --git a/keyboards/jj40/jj40.c b/keyboards/jj40/jj40.c
index d5add2a6b..6044e83fd 100644
--- a/keyboards/jj40/jj40.c
+++ b/keyboards/jj40/jj40.c
@@ -22,19 +22,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
22#include "action_layer.h" 22#include "action_layer.h"
23#include "quantum.h" 23#include "quantum.h"
24 24
25__attribute__ ((weak)) 25#include "i2c.h"
26void matrix_scan_user(void) { 26
27 /* Nothing to do here... yet */ 27// custom RGB driver
28extern rgblight_config_t rgblight_config;
29void rgblight_set(void) {
30 if (!rgblight_config.enable) {
31 for (uint8_t i=0; i<RGBLED_NUM; i++) {
32 led[i].r = 0;
33 led[i].g = 0;
34 led[i].b = 0;
35 }
36 }
37
38 i2c_init();
39 i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
28} 40}
29 41
30void matrix_init_kb(void) { 42__attribute__ ((weak))
31 43void matrix_scan_user(void) {
32 // Call the keymap level matrix init. 44 rgblight_task();
33 matrix_init_user(); 45 /* Nothing else for now. */
34
35 // Set our LED pins as output
36 DDRB |= (1<<6);
37} 46}
38
39void matrix_init_user(void) {
40} \ No newline at end of file
diff --git a/keyboards/jj40/jj40.h b/keyboards/jj40/jj40.h
index 6e90cb972..6837423f8 100644
--- a/keyboards/jj40/jj40.h
+++ b/keyboards/jj40/jj40.h
@@ -65,6 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
65 { K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \ 65 { K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \
66} 66}
67 67
68#define KEYMAP KEYMAP_OFFSET 68#define KEYMAP KEYMAP_MIT
69 69
70#endif 70#endif
diff --git a/keyboards/jj40/keymaps/fun40/rules.mk b/keyboards/jj40/keymaps/fun40/rules.mk
index cd2208edd..6fe3b0515 100644
--- a/keyboards/jj40/keymaps/fun40/rules.mk
+++ b/keyboards/jj40/keymaps/fun40/rules.mk
@@ -11,7 +11,11 @@ MIDI_ENABLE = no # MIDI controls
11AUDIO_ENABLE = yes # Audio output on port C6 11AUDIO_ENABLE = yes # Audio output on port C6
12UNICODE_ENABLE = no # Unicode 12UNICODE_ENABLE = no # Unicode
13BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 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. 14
15RGBLIGHT_ENABLE = yes
16RGBLIGHT_CUSTOM_DRIVER = yes
17DISABLE_WS2812 = yes
18
15 19
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 20SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17 21
diff --git a/keyboards/jj40/keymaps/krusli/keymap.c b/keyboards/jj40/keymaps/krusli/keymap.c
new file mode 100644
index 000000000..59e3988e1
--- /dev/null
+++ b/keyboards/jj40/keymaps/krusli/keymap.c
@@ -0,0 +1,85 @@
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#include "jj40.h"
19#include "action_layer.h"
20
21#define _QWERTY 0
22#define _LOWER 1
23#define _RAISE 2
24
25enum custom_keycodes {
26 QWERTY = SAFE_RANGE,
27 LOWER,
28 RAISE,
29};
30
31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32/* Qwerty
33 * ,-----------------------------------------------------------------------------------.
34 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
35 * |------+------+------+------+------+-------------+------+------+------+------+------|
36 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
37 * |------+------+------+------+------+------|------+------+------+------+------+------|
38 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
39 * |------+------+------+------+------+------+------+------+------+------+------+------|
40 * | | Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right |
41 * `-----------------------------------------------------------------------------------'
42 */
43[_QWERTY] = KEYMAP( \
44 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
45 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
46 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
47 _______, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
48),
49
50/* Lower
51 * ,-----------------------------------------------------------------------------------.
52 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
53 * |------+------+------+------+------+-------------+------+------+------+------+------|
54 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
55 * |------+------+------+------+------+------|------+------+------+------+------+------|
56 * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter |
57 * |------+------+------+------+------+------+------+------+------+------+------+------|
58 * | | | | | | | | Next | Vol- | Vol+ | Play |
59 * `-----------------------------------------------------------------------------------'
60 */
61[_LOWER] = KEYMAP( \
62 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
63 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
64 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,_______, _______, _______, \
65 _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
66),
67
68/* Raise
69 * ,-----------------------------------------------------------------------------------.
70 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
71 * |------+------+------+------+------+-------------+------+------+------+------+------|
72 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
73 * |------+------+------+------+------+------|------+------+------+------+------+------|
74 * | | F7 | F8 | F9 | F10 | F11 | F12 | RGB | RGB | RGB | RGB |Enter |
75 * |------+------+------+------+------+------+------+------+------+------+------+------|
76 * | | RGB | RGB | RGB | RGB | | | Next | Vol- | Vol+ | Play |
77 * `-----------------------------------------------------------------------------------'
78 */
79[_RAISE] = KEYMAP( \
80 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
81 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
82 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, \
83 _______, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
84)
85};
diff --git a/keyboards/jj40/keymaps/krusli/readme.md b/keyboards/jj40/keymaps/krusli/readme.md
new file mode 100644
index 000000000..75a84d0e6
--- /dev/null
+++ b/keyboards/jj40/keymaps/krusli/readme.md
@@ -0,0 +1,2 @@
1# krusli
2Default JJ40 keymap, adapted with RGB underglow support. GUI and LAlt is also swapped.
diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk
index c6279a2a5..cdc898c0f 100644
--- a/keyboards/jj40/rules.mk
+++ b/keyboards/jj40/rules.mk
@@ -26,7 +26,7 @@ F_CPU = 12000000
26 26
27# Bootloader 27# Bootloader
28# This definition is optional, and if your keyboard supports multiple bootloaders of 28# This definition is optional, and if your keyboard supports multiple bootloaders of
29# different sizes, comment this out, and the correct address will be loaded 29# different sizes, comment this out, and the correct address will be loaded
30# automatically (+60). See bootloader.mk for all options. 30# automatically (+60). See bootloader.mk for all options.
31BOOTLOADER = bootloadHID 31BOOTLOADER = bootloadHID
32 32
@@ -37,8 +37,11 @@ EXTRAKEY_ENABLE = yes
37CONSOLE_ENABLE = no 37CONSOLE_ENABLE = no
38COMMAND_ENABLE = yes 38COMMAND_ENABLE = yes
39BACKLIGHT_ENABLE = no 39BACKLIGHT_ENABLE = no
40RGBLIGHT_ENABLE = no 40
41RGBLIGHT_CUSTOM_DRIVER = no 41RGBLIGHT_ENABLE = yes
42RGBLIGHT_CUSTOM_DRIVER = yes
43DISABLE_WS2812 = yes # TODO check if this is necessary
44
42KEY_LOCK_ENABLE = yes 45KEY_LOCK_ENABLE = yes
43 46
44# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 47# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
diff --git a/keyboards/jj40/usbconfig.h b/keyboards/jj40/usbconfig.h
index cae839e74..520d08f61 100644
--- a/keyboards/jj40/usbconfig.h
+++ b/keyboards/jj40/usbconfig.h
@@ -118,7 +118,8 @@ section at the end of this file).
118/* Define this to 1 if the device has its own power supply. Set it to 0 if the 118/* Define this to 1 if the device has its own power supply. Set it to 0 if the
119 * device is powered from the USB bus. 119 * device is powered from the USB bus.
120 */ 120 */
121#define USB_CFG_MAX_BUS_POWER 500 121// max power draw with maxed white underglow measured at 120 mA (peaks)
122#define USB_CFG_MAX_BUS_POWER 150
122/* Set this variable to the maximum USB bus power consumption of your device. 123/* Set this variable to the maximum USB bus power consumption of your device.
123 * The value is in milliamperes. [It will be divided by two since USB 124 * The value is in milliamperes. [It will be divided by two since USB
124 * communicates power requirements in units of 2 mA.] 125 * communicates power requirements in units of 2 mA.]