diff options
36 files changed, 588 insertions, 270 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 | ||
145 | static bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) { | 145 | static 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 | |||
27 | const 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 @@ | |||
1 | USER_NAME := drashna | ||
2 | SRC += ../drashna/keymap.c | ||
3 | |||
4 | include $(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 | ||
174 | void matrix_scan_keymap(void) { | 173 | void 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 @@ | |||
1 | RGBLIGHT_STARTUP_ANIMATION = yes | 1 | RGBLIGHT_STARTUP_ANIMATION = yes |
2 | HAPTIC_ENABLE = SOLENOID | 2 | HAPTIC_ENABLE = SOLENOID |
3 | COMMAND_ENABLE = no | ||
4 | AUDIO_ENABLE = yes | ||
5 | TAP_DANCE_ENABLE = yes | ||
6 | UNICODE_ENABLE = yes | ||
7 | OLED_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; | |||
41 | static int8_t split_mouse_x = 0, split_mouse_y = 0; | 41 | static 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 | ||
49 | typedef struct _I2C_slave_buffer_t { | 53 | typedef 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 | ||
66 | static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg; | 82 | static 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 | ||
181 | void transport_master_init(void) { i2c_init(); } | 273 | void 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 | ||
199 | typedef struct _Serial_m2s_buffer_t { | 291 | typedef 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 | ||
19 | BOOTLOADER = atmel-dfu | 19 | BOOTLOADER = atmel-dfu |
20 | 20 | ||
21 | SPLIT_TRANSPORT = mirror | 21 | # SPLIT_TRANSPORT = mirror |
22 | 22 | ||
23 | TAP_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) | ||
201 | void rgb_matrix_indicators_user(void) { | ||
202 | #else | ||
203 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | 199 | void 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 | |||
22 | const 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 | |||
30 | void 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 @@ | |||
1 | USER_NAME := not_drashna | ||
2 | |||
3 | RGBLIGHT_ENABLE = yes | ||
4 | CONSOLE_ENABLE = no | ||
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index a595a93c4..4ccba8f04 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h | |||
@@ -42,7 +42,6 @@ | |||
42 | # undef RGB_MATRIX_LED_FLUSH_LIMIT | 42 | # undef RGB_MATRIX_LED_FLUSH_LIMIT |
43 | # if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) | 43 | # if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) |
44 | # define RGBLIGHT_LIMIT_VAL 100 | 44 | # define RGBLIGHT_LIMIT_VAL 100 |
45 | # undef RGBLIGHT_SLEEP | ||
46 | # endif | 45 | # endif |
47 | #endif | 46 | #endif |
48 | 47 | ||
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 5f1c0c8a0..fb5bcc6bd 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
@@ -446,70 +446,65 @@ void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } | |||
446 | 446 | ||
447 | void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } | 447 | void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } |
448 | 448 | ||
449 | void rgb_matrix_indicators_user(void) { | 449 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { |
450 | if (g_suspend_state || !rgb_matrix_config.enable) return; | ||
451 | 450 | ||
452 | if (layer_state_is(_GAMEPAD)) { | 451 | if (layer_state_is(_GAMEPAD)) { |
453 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q | 452 | RGB_MATRIX_INDICATOR_SET_COLOR(32, 0x00, 0xFF, 0x00); // Q |
454 | rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W | 453 | RGB_MATRIX_INDICATOR_SET_COLOR(31, 0x00, 0xFF, 0xFF); // W |
455 | rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E | 454 | RGB_MATRIX_INDICATOR_SET_COLOR(30, 0xFF, 0x00, 0x00); // E |
456 | rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R | 455 | RGB_MATRIX_INDICATOR_SET_COLOR(29, 0xFF, 0x80, 0x00); // R |
457 | rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A | 456 | RGB_MATRIX_INDICATOR_SET_COLOR(37, 0x00, 0xFF, 0xFF); // A |
458 | rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S | 457 | RGB_MATRIX_INDICATOR_SET_COLOR(36, 0x00, 0xFF, 0xFF); // S |
459 | rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D | 458 | RGB_MATRIX_INDICATOR_SET_COLOR(35, 0x00, 0xFF, 0xFF); // D |
460 | rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F | 459 | RGB_MATRIX_INDICATOR_SET_COLOR(34, 0x7A, 0x00, 0xFF); // F |
461 | 460 | ||
462 | rgb_matrix_set_color(userspace_config.swapped_numbers ? 27 : 26, 0xFF, 0xFF, 0xFF); // 1 | 461 | RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 26 : 27), 0xFF, 0xFF, 0xFF); // 1 |
463 | rgb_matrix_set_color(userspace_config.swapped_numbers ? 26 : 27, 0x00, 0xFF, 0x00); // 2 | 462 | RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 27 : 26), 0x00, 0xFF, 0x00); // 2 |
464 | rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 | 463 | RGB_MATRIX_INDICATOR_SET_COLOR(25, 0x7A, 0x00, 0xFF); // 3 |
465 | } | 464 | } |
466 | 465 | ||
467 | # if defined(RGBLIGHT_ENABLE) | 466 | |
468 | if (!userspace_config.rgb_layer_change) | 467 | if (userspace_config.rgb_layer_change) { |
469 | # else | ||
470 | if (userspace_config.rgb_layer_change) | ||
471 | # endif | ||
472 | { | ||
473 | bool mods_enabled = IS_LAYER_ON(_MODS); | 468 | bool mods_enabled = IS_LAYER_ON(_MODS); |
474 | switch (get_highest_layer(layer_state|default_layer_state)) { | 469 | switch (get_highest_layer(layer_state|default_layer_state)) { |
475 | case _GAMEPAD: | 470 | case _GAMEPAD: |
476 | rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 471 | rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
477 | break; | 472 | break; |
478 | case _DIABLO: | 473 | case _DIABLO: |
479 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER); | 474 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max); |
480 | break; | 475 | break; |
481 | case _RAISE: | 476 | case _RAISE: |
482 | rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 477 | rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
483 | break; | 478 | break; |
484 | case _LOWER: | 479 | case _LOWER: |
485 | rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 480 | rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
486 | break; | 481 | break; |
487 | case _ADJUST: | 482 | case _ADJUST: |
488 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 483 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
489 | break; | 484 | break; |
490 | case _QWERTY: | 485 | case _QWERTY: |
491 | rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 486 | rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
492 | break; | 487 | break; |
493 | case _COLEMAK: | 488 | case _COLEMAK: |
494 | rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 489 | rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
495 | break; | 490 | break; |
496 | case _DVORAK: | 491 | case _DVORAK: |
497 | rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 492 | rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
498 | break; | 493 | break; |
499 | case _WORKMAN: | 494 | case _WORKMAN: |
500 | rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 495 | rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
501 | break; | 496 | break; |
502 | case _NORMAN: | 497 | case _NORMAN: |
503 | rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 498 | rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
504 | break; | 499 | break; |
505 | case _MALTRON: | 500 | case _MALTRON: |
506 | rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 501 | rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
507 | break; | 502 | break; |
508 | case _EUCALYN: | 503 | case _EUCALYN: |
509 | rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 504 | rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
510 | break; | 505 | break; |
511 | case _CARPLAX: | 506 | case _CARPLAX: |
512 | rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 507 | rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
513 | break; | 508 | break; |
514 | } | 509 | } |
515 | } | 510 | } |
@@ -517,6 +512,7 @@ void rgb_matrix_indicators_user(void) { | |||
517 | 512 | ||
518 | #endif // RGB_MATRIX_INIT | 513 | #endif // RGB_MATRIX_INIT |
519 | 514 | ||
515 | #ifdef TAPPING_TERM_PER_KEY | ||
520 | uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { | 516 | uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { |
521 | if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { | 517 | if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { |
522 | if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { | 518 | if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { |
@@ -525,3 +521,4 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { | |||
525 | } | 521 | } |
526 | return TAPPING_TERM; | 522 | return TAPPING_TERM; |
527 | } | 523 | } |
524 | #endif | ||
diff --git a/layouts/community/ergodox/drashna/visualizer.c b/layouts/community/ergodox/drashna/visualizer.c new file mode 100644 index 000000000..6b1c3ff49 --- /dev/null +++ b/layouts/community/ergodox/drashna/visualizer.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | Copyright 2017 Fred Sundvik | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #include "./simple_visualizer.h" | ||
19 | #include "util.h" | ||
20 | #include "drashna.h" | ||
21 | #include "rgblight_list.h" | ||
22 | |||
23 | #define LCD_COLOR_wrapper(...) LCD_COLOR(__VA_ARGS__) | ||
24 | // This function should be implemented by the keymap visualizer | ||
25 | // Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing | ||
26 | // that the simple_visualizer assumes that you are updating | ||
27 | // Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is | ||
28 | // stopped. This can be done by either double buffering it or by using constant strings | ||
29 | static void get_visualizer_layer_and_color(visualizer_state_t* state) { | ||
30 | |||
31 | switch(get_highest_layer(state->status.layer|default_layer_state)) { | ||
32 | case _LOWER: | ||
33 | state->layer_text = "Lower"; | ||
34 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_GREEN); | ||
35 | break; | ||
36 | case _RAISE: | ||
37 | state->layer_text = "Raise"; | ||
38 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_YELLOW); | ||
39 | break; | ||
40 | case _ADJUST: | ||
41 | state->layer_text = "Adjust"; | ||
42 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); | ||
43 | break; | ||
44 | case _MACROS: | ||
45 | state->layer_text = "Macros"; | ||
46 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); | ||
47 | break; | ||
48 | case _MEDIA: | ||
49 | state->layer_text = "Media"; | ||
50 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_CHARTREUSE); | ||
51 | break; | ||
52 | case _GAMEPAD: | ||
53 | state->layer_text = "Game"; | ||
54 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); | ||
55 | break; | ||
56 | case _QWERTY: | ||
57 | state->layer_text = "QWERTY"; | ||
58 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_CYAN); | ||
59 | break; | ||
60 | case _WORKMAN: | ||
61 | state->layer_text = "Workman"; | ||
62 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_GOLDENROD); | ||
63 | break; | ||
64 | case _DVORAK: | ||
65 | state->layer_text = "Dvorak"; | ||
66 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_SPRINGGREEN); | ||
67 | break; | ||
68 | case _COLEMAK: | ||
69 | state->layer_text = "Colemak"; | ||
70 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_MAGENTA); | ||
71 | break; break; | ||
72 | default: | ||
73 | state->layer_text = "NONE"; | ||
74 | state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); | ||
75 | break; | ||
76 | } | ||
77 | } | ||
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 6a99fcda0..4a1d1babe 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h | |||
@@ -77,6 +77,8 @@ | |||
77 | # define PRODUCT Drashna Hacked Planck EZ | 77 | # define PRODUCT Drashna Hacked Planck EZ |
78 | # endif | 78 | # endif |
79 | #endif | 79 | #endif |
80 | #undef NO_USB_STARTUP_CHECK | ||
81 | |||
80 | 82 | ||
81 | #define EEPROM_I2C_RM24C512C | 83 | #define EEPROM_I2C_RM24C512C |
82 | 84 | ||
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 8070a7d35..d0df7f5c3 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c | |||
@@ -16,9 +16,6 @@ | |||
16 | 16 | ||
17 | #include "drashna.h" | 17 | #include "drashna.h" |
18 | 18 | ||
19 | #ifdef RGBLIGHT_ENABLE | ||
20 | extern rgblight_config_t rgblight_config; | ||
21 | #endif | ||
22 | 19 | ||
23 | #ifdef BACKLIGHT_ENABLE | 20 | #ifdef BACKLIGHT_ENABLE |
24 | enum planck_keycodes { | 21 | enum planck_keycodes { |
@@ -231,7 +228,8 @@ void suspend_wakeup_init_keymap(void) { | |||
231 | } | 228 | } |
232 | // clang-format on | 229 | // clang-format on |
233 | 230 | ||
234 | void rgb_matrix_indicators_user(void) { | 231 | |
232 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | ||
235 | uint8_t this_mod = get_mods(); | 233 | uint8_t this_mod = get_mods(); |
236 | uint8_t this_led = host_keyboard_leds(); | 234 | uint8_t this_led = host_keyboard_leds(); |
237 | uint8_t this_osm = get_oneshot_mods(); | 235 | uint8_t this_osm = get_oneshot_mods(); |
@@ -240,8 +238,6 @@ void rgb_matrix_indicators_user(void) { | |||
240 | is_ez = true; | 238 | is_ez = true; |
241 | # endif | 239 | # endif |
242 | 240 | ||
243 | if (g_suspend_state || !rgb_matrix_config.enable) return; | ||
244 | |||
245 | # if defined(RGBLIGHT_ENABLE) | 241 | # if defined(RGBLIGHT_ENABLE) |
246 | if (!userspace_config.rgb_layer_change) | 242 | if (!userspace_config.rgb_layer_change) |
247 | # else | 243 | # else |
@@ -250,46 +246,46 @@ void rgb_matrix_indicators_user(void) { | |||
250 | { | 246 | { |
251 | switch (get_highest_layer(layer_state)) { | 247 | switch (get_highest_layer(layer_state)) { |
252 | case _GAMEPAD: | 248 | case _GAMEPAD: |
253 | rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 249 | rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
254 | break; | 250 | break; |
255 | case _DIABLO: | 251 | case _DIABLO: |
256 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER); | 252 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max); |
257 | break; | 253 | break; |
258 | case _RAISE: | 254 | case _RAISE: |
259 | rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 255 | rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
260 | break; | 256 | break; |
261 | case _LOWER: | 257 | case _LOWER: |
262 | rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 258 | rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
263 | break; | 259 | break; |
264 | case _ADJUST: | 260 | case _ADJUST: |
265 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 261 | rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
266 | break; | 262 | break; |
267 | default: { | 263 | default: { |
268 | bool mods_enabled = IS_LAYER_ON(_MODS); | 264 | bool mods_enabled = IS_LAYER_ON(_MODS); |
269 | switch (get_highest_layer(default_layer_state)) { | 265 | switch (get_highest_layer(default_layer_state)) { |
270 | case _QWERTY: | 266 | case _QWERTY: |
271 | rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 267 | rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
272 | break; | 268 | break; |
273 | case _COLEMAK: | 269 | case _COLEMAK: |
274 | rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 270 | rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
275 | break; | 271 | break; |
276 | case _DVORAK: | 272 | case _DVORAK: |
277 | rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 273 | rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
278 | break; | 274 | break; |
279 | case _WORKMAN: | 275 | case _WORKMAN: |
280 | rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 276 | rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
281 | break; | 277 | break; |
282 | case _NORMAN: | 278 | case _NORMAN: |
283 | rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 279 | rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
284 | break; | 280 | break; |
285 | case _MALTRON: | 281 | case _MALTRON: |
286 | rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 282 | rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
287 | break; | 283 | break; |
288 | case _EUCALYN: | 284 | case _EUCALYN: |
289 | rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 285 | rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
290 | break; | 286 | break; |
291 | case _CARPLAX: | 287 | case _CARPLAX: |
292 | rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 288 | rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); |
293 | break; | 289 | break; |
294 | } | 290 | } |
295 | break; | 291 | break; |
@@ -299,35 +295,35 @@ void rgb_matrix_indicators_user(void) { | |||
299 | 295 | ||
300 | switch (get_highest_layer(default_layer_state)) { | 296 | switch (get_highest_layer(default_layer_state)) { |
301 | case _QWERTY: | 297 | case _QWERTY: |
302 | rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); | 298 | RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0x00, 0xFF, 0xFF); |
303 | break; | 299 | break; |
304 | case _COLEMAK: | 300 | case _COLEMAK: |
305 | rgb_matrix_set_color(is_ez ? 41 : 42, 0xFF, 0x00, 0xFF); | 301 | RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0xFF, 0x00, 0xFF); |
306 | break; | 302 | break; |
307 | case _DVORAK: | 303 | case _DVORAK: |
308 | rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0x00); | 304 | RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0x00, 0xFF, 0x00); |
309 | break; | 305 | break; |
310 | case _WORKMAN: | 306 | case _WORKMAN: |
311 | rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21); | 307 | RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0xD9, 0xA5, 0x21); |
312 | break; | 308 | break; |
313 | } | 309 | } |
314 | 310 | ||
315 | if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { | 311 | if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { |
316 | if (!layer_state_cmp(layer_state, _ADJUST)) { | 312 | if (!layer_state_cmp(layer_state, _ADJUST)) { |
317 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | 313 | RGB_MATRIX_INDICATOR_SET_COLOR(24, 0x00, 0xFF, 0x00); |
318 | } | 314 | } |
319 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | 315 | RGB_MATRIX_INDICATOR_SET_COLOR(36, 0x00, 0xFF, 0x00); |
320 | } | 316 | } |
321 | if ((this_mod | this_osm) & MOD_MASK_CTRL) { | 317 | if ((this_mod | this_osm) & MOD_MASK_CTRL) { |
322 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | 318 | RGB_MATRIX_INDICATOR_SET_COLOR(25, 0xFF, 0x00, 0x00); |
323 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | 319 | RGB_MATRIX_INDICATOR_SET_COLOR(34, 0xFF, 0x00, 0x00); |
324 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | 320 | RGB_MATRIX_INDICATOR_SET_COLOR(37, 0xFF, 0x00, 0x00); |
325 | } | 321 | } |
326 | if ((this_mod | this_osm) & MOD_MASK_GUI) { | 322 | if ((this_mod | this_osm) & MOD_MASK_GUI) { |
327 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | 323 | RGB_MATRIX_INDICATOR_SET_COLOR(39, 0xFF, 0xD9, 0x00); |
328 | } | 324 | } |
329 | if ((this_mod | this_osm) & MOD_MASK_ALT) { | 325 | if ((this_mod | this_osm) & MOD_MASK_ALT) { |
330 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | 326 | RGB_MATRIX_INDICATOR_SET_COLOR(38, 0x00, 0x00, 0xFF); |
331 | } | 327 | } |
332 | } | 328 | } |
333 | 329 | ||
diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h index 7db51fb6e..b9b1d073d 100644 --- a/layouts/community/split_3x6_3/drashna/config.h +++ b/layouts/community/split_3x6_3/drashna/config.h | |||
@@ -19,14 +19,11 @@ | |||
19 | /* Select hand configuration */ | 19 | /* Select hand configuration */ |
20 | 20 | ||
21 | // #define MASTER_LEFT | 21 | // #define MASTER_LEFT |
22 | // #define MASTER_RIGHT | 22 | #define MASTER_RIGHT |
23 | #define EE_HANDS | 23 | // #define EE_HAND |
24 | |||
25 | #undef USE_I2C | 24 | #undef USE_I2C |
26 | #undef SSD1306OLED | 25 | #undef SSD1306OLED |
27 | 26 | ||
28 | #define USE_SERIAL_PD2 | ||
29 | |||
30 | // #define TAPPING_FORCE_HOLD | 27 | // #define TAPPING_FORCE_HOLD |
31 | // #define TAPPING_TERM 100 | 28 | // #define TAPPING_TERM 100 |
32 | 29 | ||
@@ -41,6 +38,10 @@ | |||
41 | #endif | 38 | #endif |
42 | 39 | ||
43 | #ifdef RGB_MATRIX_ENABLE | 40 | #ifdef RGB_MATRIX_ENABLE |
41 | # ifdef CONVERT_TO_PROTON_C | ||
42 | # undef RGB_DI_PIN | ||
43 | # define RGB_DI_PIN PAL_LINE(GPIOA, 3) | ||
44 | # endif | ||
44 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses | 45 | # define RGB_MATRIX_KEYPRESSES // reacts to keypresses |
45 | // # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) | 46 | // # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) |
46 | // # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | 47 | // # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects |
@@ -54,6 +55,24 @@ | |||
54 | # define RGB_MATRIX_SPD_STEP 10 | 55 | # define RGB_MATRIX_SPD_STEP 10 |
55 | #endif | 56 | #endif |
56 | 57 | ||
58 | #ifdef CONVERT_TO_PROTON_C | ||
59 | # define WS2812_PWM_DRIVER PWMD15 // default: PWMD2 | ||
60 | # define WS2812_PWM_CHANNEL 2 // default: 2 | ||
61 | # define WS2812_PWM_PAL_MODE 9 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 | ||
62 | # define WS2812_DMA_STREAM STM32_DMA1_STREAM5 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. | ||
63 | # define WS2812_DMA_CHANNEL 5 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. | ||
64 | # define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM15_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. | ||
65 | |||
66 | # undef SOFT_SERIAL_PIN | ||
67 | # define SOFT_SERIAL_PIN D3 | ||
68 | # define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 | ||
69 | # define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 | ||
70 | |||
71 | |||
72 | // #define INIT_EE_HANDS_LEFT | ||
73 | // #define INIT_EE_HANDS_RIGHT | ||
74 | #endif | ||
75 | |||
57 | #ifdef AUDIO_ENABLE | 76 | #ifdef AUDIO_ENABLE |
58 | # define B6_AUDIO | 77 | # define B6_AUDIO |
59 | # define NO_MUSIC_MODE | 78 | # define NO_MUSIC_MODE |
@@ -64,8 +83,11 @@ | |||
64 | #endif | 83 | #endif |
65 | 84 | ||
66 | #undef PRODUCT | 85 | #undef PRODUCT |
67 | #define PRODUCT Drashna Hacked Corne Keyboard | 86 | #ifdef CONVERT_TO_PROTON_C |
68 | 87 | # define PRODUCT Drashna Hacked ARM Corne Keyboard | |
88 | #else | ||
89 | # define PRODUCT Drashna Hacked Corne Keyboard | ||
90 | #endif | ||
69 | #define OLED_FONT_H "layouts/community/split_3x6_3/drashna/glcdfont.c" | 91 | #define OLED_FONT_H "layouts/community/split_3x6_3/drashna/glcdfont.c" |
70 | // #define OLED_FONT_WIDTH 5 | 92 | // #define OLED_FONT_WIDTH 5 |
71 | // #define OLED_FONT_HEIGHT 7 | 93 | // #define OLED_FONT_HEIGHT 7 |
diff --git a/layouts/community/split_3x6_3/drashna/halconf.h b/layouts/community/split_3x6_3/drashna/halconf.h new file mode 100644 index 000000000..b099320b3 --- /dev/null +++ b/layouts/community/split_3x6_3/drashna/halconf.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* Copyright 2020 Nick Brassel (tzarc) | ||
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 3 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 <https://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #pragma once | ||
17 | |||
18 | // #define HAL_USE_DAC TRUE | ||
19 | #define HAL_USE_PWM TRUE | ||
20 | #define HAL_USE_SERIAL TRUE | ||
21 | |||
22 | #include_next <halconf.h> | ||
diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c index e53d05397..513cc7f7d 100644 --- a/layouts/community/split_3x6_3/drashna/keymap.c +++ b/layouts/community/split_3x6_3/drashna/keymap.c | |||
@@ -16,11 +16,6 @@ | |||
16 | 16 | ||
17 | #include "drashna.h" | 17 | #include "drashna.h" |
18 | 18 | ||
19 | #ifdef RGBLIGHT_ENABLE | ||
20 | // Following line allows macro to read current RGB settings | ||
21 | extern rgblight_config_t rgblight_config; | ||
22 | #endif | ||
23 | |||
24 | enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; | 19 | enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; |
25 | 20 | ||
26 | /* | 21 | /* |
@@ -31,6 +26,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; | |||
31 | * of use. K## is a placeholder to pass through the individual keycodes | 26 | * of use. K## is a placeholder to pass through the individual keycodes |
32 | */ | 27 | */ |
33 | 28 | ||
29 | // clang-format off | ||
34 | #define LAYOUT_split_3x6_3_base( \ | 30 | #define LAYOUT_split_3x6_3_base( \ |
35 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 31 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
36 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ | 32 | K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ |
@@ -40,7 +36,7 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; | |||
40 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ | 36 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ |
41 | ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ | 37 | ALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ |
42 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ | 38 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ |
43 | KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ | 39 | RGB_MOD, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \ |
44 | ) | 40 | ) |
45 | #define LAYOUT_split_3x6_3_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__) | 41 | #define LAYOUT_split_3x6_3_base_wrapper(...) LAYOUT_split_3x6_3_base(__VA_ARGS__) |
46 | 42 | ||
@@ -123,31 +119,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
123 | }; | 119 | }; |
124 | // clang-format on | 120 | // clang-format on |
125 | 121 | ||
126 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
127 | if (record->event.pressed) { | ||
128 | #ifndef SPLIT_KEYBOARD | ||
129 | if (keycode == RESET && !is_master) { | ||
130 | return false; | ||
131 | } | ||
132 | #endif | ||
133 | } | ||
134 | return true; | ||
135 | } | ||
136 | |||
137 | #ifdef OLED_DRIVER_ENABLE | 122 | #ifdef OLED_DRIVER_ENABLE |
138 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | 123 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { |
139 | # ifndef SPLIT_KEYBOARD | 124 | if (is_keyboard_master()) { |
140 | if (is_master) { | ||
141 | # endif | ||
142 | return OLED_ROTATION_270; | 125 | return OLED_ROTATION_270; |
143 | # ifndef SPLIT_KEYBOARD | 126 | } else { |
144 | } else { | ||
145 | return rotation; | 127 | return rotation; |
146 | } | 128 | } |
147 | # endif | ||
148 | } | 129 | } |
149 | #endif | 130 | #endif |
150 | 131 | ||
132 | #ifdef TAPPING_TERM_PER_KEY | ||
151 | uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { | 133 | uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { |
152 | switch (keycode) { | 134 | switch (keycode) { |
153 | case ALT_T(KC_A): | 135 | case ALT_T(KC_A): |
@@ -156,75 +138,74 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { | |||
156 | return TAPPING_TERM; | 138 | return TAPPING_TERM; |
157 | } | 139 | } |
158 | } | 140 | } |
141 | #endif | ||
142 | |||
159 | 143 | ||
144 | void matrix_slave_scan_user(void) { | ||
160 | #ifdef RGB_MATRIX_ENABLE | 145 | #ifdef RGB_MATRIX_ENABLE |
146 | rgb_matrix_task(); | ||
147 | #endif | ||
148 | } | ||
161 | 149 | ||
150 | #ifdef RGB_MATRIX_ENABLE | ||
162 | void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } | 151 | void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); } |
163 | 152 | ||
164 | void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } | 153 | void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } |
165 | 154 | ||
166 | void check_default_layer(uint8_t mode, uint8_t type) { | 155 | void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t led_max) { |
167 | switch (get_highest_layer(default_layer_state)) { | 156 | switch (get_highest_layer(default_layer_state)) { |
168 | case _QWERTY: | 157 | case _QWERTY: |
169 | rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type); | 158 | rgb_matrix_layer_helper(HSV_CYAN, mode, rgb_matrix_config.speed, type, led_min, led_max); |
170 | break; | 159 | break; |
171 | case _COLEMAK: | 160 | case _COLEMAK: |
172 | rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type); | 161 | rgb_matrix_layer_helper(HSV_MAGENTA, mode, rgb_matrix_config.speed, type, led_min, led_max); |
173 | break; | 162 | break; |
174 | case _DVORAK: | 163 | case _DVORAK: |
175 | rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type); | 164 | rgb_matrix_layer_helper(HSV_SPRINGGREEN, mode, rgb_matrix_config.speed, type, led_min, led_max); |
176 | break; | 165 | break; |
177 | case _WORKMAN: | 166 | case _WORKMAN: |
178 | rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type); | 167 | rgb_matrix_layer_helper(HSV_GOLDENROD, mode, rgb_matrix_config.speed, type, led_min, led_max); |
179 | break; | 168 | break; |
180 | case _NORMAN: | 169 | case _NORMAN: |
181 | rgb_matrix_layer_helper(HSV_CORAL, mode, rgb_matrix_config.speed, type); | 170 | rgb_matrix_layer_helper(HSV_CORAL, mode, rgb_matrix_config.speed, type, led_min, led_max); |
182 | break; | 171 | break; |
183 | case _MALTRON: | 172 | case _MALTRON: |
184 | rgb_matrix_layer_helper(HSV_YELLOW, mode, rgb_matrix_config.speed, type); | 173 | rgb_matrix_layer_helper(HSV_YELLOW, mode, rgb_matrix_config.speed, type, led_min, led_max); |
185 | break; | 174 | break; |
186 | case _EUCALYN: | 175 | case _EUCALYN: |
187 | rgb_matrix_layer_helper(HSV_PINK, mode, rgb_matrix_config.speed, type); | 176 | rgb_matrix_layer_helper(HSV_PINK, mode, rgb_matrix_config.speed, type, led_min, led_max); |
188 | break; | 177 | break; |
189 | case _CARPLAX: | 178 | case _CARPLAX: |
190 | rgb_matrix_layer_helper(HSV_BLUE, mode, rgb_matrix_config.speed, type); | 179 | rgb_matrix_layer_helper(HSV_BLUE, mode, rgb_matrix_config.speed, type, led_min, led_max); |
191 | break; | 180 | break; |
192 | } | 181 | } |
193 | } | 182 | } |
194 | 183 | ||
195 | void rgb_matrix_indicators_user(void) { | 184 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { |
196 | if (userspace_config.rgb_layer_change && | 185 | if (!is_keyboard_master()) return; |
197 | # ifdef RGB_DISABLE_WHEN_USB_SUSPENDED | 186 | if (userspace_config.rgb_layer_change) { |
198 | !g_suspend_state && | ||
199 | # endif | ||
200 | # if defined(RGBLIGHT_ENABLE) | ||
201 | (!rgblight_config.enable && rgb_matrix_config.enable) | ||
202 | # else | ||
203 | rgb_matrix_config.enable | ||
204 | # endif | ||
205 | ) { | ||
206 | switch (get_highest_layer(layer_state)) { | 187 | switch (get_highest_layer(layer_state)) { |
207 | case _GAMEPAD: | 188 | case _GAMEPAD: |
208 | rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); | 189 | rgb_matrix_layer_helper(HSV_ORANGE, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); |
209 | break; | 190 | break; |
210 | case _DIABLO: | 191 | case _DIABLO: |
211 | rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); | 192 | rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); |
212 | break; | 193 | break; |
213 | case _RAISE: | 194 | case _RAISE: |
214 | rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); | 195 | rgb_matrix_layer_helper(HSV_YELLOW, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); |
215 | break; | 196 | break; |
216 | case _LOWER: | 197 | case _LOWER: |
217 | rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); | 198 | rgb_matrix_layer_helper(HSV_GREEN, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); |
218 | break; | 199 | break; |
219 | case _ADJUST: | 200 | case _ADJUST: |
220 | rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW); | 201 | rgb_matrix_layer_helper(HSV_RED, 0, rgb_matrix_config.speed, LED_FLAG_UNDERGLOW, led_min, led_max); |
221 | break; | 202 | break; |
222 | default: { | 203 | default: { |
223 | check_default_layer(IS_LAYER_ON(_MODS), LED_FLAG_UNDERGLOW); | 204 | check_default_layer(IS_LAYER_ON(_MODS), LED_FLAG_UNDERGLOW, led_min, led_max); |
224 | break; | 205 | break; |
225 | } | 206 | } |
226 | } | 207 | } |
227 | check_default_layer(0, LED_FLAG_MODIFIER); | 208 | check_default_layer(0, LED_FLAG_MODIFIER, led_min, led_max); |
228 | } | 209 | } |
229 | } | 210 | } |
230 | #endif | 211 | #endif |
diff --git a/layouts/community/split_3x6_3/drashna/mcuconf.h b/layouts/community/split_3x6_3/drashna/mcuconf.h new file mode 100644 index 000000000..429e4e1cd --- /dev/null +++ b/layouts/community/split_3x6_3/drashna/mcuconf.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* Copyright 2020 Nick Brassel (tzarc) | ||
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 3 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 <https://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #pragma once | ||
17 | |||
18 | #include_next <mcuconf.h> | ||
19 | |||
20 | // #undef STM32_HSE_ENABLED | ||
21 | // #define STM32_HSE_ENABLED FALSE | ||
22 | #undef STM32_GPT_USE_TIM15 | ||
23 | #define STM32_GPT_USE_TIM15 FALSE | ||
24 | |||
25 | #undef STM32_PWM_USE_TIM15 | ||
26 | #define STM32_PWM_USE_TIM15 TRUE | ||
27 | |||
28 | #undef STM32_SERIAL_USE_USART1 | ||
29 | #define STM32_SERIAL_USE_USART1 TRUE | ||
30 | |||
31 | #undef STM32_PWM_TIM15_IRQ_PRIORITY | ||
32 | #define STM32_PWM_TIM15_IRQ_PRIORITY 16 | ||
diff --git a/layouts/community/split_3x6_3/drashna/rules.mk b/layouts/community/split_3x6_3/drashna/rules.mk index 46f543f4e..5358cb0ac 100644 --- a/layouts/community/split_3x6_3/drashna/rules.mk +++ b/layouts/community/split_3x6_3/drashna/rules.mk | |||
@@ -3,7 +3,7 @@ | |||
3 | # change to "no" to disable the options, or define them in the Makefile in | 3 | # change to "no" to disable the options, or define them in the Makefile in |
4 | # the appropriate keymap folder that will get included automatically | 4 | # the appropriate keymap folder that will get included automatically |
5 | # | 5 | # |
6 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | 6 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) |
7 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | 7 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) |
8 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 8 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
9 | CONSOLE_ENABLE = no # Console for debug(+400) | 9 | CONSOLE_ENABLE = no # Console for debug(+400) |
@@ -20,9 +20,15 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing | |||
20 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 20 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
21 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 21 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
22 | 22 | ||
23 | ifeq ($(strip $(KEYBOARD)), crkbd/rev1) | 23 | ifeq ($(strip $(KEYBOARD)), crkbd/rev1/common) |
24 | OLED_DRIVER_ENABLE = yes | 24 | OLED_DRIVER_ENABLE = yes |
25 | RGB_MATRIX_ENABLE = yes | 25 | RGB_MATRIX_ENABLE = yes |
26 | HAPTIC_ENABLE = SOLENOID | 26 | HAPTIC_ENABLE = SOLENOID |
27 | BOOTLOADER = qmk-dfu | 27 | BOOTLOADER = qmk-dfu |
28 | endif | 28 | endif |
29 | |||
30 | ifeq ($(strip $(CTPC)), yes) | ||
31 | HAPTIC_ENABLE = no | ||
32 | WS2812_DRIVER = pwm | ||
33 | SERIAL_DRIVER = usart | ||
34 | endif | ||
diff --git a/layouts/community/split_3x6_3/drashna/ssd1306.c b/layouts/community/split_3x6_3/drashna/ssd1306.c new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/layouts/community/split_3x6_3/drashna/ssd1306.c | |||
diff --git a/users/drashna/config.h b/users/drashna/config.h index 9fc65e5c9..8837ca0a5 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h | |||
@@ -22,6 +22,10 @@ | |||
22 | /* Set Polling rate to 1000Hz */ | 22 | /* Set Polling rate to 1000Hz */ |
23 | #define USB_POLLING_INTERVAL_MS 1 | 23 | #define USB_POLLING_INTERVAL_MS 1 |
24 | 24 | ||
25 | #if defined(SPLIT_KEYBOAD) | ||
26 | # define SPLIT_MODS_ENABLE | ||
27 | #endif | ||
28 | |||
25 | #ifdef AUDIO_ENABLE | 29 | #ifdef AUDIO_ENABLE |
26 | 30 | ||
27 | # define AUDIO_CLICKY | 31 | # define AUDIO_CLICKY |
@@ -40,9 +44,9 @@ | |||
40 | #endif // !AUDIO_ENABLE | 44 | #endif // !AUDIO_ENABLE |
41 | 45 | ||
42 | #ifdef RGBLIGHT_ENABLE | 46 | #ifdef RGBLIGHT_ENABLE |
43 | # undef RGBLIGHT_ANIMATIONS | 47 | # define RGBLIGHT_SLEEP |
44 | # if defined(__AVR__) && !defined(__AVR_AT90USB1286__) | 48 | # if defined(__AVR__) && !defined(__AVR_AT90USB1286__) |
45 | # define RGBLIGHT_SLEEP | 49 | # undef RGBLIGHT_ANIMATIONS |
46 | # define RGBLIGHT_EFFECT_BREATHING | 50 | # define RGBLIGHT_EFFECT_BREATHING |
47 | # define RGBLIGHT_EFFECT_SNAKE | 51 | # define RGBLIGHT_EFFECT_SNAKE |
48 | # define RGBLIGHT_EFFECT_KNIGHT | 52 | # define RGBLIGHT_EFFECT_KNIGHT |
@@ -101,6 +105,14 @@ | |||
101 | # endif // AVR | 105 | # endif // AVR |
102 | #endif // RGB_MATRIX_ENABLE | 106 | #endif // RGB_MATRIX_ENABLE |
103 | 107 | ||
108 | #ifdef OLED_DRIVER_ENABLE | ||
109 | # ifdef SPLIT_KEYBOARD | ||
110 | # define OLED_UPDATE_INTERVAL 60 | ||
111 | # else | ||
112 | # define OLED_UPDATE_INTERVAL 15 | ||
113 | # endif | ||
114 | #endif | ||
115 | |||
104 | #ifndef ONESHOT_TAP_TOGGLE | 116 | #ifndef ONESHOT_TAP_TOGGLE |
105 | # define ONESHOT_TAP_TOGGLE 2 | 117 | # define ONESHOT_TAP_TOGGLE 2 |
106 | #endif // !ONESHOT_TAP_TOGGLE | 118 | #endif // !ONESHOT_TAP_TOGGLE |
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index ec6484621..95c9d2f62 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
@@ -49,21 +49,6 @@ bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this | |||
49 | return false; | 49 | return false; |
50 | } | 50 | } |
51 | 51 | ||
52 | void bootmagic_lite(void) { | ||
53 | matrix_scan(); | ||
54 | #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 | ||
55 | wait_ms(DEBOUNCING_DELAY * 2); | ||
56 | #elif defined(DEBOUNCE) && DEBOUNCE > 0 | ||
57 | wait_ms(DEBOUNCE * 2); | ||
58 | #else | ||
59 | wait_ms(30); | ||
60 | #endif | ||
61 | matrix_scan(); | ||
62 | if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { | ||
63 | bootloader_jump(); | ||
64 | } | ||
65 | } | ||
66 | |||
67 | __attribute__((weak)) void keyboard_pre_init_keymap(void) {} | 52 | __attribute__((weak)) void keyboard_pre_init_keymap(void) {} |
68 | 53 | ||
69 | void keyboard_pre_init_user(void) { | 54 | void keyboard_pre_init_user(void) { |
@@ -75,6 +60,7 @@ void keyboard_pre_init_user(void) { | |||
75 | // customization of the keymap. Use _keymap instead of _user | 60 | // customization of the keymap. Use _keymap instead of _user |
76 | // functions in the keymaps | 61 | // functions in the keymaps |
77 | __attribute__((weak)) void matrix_init_keymap(void) {} | 62 | __attribute__((weak)) void matrix_init_keymap(void) {} |
63 | __attribute__((weak)) void matrix_init_secret(void) {} | ||
78 | 64 | ||
79 | // Call user matrix init, set default RGB colors and then | 65 | // Call user matrix init, set default RGB colors and then |
80 | // call the keymap's init function | 66 | // call the keymap's init function |
@@ -86,6 +72,8 @@ void matrix_init_user(void) { | |||
86 | DDRB &= ~(1 << 0); | 72 | DDRB &= ~(1 << 0); |
87 | PORTB &= ~(1 << 0); | 73 | PORTB &= ~(1 << 0); |
88 | #endif | 74 | #endif |
75 | |||
76 | matrix_init_secret(); | ||
89 | matrix_init_keymap(); | 77 | matrix_init_keymap(); |
90 | } | 78 | } |
91 | 79 | ||
@@ -103,7 +91,9 @@ void keyboard_post_init_user(void) { | |||
103 | 91 | ||
104 | __attribute__((weak)) void shutdown_keymap(void) {} | 92 | __attribute__((weak)) void shutdown_keymap(void) {} |
105 | 93 | ||
94 | #ifdef RGB_MATRIX_ENABLE | ||
106 | void rgb_matrix_update_pwm_buffers(void); | 95 | void rgb_matrix_update_pwm_buffers(void); |
96 | #endif | ||
107 | 97 | ||
108 | void shutdown_user(void) { | 98 | void shutdown_user(void) { |
109 | #ifdef RGBLIGHT_ENABLE | 99 | #ifdef RGBLIGHT_ENABLE |
@@ -129,6 +119,8 @@ void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); } | |||
129 | 119 | ||
130 | __attribute__((weak)) void matrix_scan_keymap(void) {} | 120 | __attribute__((weak)) void matrix_scan_keymap(void) {} |
131 | 121 | ||
122 | __attribute__((weak)) void matrix_scan_secret(void) {} | ||
123 | |||
132 | // No global matrix scan code, so just run keymap's matrix | 124 | // No global matrix scan code, so just run keymap's matrix |
133 | // scan function | 125 | // scan function |
134 | void matrix_scan_user(void) { | 126 | void matrix_scan_user(void) { |
@@ -149,6 +141,8 @@ void matrix_scan_user(void) { | |||
149 | matrix_scan_rgb_matrix(); | 141 | matrix_scan_rgb_matrix(); |
150 | #endif | 142 | #endif |
151 | 143 | ||
144 | matrix_scan_secret(); | ||
145 | |||
152 | matrix_scan_keymap(); | 146 | matrix_scan_keymap(); |
153 | } | 147 | } |
154 | 148 | ||
@@ -157,6 +151,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) | |||
157 | // on layer change, no matter where the change was initiated | 151 | // on layer change, no matter where the change was initiated |
158 | // Then runs keymap's layer change check | 152 | // Then runs keymap's layer change check |
159 | layer_state_t layer_state_set_user(layer_state_t state) { | 153 | layer_state_t layer_state_set_user(layer_state_t state) { |
154 | if (!is_keyboard_master()) { return state; } | ||
155 | |||
160 | state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); | 156 | state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); |
161 | #if defined(RGBLIGHT_ENABLE) | 157 | #if defined(RGBLIGHT_ENABLE) |
162 | state = layer_state_set_rgb_light(state); | 158 | state = layer_state_set_rgb_light(state); |
@@ -168,6 +164,8 @@ __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t | |||
168 | 164 | ||
169 | // Runs state check and changes underglow color and animation | 165 | // Runs state check and changes underglow color and animation |
170 | layer_state_t default_layer_state_set_user(layer_state_t state) { | 166 | layer_state_t default_layer_state_set_user(layer_state_t state) { |
167 | if (!is_keyboard_master()) { return state; } | ||
168 | |||
171 | state = default_layer_state_set_keymap(state); | 169 | state = default_layer_state_set_keymap(state); |
172 | #if 0 | 170 | #if 0 |
173 | # if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) | 171 | # if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 772005a03..35d11101d 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #pragma once | 17 | #pragma once |
18 | #include QMK_KEYBOARD_H | 18 | #include QMK_KEYBOARD_H |
19 | 19 | ||
20 | #include "version.h" | ||
21 | #include "eeprom.h" | 20 | #include "eeprom.h" |
22 | #include "wrappers.h" | 21 | #include "wrappers.h" |
23 | #include "process_records.h" | 22 | #include "process_records.h" |
@@ -58,13 +57,17 @@ enum userspace_layers { | |||
58 | _ADJUST, | 57 | _ADJUST, |
59 | }; | 58 | }; |
60 | 59 | ||
60 | #define _MOUSE _MACROS | ||
61 | |||
61 | bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); | 62 | bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); |
62 | bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); | 63 | bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); |
63 | void matrix_init_keymap(void); | 64 | void matrix_init_keymap(void); |
65 | void matrix_init_secret(void); | ||
64 | void shutdown_keymap(void); | 66 | void shutdown_keymap(void); |
65 | void suspend_power_down_keymap(void); | 67 | void suspend_power_down_keymap(void); |
66 | void suspend_wakeup_init_keymap(void); | 68 | void suspend_wakeup_init_keymap(void); |
67 | void matrix_scan_keymap(void); | 69 | void matrix_scan_keymap(void); |
70 | void matrix_scan_secret(void); | ||
68 | layer_state_t layer_state_set_keymap(layer_state_t state); | 71 | layer_state_t layer_state_set_keymap(layer_state_t state); |
69 | layer_state_t default_layer_state_set_keymap(layer_state_t state); | 72 | layer_state_t default_layer_state_set_keymap(layer_state_t state); |
70 | void led_set_keymap(uint8_t usb_led); | 73 | void led_set_keymap(uint8_t usb_led); |
diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c index 46288aad2..30eb068f7 100644 --- a/users/drashna/oled_stuff.c +++ b/users/drashna/oled_stuff.c | |||
@@ -16,8 +16,6 @@ | |||
16 | 16 | ||
17 | #include "drashna.h" | 17 | #include "drashna.h" |
18 | 18 | ||
19 | extern uint8_t is_master; | ||
20 | |||
21 | #ifndef KEYLOGGER_LENGTH | 19 | #ifndef KEYLOGGER_LENGTH |
22 | // # ifdef OLED_DISPLAY_128X64 | 20 | // # ifdef OLED_DISPLAY_128X64 |
23 | # define KEYLOGGER_LENGTH ((int)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) | 21 | # define KEYLOGGER_LENGTH ((int)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH)) |
@@ -187,11 +185,11 @@ void render_bootmagic_status(void) { | |||
187 | }; | 185 | }; |
188 | 186 | ||
189 | bool is_bootmagic_on; | 187 | bool is_bootmagic_on; |
190 | #ifdef OLED_DISPLAY_128X64 | 188 | #ifdef OLED_DISPLAY_128X64 |
191 | is_bootmagic_on = !keymap_config.swap_lctl_lgui; | 189 | is_bootmagic_on = !keymap_config.swap_lctl_lgui; |
192 | #else | 190 | #else |
193 | is_bootmagic_on = keymap_config.swap_lctl_lgui; | 191 | is_bootmagic_on = keymap_config.swap_lctl_lgui; |
194 | #endif | 192 | #endif |
195 | 193 | ||
196 | oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false); | 194 | oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false); |
197 | #ifdef OLED_DISPLAY_128X64 | 195 | #ifdef OLED_DISPLAY_128X64 |
@@ -259,21 +257,20 @@ void render_status_secondary(void) { | |||
259 | #if !defined(SPLIT_TRANSPORT_MIRROR) || defined(OLED_DISPLAY_128X64) | 257 | #if !defined(SPLIT_TRANSPORT_MIRROR) || defined(OLED_DISPLAY_128X64) |
260 | oled_driver_render_logo(); | 258 | oled_driver_render_logo(); |
261 | #endif | 259 | #endif |
262 | #ifdef SPLIT_TRANSPORT_MIRROR | ||
263 | /* Show Keyboard Layout */ | 260 | /* Show Keyboard Layout */ |
264 | render_default_layer_state(); | 261 | render_default_layer_state(); |
265 | render_layer_state(); | 262 | render_layer_state(); |
266 | render_mod_status(get_mods() | get_oneshot_mods()); | 263 | render_mod_status(get_mods() | get_oneshot_mods()); |
267 | render_keylogger_status(); | 264 | render_keylogger_status(); |
268 | 265 | ||
269 | #endif | ||
270 | } | 266 | } |
271 | // clang-format on | 267 | // clang-format on |
272 | 268 | ||
273 | void render_status_main(void) { | 269 | void render_status_main(void) { |
270 | oled_driver_render_logo(); | ||
274 | /* Show Keyboard Layout */ | 271 | /* Show Keyboard Layout */ |
275 | render_default_layer_state(); | 272 | render_default_layer_state(); |
276 | render_keylock_status(host_keyboard_leds()); | 273 | // render_keylock_status(host_keyboard_leds()); |
277 | render_bootmagic_status(); | 274 | render_bootmagic_status(); |
278 | render_user_status(); | 275 | render_user_status(); |
279 | 276 | ||
@@ -281,19 +278,15 @@ void render_status_main(void) { | |||
281 | } | 278 | } |
282 | 279 | ||
283 | void oled_task_user(void) { | 280 | void oled_task_user(void) { |
284 | if (timer_elapsed32(oled_timer) > 30000) { | ||
285 | oled_off(); | ||
286 | return; | ||
287 | } | ||
288 | #ifndef SPLIT_KEYBOARD | ||
289 | else { | ||
290 | oled_on(); | ||
291 | } | ||
292 | #endif | ||
293 | |||
294 | update_log(); | 281 | update_log(); |
295 | 282 | ||
296 | if (is_master) { | 283 | if (is_keyboard_master()) { |
284 | if (timer_elapsed32(oled_timer) > 30000) { | ||
285 | oled_off(); | ||
286 | return; | ||
287 | } else { | ||
288 | oled_on(); | ||
289 | } | ||
297 | render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) | 290 | render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) |
298 | } else { | 291 | } else { |
299 | render_status_secondary(); | 292 | render_status_secondary(); |
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 19bdef73f..14fda92de 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "drashna.h" | 17 | #include "drashna.h" |
18 | #include "version.h" | ||
18 | 19 | ||
19 | uint16_t copy_paste_timer; | 20 | uint16_t copy_paste_timer; |
20 | 21 | ||
@@ -27,11 +28,7 @@ __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t | |||
27 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 28 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
28 | // If console is enabled, it will print the matrix position and status of each key pressed | 29 | // If console is enabled, it will print the matrix position and status of each key pressed |
29 | #ifdef KEYLOGGER_ENABLE | 30 | #ifdef KEYLOGGER_ENABLE |
30 | # if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2) | 31 | uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); |
31 | xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed); | ||
32 | # else | ||
33 | xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); | ||
34 | # endif | ||
35 | #endif // KEYLOGGER_ENABLE | 32 | #endif // KEYLOGGER_ENABLE |
36 | #ifdef OLED_DRIVER_ENABLE | 33 | #ifdef OLED_DRIVER_ENABLE |
37 | process_record_user_oled(keycode, record); | 34 | process_record_user_oled(keycode, record); |
diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h index d41be962d..e59e2242e 100644 --- a/users/drashna/process_records.h +++ b/users/drashna/process_records.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #pragma once | 17 | #pragma once |
18 | #include "drashna.h" | 18 | #include "drashna.h" |
19 | 19 | ||
20 | #if defined(KEYMAP_SAFE_RANGE) | 20 | #if defined(KEYBOARD_handwired_dactyl_manuform_5x6_right_trackball) |
21 | # define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE | 21 | # define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE |
22 | #else | 22 | #else |
23 | # define PLACEHOLDER_SAFE_RANGE SAFE_RANGE | 23 | # define PLACEHOLDER_SAFE_RANGE SAFE_RANGE |
diff --git a/users/drashna/rgb_matrix_stuff.c b/users/drashna/rgb_matrix_stuff.c index 52e261234..573cc7bc9 100644 --- a/users/drashna/rgb_matrix_stuff.c +++ b/users/drashna/rgb_matrix_stuff.c | |||
@@ -26,7 +26,7 @@ static uint32_t hypno_timer; | |||
26 | # define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN | 26 | # define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) { | 29 | void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) { |
30 | HSV hsv = {hue, sat, val}; | 30 | HSV hsv = {hue, sat, val}; |
31 | if (hsv.v > rgb_matrix_get_val()) { | 31 | if (hsv.v > rgb_matrix_get_val()) { |
32 | hsv.v = rgb_matrix_get_val(); | 32 | hsv.v = rgb_matrix_get_val(); |
@@ -40,7 +40,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode | |||
40 | RGB rgb = hsv_to_rgb(hsv); | 40 | RGB rgb = hsv_to_rgb(hsv); |
41 | for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { | 41 | for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { |
42 | if (HAS_FLAGS(g_led_config.flags[i], led_type)) { | 42 | if (HAS_FLAGS(g_led_config.flags[i], led_type)) { |
43 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 43 | RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); |
44 | } | 44 | } |
45 | } | 45 | } |
46 | break; | 46 | break; |
@@ -50,7 +50,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode | |||
50 | RGB rgb = hsv_to_rgb(hsv); | 50 | RGB rgb = hsv_to_rgb(hsv); |
51 | for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { | 51 | for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { |
52 | if (HAS_FLAGS(g_led_config.flags[i], led_type)) { | 52 | if (HAS_FLAGS(g_led_config.flags[i], led_type)) { |
53 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 53 | RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | break; | 56 | break; |
diff --git a/users/drashna/rgb_matrix_stuff.h b/users/drashna/rgb_matrix_stuff.h index 592f9c9e6..b86f2f651 100644 --- a/users/drashna/rgb_matrix_stuff.h +++ b/users/drashna/rgb_matrix_stuff.h | |||
@@ -22,4 +22,4 @@ void keyboard_post_init_rgb_matrix(void); | |||
22 | void matrix_scan_rgb_matrix(void); | 22 | void matrix_scan_rgb_matrix(void); |
23 | 23 | ||
24 | void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); | 24 | void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); |
25 | void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); | 25 | void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max); |
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index d98f7cc2f..b67f707b6 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c | |||
@@ -178,7 +178,11 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) { | |||
178 | uint8_t mode = layer_state_cmp(state,_MODS) ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT; | 178 | uint8_t mode = layer_state_cmp(state,_MODS) ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT; |
179 | switch (get_highest_layer(state|default_layer_state)) { | 179 | switch (get_highest_layer(state|default_layer_state)) { |
180 | case _MACROS: | 180 | case _MACROS: |
181 | rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3); | 181 | # ifdef RGBLIGHT_EFFECT_TWINKLE |
182 | rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5); | ||
183 | # else | ||
184 | rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3); | ||
185 | # endif | ||
182 | break; | 186 | break; |
183 | case _MEDIA: | 187 | case _MEDIA: |
184 | rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); | 188 | rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); |
diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h index ed4022aaa..d135f44af 100644 --- a/users/drashna/wrappers.h +++ b/users/drashna/wrappers.h | |||
@@ -162,6 +162,15 @@ NOTE: These are all the same length. If you do a search/replace | |||
162 | #define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z | 162 | #define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z |
163 | 163 | ||
164 | 164 | ||
165 | #define _________________HALMAK_L1_________________ KC_W, KC_L, KC_R, KC_B, KC_Z | ||
166 | #define _________________HALMAK_L2_________________ KC_S, KC_H, KC_N, KC_T, KC_COMM | ||
167 | #define _________________HALMAK_L3_________________ KC_F, KC_M, KC_V, KC_V, KC_SLASH | ||
168 | |||
169 | #define _________________HALMAK_R1_________________ KC_SCLN, KC_Q, KC_U, KC_D, KC_J | ||
170 | #define _________________HALMAK_R2_________________ KC_DOT, KC_A, KC_E, KC_O, KC_I | ||
171 | #define _________________HALMAK_R3_________________ KC_G, KC_P, KC_X, KC_K, KC_Y | ||
172 | |||
173 | |||
165 | #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 | 174 | #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 |
166 | #define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 | 175 | #define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 |
167 | #define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 | 176 | #define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 |