aboutsummaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-01-22 08:23:03 -0800
committerGitHub <noreply@github.com>2021-01-22 08:23:03 -0800
commit7a08b9d374dfcf9d872738af44b231862064b96f (patch)
treea83e16b5b6afd67b22fcbdf81ced5896554ca631 /keyboards
parentc16a3dcb5458bc8d237d26c20a434c333b48d5c8 (diff)
downloadqmk_firmware-7a08b9d374dfcf9d872738af44b231862064b96f.tar.gz
qmk_firmware-7a08b9d374dfcf9d872738af44b231862064b96f.zip
[Keymap] Cleanup and updating of drashna keymap code (#11516)
* Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c4
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h4
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h7
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c48
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/rules.mk4
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h14
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c3
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/rules.mk11
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/pointer_transport.c164
-rw-r--r--keyboards/kyria/keymaps/drashna/config.h4
-rw-r--r--keyboards/kyria/keymaps/drashna/rules.mk4
-rw-r--r--keyboards/moonlander/keymaps/drashna/keymap.c37
-rw-r--r--keyboards/ploopyco/mouse/keymaps/drashna/config.h24
-rw-r--r--keyboards/ploopyco/mouse/keymaps/drashna/keymap.c34
-rw-r--r--keyboards/ploopyco/mouse/keymaps/drashna/rules.mk4
15 files changed, 267 insertions, 99 deletions
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c
index c40e4173d..d931fd940 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/5x6_right_trackball.c
@@ -142,7 +142,7 @@ void pointing_device_init(void) {
142 trackball_set_cpi(dpi_array[keyboard_config.dpi_config]); 142 trackball_set_cpi(dpi_array[keyboard_config.dpi_config]);
143} 143}
144 144
145static bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) { 145static bool has_report_changed(report_mouse_t new, report_mouse_t old) {
146 return (new.buttons != old.buttons) || 146 return (new.buttons != old.buttons) ||
147 (new.x && new.x != old.x) || 147 (new.x && new.x != old.x) ||
148 (new.y && new.y != old.y) || 148 (new.y && new.y != old.y) ||
@@ -186,7 +186,7 @@ void pointing_device_send(void) {
186 mouseReport.x = 0; 186 mouseReport.x = 0;
187 mouseReport.y = 0; 187 mouseReport.y = 0;
188 process_mouse_user(&mouseReport, x, y); 188 process_mouse_user(&mouseReport, x, y);
189 if (has_mouse_report_changed(mouseReport, old_report)) { 189 if (has_report_changed(mouseReport, old_report)) {
190 host_mouse_send(&mouseReport); 190 host_mouse_send(&mouseReport);
191 } 191 }
192 } else { 192 } else {
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
index 147f12600..6d89314a2 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
@@ -65,3 +65,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
65 65
66#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095 66#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095
67#define DYNAMIC_KEYMAP_LAYER_COUNT 16 67#define DYNAMIC_KEYMAP_LAYER_COUNT 16
68
69/* serial.c configuration for split keyboard */
70#undef SOFT_SERIAL_PIN
71#define SOFT_SERIAL_PIN D2
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h
index 4e35d4c4f..5bad6bcab 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/config.h
@@ -19,9 +19,4 @@
19#pragma once 19#pragma once
20 20
21 21
22#define USE_SERIAL 22#include "../drashna/config.h"
23
24#define MASTER_LEFT
25// #define MASTER_RIGHT
26//#define EE_HANDS
27// Rows are doubled-up
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c
index 7550b1fd8..037f59af8 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/keymap.c
@@ -14,50 +14,4 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#include QMK_KEYBOARD_H 17// placeholder
18
19
20#define _QWERTY 0
21#define _LOWER 1
22#define _RAISE 2
23
24#define RAISE MO(_RAISE)
25#define LOWER MO(_LOWER)
26
27const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
28
29 [_QWERTY] = LAYOUT_5x6_right_trackball(
30 KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC,
31 KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS,
32 KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
33 KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH,
34 KC_LBRC,KC_RBRC, KC_EQL,
35 RAISE,KC_SPC, LOWER,
36 KC_TAB,KC_HOME, KC_END, KC_DEL,
37 KC_BSPC, KC_GRV, KC_LGUI, KC_LALT
38 ),
39
40 [_LOWER] = LAYOUT_5x6_right_trackball(
41
42 KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL,
43 _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS,
44 _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE,
45 _______,_______,_______,_______,_______,_______, _______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS,
46 _______,KC_PSCR, KC_P0,
47 _______,_______, _______,
48 _______,_______, _______,_______,
49 _______,_______, _______,_______
50
51 ),
52
53 [_RAISE] = LAYOUT_5x6_right_trackball(
54 KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,
55 _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE,
56 _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU,
57 _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD,
58 _______,_______, _______,
59 _______,_______, _______,
60 _______,_______, _______,_______,
61 _______,_______, _______,_______
62 ),
63};
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/rules.mk b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/rules.mk
new file mode 100644
index 000000000..457cda5b0
--- /dev/null
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/default/rules.mk
@@ -0,0 +1,4 @@
1USER_NAME := drashna
2SRC += ../drashna/keymap.c
3
4include $(KEYBOARD_PATH_1)/keymaps/drashna/rules.mk
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h
index 78dff3896..73bf32b25 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/config.h
@@ -17,6 +17,8 @@
17#pragma once 17#pragma once
18 18
19// #define USE_I2C 19// #define USE_I2C
20#define SELECT_SOFT_SERIAL_SPEED 0
21#define SERIAL_USE_MULTI_TRANSACTION
20 22
21#define EE_HANDS 23#define EE_HANDS
22#define TRACKBALL_DPI_OPTIONS \ 24#define TRACKBALL_DPI_OPTIONS \
@@ -24,5 +26,17 @@
24 26
25#define RGBLIGHT_EFFECT_TWINKLE_LIFE 50 27#define RGBLIGHT_EFFECT_TWINKLE_LIFE 50
26#define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1/63 28#define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1/63
29#define RGBLIGHT_MAX_BRIGHTNESS 100
30
31#undef DEBOUNCE
32#define DEBOUNCE 10
27 33
28#define SOLENOID_PIN F1 34#define SOLENOID_PIN F1
35#define SOLENOID_DEFAULT_DWELL 8
36
37#define OLED_DISPLAY_128X64
38#define OLED_TIMEOUT 0
39#define OLED_BRIGHTNESS 100
40#define SPLIT_MODS_ENABLE
41
42#define MK_KINETIC_SPEED
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c
index ca9733b6e..f8803edb9 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/keymap.c
@@ -17,7 +17,6 @@
17#include "drashna.h" 17#include "drashna.h"
18 18
19#define TG_DBLO TG(_DIABLO) 19#define TG_DBLO TG(_DIABLO)
20#define _MOUSE _MEDIA
21 20
22 21
23// clang-format off 22// clang-format off
@@ -172,7 +171,7 @@ void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) {
172} 171}
173 172
174void matrix_scan_keymap(void) { 173void matrix_scan_keymap(void) {
175 if (timer_elapsed(mouse_timer) > 750 && layer_state_is(_MOUSE) && !mouse_keycode_tracker) { 174 if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker) {
176 layer_off(_MOUSE); 175 layer_off(_MOUSE);
177 } 176 }
178} 177}
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/rules.mk b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/rules.mk
index 2e3e9607c..be584e8c4 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/rules.mk
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/keymaps/drashna/rules.mk
@@ -1,2 +1,9 @@
1RGBLIGHT_STARTUP_ANIMATION = yes 1RGBLIGHT_STARTUP_ANIMATION = yes
2HAPTIC_ENABLE = SOLENOID 2HAPTIC_ENABLE = SOLENOID
3COMMAND_ENABLE = no
4AUDIO_ENABLE = yes
5TAP_DANCE_ENABLE = yes
6UNICODE_ENABLE = yes
7OLED_DRIVER_ENABLE = yes
8
9# DEBOUNCE_TYPE = sym_eager_pk
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/pointer_transport.c b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/pointer_transport.c
index 003468c82..20216a21d 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/pointer_transport.c
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/pointer_transport.c
@@ -41,6 +41,10 @@ static uint16_t device_cpi = 0;
41static int8_t split_mouse_x = 0, split_mouse_y = 0; 41static int8_t split_mouse_x = 0, split_mouse_y = 0;
42#endif 42#endif
43 43
44#ifdef OLED_DRIVER_ENABLE
45# include "oled_driver.h"
46#endif
47
44#if defined(USE_I2C) 48#if defined(USE_I2C)
45 49
46# include "i2c_master.h" 50# include "i2c_master.h"
@@ -48,7 +52,16 @@ static int8_t split_mouse_x = 0, split_mouse_y = 0;
48 52
49typedef struct _I2C_slave_buffer_t { 53typedef struct _I2C_slave_buffer_t {
50 matrix_row_t smatrix[ROWS_PER_HAND]; 54 matrix_row_t smatrix[ROWS_PER_HAND];
51 uint8_t backlight_level; 55# ifdef SPLIT_MODS_ENABLE
56 uint8_t real_mods;
57 uint8_t weak_mods;
58# ifndef NO_ACTION_ONESHOT
59 uint8_t oneshot_mods;
60# endif
61# endif
62# ifdef BACKLIGHT_ENABLE
63 uint8_t backlight_level;
64# endif
52# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) 65# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
53 rgblight_syncinfo_t rgblight_sync; 66 rgblight_syncinfo_t rgblight_sync;
54# endif 67# endif
@@ -58,9 +71,12 @@ typedef struct _I2C_slave_buffer_t {
58# ifdef WPM_ENABLE 71# ifdef WPM_ENABLE
59 uint8_t current_wpm; 72 uint8_t current_wpm;
60# endif 73# endif
61 int8_t mouse_x; 74 int8_t mouse_x;
62 int8_t mouse_y; 75 int8_t mouse_y;
63 uint16_t device_cpi; 76 uint16_t device_cpi;
77 bool oled_on;
78 layer_state_t t_layer_state;
79 layer_state_t t_default_layer_state;
64} I2C_slave_buffer_t; 80} I2C_slave_buffer_t;
65 81
66static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; 82static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg;
@@ -68,11 +84,19 @@ static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_re
68# define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level) 84# define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level)
69# define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync) 85# define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync)
70# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, mmatrix) 86# define I2C_KEYMAP_START offsetof(I2C_slave_buffer_t, mmatrix)
87# define I2C_SYNC_TIME_START offsetof(I2C_slave_buffer_t, sync_timer)
88# define I2C_REAL_MODS_START offsetof(I2C_slave_buffer_t, real_mods)
89# define I2C_WEAK_MODS_START offsetof(I2C_slave_buffer_t, weak_mods)
90# define I2C_ONESHOT_MODS_START offsetof(I2C_slave_buffer_t, oneshot_mods)
71# define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state) 91# define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state)
72# define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm) 92# define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm)
73# define I2C_MOUSE_X_START offsetof(I2C_slave_buffer_t, mouse_x) 93# define I2C_MOUSE_X_START offsetof(I2C_slave_buffer_t, mouse_x)
74# define I2C_MOUSE_Y_START offsetof(I2C_slave_buffer_t, mouse_y) 94# define I2C_MOUSE_Y_START offsetof(I2C_slave_buffer_t, mouse_y)
75# define I2C_MOUSE_DPI_START offsetof(I2C_slave_buffer_t, device_cpi) 95# define I2C_MOUSE_DPI_START offsetof(I2C_slave_buffer_t, device_cpi)
96# define I2C_OLED_ON_START offsetof(I2C_slave_buffent, oled_on)
97# define I2C_LAYER_STATE_START offsetof(I2C_slave_buffent, t_layer_state)
98# define I2C_DEFAULT_LAYER_STATE_START offsetof(I2C_slave_buffent, t_default_layer_state)
99
76# define TIMEOUT 100 100# define TIMEOUT 100
77 101
78# ifndef SLAVE_I2C_ADDRESS 102# ifndef SLAVE_I2C_ADDRESS
@@ -127,13 +151,58 @@ bool transport_master(matrix_row_t matrix[]) {
127 pointing_device_set_report(temp_report); 151 pointing_device_set_report(temp_report);
128 152
129 if (device_cpi != i2c_buffer->device_cpi) { 153 if (device_cpi != i2c_buffer->device_cpi) {
130 if(i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MOUSE_DPI_START, (void *)&device_cpi, sizeof(device_cpi), TIMEOUT) >= 0) { 154 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MOUSE_DPI_START, (void *)&device_cpi, sizeof(device_cpi), TIMEOUT) >= 0) {
131 i2c_buffer->device_cpi = device_cpi 155 i2c_buffer->device_cpi = device_cpi
132 } 156 }
133 } 157 }
134 } 158 }
135# endif 159# endif
136 160
161# ifdef SPLIT_MODS_ENABLE
162 uint8_t real_mods = get_mods();
163 if (real_mods != i2c_buffer->real_mods) {
164 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_REAL_MODS_START, (void *)&real_mods, sizeof(real_mods), TIMEOUT) >= 0) {
165 i2c_buffer->real_mods = real_mods;
166 }
167 }
168
169 uint8_t weak_mods = get_weak_mods();
170 if (weak_mods != i2c_buffer->weak_mods) {
171 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_WEAK_MODS_START, (void *)&weak_mods, sizeof(weak_mods), TIMEOUT) >= 0) {
172 i2c_buffer->weak_mods = weak_mods;
173 }
174 }
175
176# ifndef NO_ACTION_ONESHOT
177 uint8_t oneshot_mods = get_oneshot_mods();
178 if (oneshot_mods != i2c_buffer->oneshot_mods) {
179 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_ONESHOT_MODS_START, (void *)&oneshot_mods, sizeof(oneshot_mods), TIMEOUT) >= 0) {
180 i2c_buffer->oneshot_mods = oneshot_mods;
181 }
182 }
183# endif
184# endif
185
186 if (layer_state != i2c_buffer->t_layer_state) {
187 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_LAYER_STATE_START, (void *)&layer_state, sizeof(layer_state), TIMEOUT) >= 0) {
188 i2c_buffer->t_layer_state = layer_state;
189 }
190 }
191
192 if (default_layer_state != i2c_buffer->t_default_layer_state) {
193 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_DEFAULT_LAYER_STATE_START, (void *)&default_layer_state, sizeof(default_layer_state), TIMEOUT) >= 0) {
194 i2c_buffer->t_default_layer_state = default_layer_state;
195 }
196 }
197
198# ifdef OLED_DRIVER_ENABLE
199 if (is_oled_on() != i2c_buffer->oled_on) {
200 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_LAYER_STATE_START, (void *)&is_oled_on(), sizeof(bool), TIMEOUT) >= 0) {
201 i2c_buffer->oled_on = is_oled_on();
202 }
203 }
204# endif
205
137 return true; 206 return true;
138} 207}
139 208
@@ -176,6 +245,29 @@ void transport_slave(matrix_row_t matrix[]) {
176 } 245 }
177 246
178# endif 247# endif
248
249# ifdef SPLIT_MODS_ENABLE
250 set_mods(i2c_buffer->real_mods);
251 set_weak_mods(i2c_buffer->weak_mods);
252# ifndef NO_ACTION_ONESHOT
253 set_oneshot_mods(i2c_buffer->oneshot_mods);
254# endif
255# endif
256
257 if (layer_state != i2c_buffer->t_layer_state) {
258 layer_state_set(i2c_buffer->t_layer_state);
259 }
260 if (default_layer_state != i2c_buffer->t_default_layer_state) {
261 default_layer_state_set(i2c_buffer->t_default_layer_state);
262 }
263
264# ifdef OLED_DRIVER_ENABLE
265 if (i2c_buffer->oled_on) {
266 oled_on();
267 } else {
268 oled_off();
269 }
270# endif
179} 271}
180 272
181void transport_master_init(void) { i2c_init(); } 273void transport_master_init(void) { i2c_init(); }
@@ -190,20 +282,33 @@ typedef struct _Serial_s2m_buffer_t {
190 // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack 282 // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack
191 matrix_row_t smatrix[ROWS_PER_HAND]; 283 matrix_row_t smatrix[ROWS_PER_HAND];
192# ifdef ENCODER_ENABLE 284# ifdef ENCODER_ENABLE
193 uint8_t encoder_state[NUMBER_OF_ENCODERS]; 285 uint8_t encoder_state[NUMBER_OF_ENCODERS];
194# endif 286# endif
195 int8_t mouse_x; 287 int8_t mouse_x;
196 int8_t mouse_y; 288 int8_t mouse_y;
197} Serial_s2m_buffer_t; 289} Serial_s2m_buffer_t;
198 290
199typedef struct _Serial_m2s_buffer_t { 291typedef struct _Serial_m2s_buffer_t {
292# ifdef SPLIT_MODS_ENABLE
293 uint8_t real_mods;
294 uint8_t weak_mods;
295# ifndef NO_ACTION_ONESHOT
296 uint8_t oneshot_mods;
297# endif
298# endif
299# ifndef DISABLE_SYNC_TIMER
300 uint32_t sync_timer;
301# endif
200# ifdef BACKLIGHT_ENABLE 302# ifdef BACKLIGHT_ENABLE
201 uint8_t backlight_level; 303 uint8_t backlight_level;
202# endif 304# endif
203# ifdef WPM_ENABLE 305# ifdef WPM_ENABLE
204 uint8_t current_wpm; 306 uint8_t current_wpm;
205# endif 307# endif
206 uint16_t device_cpi; 308 uint16_t device_cpi;
309 bool oled_on;
310 layer_state_t t_layer_state;
311 layer_state_t t_default_layer_state;
207} Serial_m2s_buffer_t; 312} Serial_m2s_buffer_t;
208 313
209# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) 314# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
@@ -308,7 +413,15 @@ bool transport_master(matrix_row_t matrix[]) {
308 413
309# ifdef WPM_ENABLE 414# ifdef WPM_ENABLE
310 // Write wpm to slave 415 // Write wpm to slave
311 serial_m2s_buffer.current_wpm = get_current_wpm(); 416 serial_m2s_buffer.current_wpm = get_current_wpm();
417# endif
418
419# ifdef SPLIT_MODS_ENABLE
420 serial_m2s_buffer.real_mods = get_mods();
421 serial_m2s_buffer.weak_mods = get_weak_mods();
422# ifndef NO_ACTION_ONESHOT
423 serial_m2s_buffer.oneshot_mods = get_oneshot_mods();
424# endif
312# endif 425# endif
313 426
314# ifdef POINTING_DEVICE_ENABLE 427# ifdef POINTING_DEVICE_ENABLE
@@ -321,6 +434,12 @@ bool transport_master(matrix_row_t matrix[]) {
321 } 434 }
322# endif 435# endif
323 436
437 serial_m2s_buffer.t_layer_state = layer_state;
438 serial_m2s_buffer.t_default_layer_state = default_layer_state;
439# ifdef OLED_DRIVER_ENABLE
440 serial_m2s_buffer.oled_on = is_oled_on();
441# endif
442
324 return true; 443 return true;
325} 444}
326 445
@@ -344,6 +463,14 @@ void transport_slave(matrix_row_t matrix[]) {
344 set_current_wpm(serial_m2s_buffer.current_wpm); 463 set_current_wpm(serial_m2s_buffer.current_wpm);
345# endif 464# endif
346 465
466# ifdef SPLIT_MODS_ENABLE
467 set_mods(serial_m2s_buffer.real_mods);
468 set_weak_mods(serial_m2s_buffer.weak_mods);
469# ifndef NO_ACTION_ONESHOT
470 set_oneshot_mods(serial_m2s_buffer.oneshot_mods);
471# endif
472# endif
473
347# ifdef POINTING_DEVICE_ENABLE 474# ifdef POINTING_DEVICE_ENABLE
348 if (!is_keyboard_left()) { 475 if (!is_keyboard_left()) {
349 static uint16_t cpi; 476 static uint16_t cpi;
@@ -354,7 +481,20 @@ void transport_slave(matrix_row_t matrix[]) {
354 serial_s2m_buffer.mouse_x = split_mouse_x; 481 serial_s2m_buffer.mouse_x = split_mouse_x;
355 serial_s2m_buffer.mouse_y = split_mouse_y; 482 serial_s2m_buffer.mouse_y = split_mouse_y;
356 } 483 }
484# endif
357 485
486 if (layer_state != serial_m2s_buffer.t_layer_state) {
487 layer_state_set(serial_m2s_buffer.t_layer_state);
488 }
489 if (default_layer_state != serial_m2s_buffer.t_default_layer_state) {
490 default_layer_set(serial_m2s_buffer.t_default_layer_state);
491 }
492# ifdef OLED_DRIVER_ENABLE
493 if (serial_m2s_buffer.oled_on) {
494 oled_on();
495 } else {
496 oled_off();
497 }
358# endif 498# endif
359} 499}
360 500
diff --git a/keyboards/kyria/keymaps/drashna/config.h b/keyboards/kyria/keymaps/drashna/config.h
index 1af947e73..d5fcf9088 100644
--- a/keyboards/kyria/keymaps/drashna/config.h
+++ b/keyboards/kyria/keymaps/drashna/config.h
@@ -35,8 +35,4 @@
35# define RGBLIGHT_LAYERS 35# define RGBLIGHT_LAYERS
36#endif 36#endif
37 37
38// If you are using an Elite C rev3 on the slave side, uncomment the lines below:
39#define SPLIT_USB_DETECT
40#define SPLIT_USB_TIMEOUT 1000
41
42#define KEYLOGGER_LENGTH 10 38#define KEYLOGGER_LENGTH 10
diff --git a/keyboards/kyria/keymaps/drashna/rules.mk b/keyboards/kyria/keymaps/drashna/rules.mk
index e11a11483..756c044fa 100644
--- a/keyboards/kyria/keymaps/drashna/rules.mk
+++ b/keyboards/kyria/keymaps/drashna/rules.mk
@@ -18,6 +18,6 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
18 18
19BOOTLOADER = atmel-dfu 19BOOTLOADER = atmel-dfu
20 20
21SPLIT_TRANSPORT = mirror 21# SPLIT_TRANSPORT = mirror
22 22
23TAP_DANCE_ENABLE = yes 23# TAP_DANCE_ENABLE = yes
diff --git a/keyboards/moonlander/keymaps/drashna/keymap.c b/keyboards/moonlander/keymaps/drashna/keymap.c
index 7daa5248f..a12be12ea 100644
--- a/keyboards/moonlander/keymaps/drashna/keymap.c
+++ b/keyboards/moonlander/keymaps/drashna/keymap.c
@@ -196,14 +196,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
196} 196}
197 197
198#ifdef RGB_MATRIX_ENABLE 198#ifdef RGB_MATRIX_ENABLE
199# ifndef RGB_MATRIX_INDICATOR_SET_COLOR
200# define RGB_MATRIX_INDICATOR_SET_COLOR(i, r, g, b) rgb_matrix_set_color(i, r, g, b)
201void rgb_matrix_indicators_user(void) {
202 #else
203void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { 199void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
204# endif
205 if (g_suspend_state || !rgb_matrix_config.enable) return;
206
207 if (layer_state_is(_GAMEPAD)) { 200 if (layer_state_is(_GAMEPAD)) {
208 RGB_MATRIX_INDICATOR_SET_COLOR(11, 0x00, 0xFF, 0x00); // Q 201 RGB_MATRIX_INDICATOR_SET_COLOR(11, 0x00, 0xFF, 0x00); // Q
209 RGB_MATRIX_INDICATOR_SET_COLOR(16, 0x00, 0xFF, 0xFF); // W 202 RGB_MATRIX_INDICATOR_SET_COLOR(16, 0x00, 0xFF, 0xFF); // W
@@ -214,51 +207,51 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
214 RGB_MATRIX_INDICATOR_SET_COLOR(22, 0x00, 0xFF, 0xFF); // D 207 RGB_MATRIX_INDICATOR_SET_COLOR(22, 0x00, 0xFF, 0xFF); // D
215 RGB_MATRIX_INDICATOR_SET_COLOR(27, 0x7A, 0x00, 0xFF); // F 208 RGB_MATRIX_INDICATOR_SET_COLOR(27, 0x7A, 0x00, 0xFF); // F
216 209
217 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 10 : 15), 0xFF, 0xFF, 0xFF); // 1 210 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 15 : 10), 0xFF, 0xFF, 0xFF); // 1
218 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 15 : 10), 0x00, 0xFF, 0x00); // 2 211 RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 10 : 15), 0x00, 0xFF, 0x00); // 2
219 RGB_MATRIX_INDICATOR_SET_COLOR(20, 0x7A, 0x00, 0xFF); // 3 212 RGB_MATRIX_INDICATOR_SET_COLOR(20, 0x7A, 0x00, 0xFF); // 3
220 } 213 }
221 214
222 if (userspace_config.rgb_layer_change) { 215 if (userspace_config.rgb_layer_change) {
223 switch (get_highest_layer(layer_state|default_layer_state)) { 216 switch (get_highest_layer(layer_state|default_layer_state)) {
224 case _QWERTY: 217 case _QWERTY:
225 rgb_matrix_layer_helper(HSV_CYAN, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 218 rgb_matrix_layer_helper(HSV_CYAN, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
226 break; 219 break;
227 case _COLEMAK: 220 case _COLEMAK:
228 rgb_matrix_layer_helper(HSV_MAGENTA, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 221 rgb_matrix_layer_helper(HSV_MAGENTA, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
229 break; 222 break;
230 case _DVORAK: 223 case _DVORAK:
231 rgb_matrix_layer_helper(HSV_SPRINGGREEN, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 224 rgb_matrix_layer_helper(HSV_SPRINGGREEN, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
232 break; 225 break;
233 case _WORKMAN: 226 case _WORKMAN:
234 rgb_matrix_layer_helper(HSV_GOLDENROD, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 227 rgb_matrix_layer_helper(HSV_GOLDENROD, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
235 break; 228 break;
236 case _NORMAN: 229 case _NORMAN:
237 rgb_matrix_layer_helper(HSV_CORAL, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 230 rgb_matrix_layer_helper(HSV_CORAL, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
238 break; 231 break;
239 case _MALTRON: 232 case _MALTRON:
240 rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 233 rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
241 break; 234 break;
242 case _EUCALYN: 235 case _EUCALYN:
243 rgb_matrix_layer_helper(HSV_PINK, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 236 rgb_matrix_layer_helper(HSV_PINK, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
244 break; 237 break;
245 case _CARPLAX: 238 case _CARPLAX:
246 rgb_matrix_layer_helper(HSV_BLUE, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 239 rgb_matrix_layer_helper(HSV_BLUE, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
247 break; 240 break;
248 case _GAMEPAD: 241 case _GAMEPAD:
249 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 242 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
250 break; 243 break;
251 case _DIABLO: 244 case _DIABLO:
252 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER); 245 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max);
253 break; 246 break;
254 case _RAISE: 247 case _RAISE:
255 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 248 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
256 break; 249 break;
257 case _LOWER: 250 case _LOWER:
258 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 251 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
259 break; 252 break;
260 case _ADJUST: 253 case _ADJUST:
261 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); 254 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
262 break; 255 break;
263 } 256 }
264 } 257 }
diff --git a/keyboards/ploopyco/mouse/keymaps/drashna/config.h b/keyboards/ploopyco/mouse/keymaps/drashna/config.h
new file mode 100644
index 000000000..5bc704fec
--- /dev/null
+++ b/keyboards/ploopyco/mouse/keymaps/drashna/config.h
@@ -0,0 +1,24 @@
1/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
2 * Copyright 2019 Sunjun Kim
3 * Copyright 2020 Ploopy Corporation
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#undef RGBLIGHT_LIMIT_VAL
22#define RGBLIGHT_LIMIT_VAL 255
23#define RGBLIGHT_ANIMATIONS
24#define RGBLIGHT_SLEEP
diff --git a/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c b/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c
new file mode 100644
index 000000000..68b846f7b
--- /dev/null
+++ b/keyboards/ploopyco/mouse/keymaps/drashna/keymap.c
@@ -0,0 +1,34 @@
1/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
2 * Copyright 2019 Sunjun Kim
3 * Copyright 2020 Ploopy Corporation
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#include QMK_KEYBOARD_H
19
20// safe range starts at `PLOOPY_SAFE_RANGE` instead.
21
22const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23 [0] = LAYOUT(/* Base */
24 C(KC_C), KC_BTN1, KC_BTN3, KC_BTN2, MO(1), KC_BTN4, KC_BTN5, DPI_CONFIG),
25 [1] = LAYOUT(/* Base */
26 RGB_HUI, RGB_MOD, RGB_TOG, RGB_RMOD, MO(1), KC_VOLU, KC_VOLD, RESET)
27
28};
29
30void eeconkfig_init_user(void) {
31 rgblight_enable();
32 rgblight_mode(RGBLIGHT_MODE_TWINKLE+5);
33 rgblight_sethsv(HSV_MAGENTA);
34}
diff --git a/keyboards/ploopyco/mouse/keymaps/drashna/rules.mk b/keyboards/ploopyco/mouse/keymaps/drashna/rules.mk
new file mode 100644
index 000000000..4e7eebe34
--- /dev/null
+++ b/keyboards/ploopyco/mouse/keymaps/drashna/rules.mk
@@ -0,0 +1,4 @@
1USER_NAME := not_drashna
2
3RGBLIGHT_ENABLE = yes
4CONSOLE_ENABLE = no