aboutsummaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/333fred/333fred.c2
-rw-r--r--users/bbaserdem/bbaserdem.c10
-rw-r--r--users/bbaserdem/rules.mk2
-rw-r--r--users/bcat/config.h2
-rw-r--r--users/bcat/rules.mk1
-rw-r--r--users/billypython/billypython.c2
-rw-r--r--users/bocaj/config.h2
-rw-r--r--users/curry/config.h2
-rw-r--r--users/danielo515/process_records.h4
-rw-r--r--users/drashna/config.h167
-rw-r--r--users/drashna/drashna.c31
-rw-r--r--users/drashna/drashna.h11
-rw-r--r--users/drashna/drashna_font.h5
-rw-r--r--users/drashna/drashna_transport.c603
-rw-r--r--users/drashna/oled_stuff.c83
-rw-r--r--users/drashna/oled_stuff.h165
-rw-r--r--users/drashna/pimoroni_trackball.c151
-rw-r--r--users/drashna/process_records.c62
-rw-r--r--users/drashna/process_records.h82
-rw-r--r--users/drashna/rgb_matrix_stuff.c54
-rw-r--r--users/drashna/rgb_stuff.c100
-rw-r--r--users/drashna/rules.mk45
-rw-r--r--users/drashna/tap_dances.c8
-rw-r--r--users/drashna/tap_dances.h2
-rw-r--r--users/drashna/template.c6
-rw-r--r--users/drashna/template.h4
-rw-r--r--users/drashna/transport_sync.c80
-rw-r--r--users/drashna/transport_sync.h (renamed from users/drashna/pimoroni_trackball.h)19
-rw-r--r--users/dshields/rules.mk1
-rw-r--r--users/edvorakjp/edvorakjp.c2
-rw-r--r--users/edvorakjp/edvorakjp.h2
-rw-r--r--users/ericgebhart/base_layers.h2
-rw-r--r--users/ericgebhart/core_keys.h2
-rw-r--r--users/ericgebhart/core_keysets.h36
-rw-r--r--users/ericgebhart/ericgebhart.c22
-rwxr-xr-xusers/ericgebhart/rules.mk1
-rw-r--r--users/konstantin/konstantin.c2
-rw-r--r--users/kuchosauronad0/kuchosauronad0.c4
-rw-r--r--users/mtdjr/mtdjr.c2
-rw-r--r--users/pvinis/pvinis.c2
-rw-r--r--users/romus/romus.c26
-rw-r--r--users/romus/rules.mk2
-rw-r--r--users/sigul/sigul.c20
-rw-r--r--users/sigul/sigul.h8
-rw-r--r--users/spacebarracecar/spacebarracecar.c12
-rw-r--r--users/spidey3/config.h4
-rw-r--r--users/stanrc85/layer_rgb.c2
-rw-r--r--users/tominabox1/config.h2
-rw-r--r--users/tominabox1/tominabox1.c2
-rw-r--r--users/turbomech/backupturbomech.c2
-rw-r--r--users/xulkal/process_records.c2
51 files changed, 596 insertions, 1269 deletions
diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c
index 621b9e664..99f4e0168 100644
--- a/users/333fred/333fred.c
+++ b/users/333fred/333fred.c
@@ -117,7 +117,7 @@ void tap_dance_process_keycode(uint16_t keycode) {
117__attribute__ ((weak)) 117__attribute__ ((weak))
118void layer_state_set_rgb(uint32_t state) {} 118void layer_state_set_rgb(uint32_t state) {}
119 119
120uint32_t layer_state_set_user(uint32_t state) { 120layer_state_t layer_state_set_user(layer_state_t state) {
121 layer_state_set_rgb(state); 121 layer_state_set_rgb(state);
122 return state; 122 return state;
123} 123}
diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c
index ac7b1b62e..cdacda12e 100644
--- a/users/bbaserdem/bbaserdem.c
+++ b/users/bbaserdem/bbaserdem.c
@@ -87,7 +87,7 @@ void rgblight_saveBase(void) {
87 base_sta = false; // If saving, that means base layer is being left 87 base_sta = false; // If saving, that means base layer is being left
88} 88}
89 89
90// Load the base state back 90// Load the base state back
91void rgblight_loadBase(void) { 91void rgblight_loadBase(void) {
92 // Don't do anything if not enabled 92 // Don't do anything if not enabled
93 if ( !base_sta ) { 93 if ( !base_sta ) {
@@ -248,7 +248,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
248 } 248 }
249 return false; 249 return false;
250 break; 250 break;
251#endif 251#endif
252 252
253 // If these keys are pressed, load base layer config, and mark saving 253 // If these keys are pressed, load base layer config, and mark saving
254#ifdef RGBLIGHT_ENABLE 254#ifdef RGBLIGHT_ENABLE
@@ -261,7 +261,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
261 case RGB_HUI: 261 case RGB_HUI:
262 case RGB_HUD: 262 case RGB_HUD:
263 if ( !base_sta ) { 263 if ( !base_sta ) {
264 rgblight_loadBase(); 264 rgblight_loadBase();
265 } 265 }
266 return true; 266 return true;
267 break; 267 break;
@@ -301,7 +301,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
301 } 301 }
302 return false; 302 return false;
303 break; 303 break;
304 304
305 // Layer switches with sound 305 // Layer switches with sound
306 case K_GAMES: 306 case K_GAMES:
307 if (record->event.pressed) { 307 if (record->event.pressed) {
@@ -622,7 +622,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
622|*-----LAYER CHANGE-----*| 622|*-----LAYER CHANGE-----*|
623\*----------------------*/ 623\*----------------------*/
624 624
625uint32_t layer_state_set_user(uint32_t state) { 625layer_state_t layer_state_set_user(layer_state_t state) {
626 626
627 state = layer_state_set_keymap (state); 627 state = layer_state_set_keymap (state);
628#ifdef RGBLIGHT_ENABLE 628#ifdef RGBLIGHT_ENABLE
diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk
index 94f01cdff..8b9741cf9 100644
--- a/users/bbaserdem/rules.mk
+++ b/users/bbaserdem/rules.mk
@@ -16,8 +16,6 @@ SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested.
16NKRO_ENABLE = no # Default is 6KRO which is plenty 16NKRO_ENABLE = no # Default is 6KRO which is plenty
17MIDI_ENABLE = no # Untested feature 17MIDI_ENABLE = no # Untested feature
18KEY_LOCK_ENABLE = no # Allows locking any key. Not used 18KEY_LOCK_ENABLE = no # Allows locking any key. Not used
19API_SYSEX_ENABLE = no # Allows OS to send signals.
20KEY_LOCK_ENABLE = no # Allows locking any key. Not used
21 19
22# Disabling this makes it compile, i dont know why 20# Disabling this makes it compile, i dont know why
23# VARIABLE_TRACE = no # Allows debugging variables 21# VARIABLE_TRACE = no # Allows debugging variables
diff --git a/users/bcat/config.h b/users/bcat/config.h
index 16188950e..5bb93f383 100644
--- a/users/bcat/config.h
+++ b/users/bcat/config.h
@@ -33,7 +33,7 @@
33 33
34#if defined(RGB_MATRIX_ENABLE) 34#if defined(RGB_MATRIX_ENABLE)
35/* Turn off per-key RGB when the host goes to sleep. */ 35/* Turn off per-key RGB when the host goes to sleep. */
36# define RGB_DISABLE_WHEN_USB_SUSPENDED true 36# define RGB_DISABLE_WHEN_USB_SUSPENDED
37 37
38/* Keep per-key RGB increments consistent across keyboards. */ 38/* Keep per-key RGB increments consistent across keyboards. */
39# undef RGB_MATRIX_HUE_STEP 39# undef RGB_MATRIX_HUE_STEP
diff --git a/users/bcat/rules.mk b/users/bcat/rules.mk
index 3442a78ac..d49c04a40 100644
--- a/users/bcat/rules.mk
+++ b/users/bcat/rules.mk
@@ -27,7 +27,6 @@ MIDI_ENABLE = no
27SLEEP_LED_ENABLE = no 27SLEEP_LED_ENABLE = no
28 28
29# Disable other unused options on all keyboards. 29# Disable other unused options on all keyboards.
30API_SYSEX_ENABLE = no
31AUTO_SHIFT_ENABLE = no 30AUTO_SHIFT_ENABLE = no
32COMBO_ENABLE = no 31COMBO_ENABLE = no
33KEYBOARD_LOCK_ENABLE = no 32KEYBOARD_LOCK_ENABLE = no
diff --git a/users/billypython/billypython.c b/users/billypython/billypython.c
index 7bdfe33a4..180b478d7 100644
--- a/users/billypython/billypython.c
+++ b/users/billypython/billypython.c
@@ -27,6 +27,6 @@ uint32_t layer_state_set_keymap(uint32_t state) {
27 return state; 27 return state;
28} 28}
29 29
30uint32_t layer_state_set_user(uint32_t state) { 30layer_state_t layer_state_set_user(layer_state_t state) {
31 return layer_state_set_keymap(state); 31 return layer_state_set_keymap(state);
32} 32}
diff --git a/users/bocaj/config.h b/users/bocaj/config.h
index 2a44aabfc..ecfb09c6f 100644
--- a/users/bocaj/config.h
+++ b/users/bocaj/config.h
@@ -28,7 +28,7 @@
28// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) 28// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
29# define RGB_MATRIX_FRAMEBUFFER_EFFECTS 29# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
30// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects 30// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
31# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended 31# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
32// # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 32// # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
33// # define EECONFIG_RGB_MATRIX (uint32_t *)16 33// # define EECONFIG_RGB_MATRIX (uint32_t *)16
34 34
diff --git a/users/curry/config.h b/users/curry/config.h
index b982dab03..e3c0a103e 100644
--- a/users/curry/config.h
+++ b/users/curry/config.h
@@ -17,7 +17,7 @@
17#if defined(RGB_MATRIX_ENABLE) 17#if defined(RGB_MATRIX_ENABLE)
18# define RGB_MATRIX_KEYPRESSES 18# define RGB_MATRIX_KEYPRESSES
19# define RGB_MATRIX_FRAMEBUFFER_EFFECTS 19# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
20# define RGB_DISABLE_WHEN_USB_SUSPENDED true 20# define RGB_DISABLE_WHEN_USB_SUSPENDED
21 21
22# define DISABLE_RGB_MATRIX_ALPHAS_MODS 22# define DISABLE_RGB_MATRIX_ALPHAS_MODS
23# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN 23# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
diff --git a/users/danielo515/process_records.h b/users/danielo515/process_records.h
index 490607686..caa85e629 100644
--- a/users/danielo515/process_records.h
+++ b/users/danielo515/process_records.h
@@ -78,8 +78,8 @@ enum layers {
78#define KC_E_GT S(KC_NUBS) 78#define KC_E_GT S(KC_NUBS)
79#define KC_E_TILD ES_TILD 79#define KC_E_TILD ES_TILD
80#define KC_E_MINS ES_MINS 80#define KC_E_MINS ES_MINS
81#define KC_E_OVRR ES_OVRR 81#define KC_E_OVRR ES_MORD
82#define KC_E_APOS ES_APOS 82#define KC_E_APOS ES_QUOT
83#define KC_E_IEXL ES_IEXL 83#define KC_E_IEXL ES_IEXL
84//========== Short hand for complex key combinations 84//========== Short hand for complex key combinations
85#define WIN_LEFT_HALF LALT(LGUI(KC_LEFT)) 85#define WIN_LEFT_HALF LALT(LGUI(KC_LEFT))
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 5f7c32ff3..445e18082 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -17,34 +17,49 @@
17#pragma once 17#pragma once
18 18
19// Use custom magic number so that when switching branches, EEPROM always gets reset 19// Use custom magic number so that when switching branches, EEPROM always gets reset
20#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339 20#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339
21 21
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_KEYBOARD) 25#if defined(SPLIT_KEYBOARD)
26# define SPLIT_MODS_ENABLE 26# define SPLIT_MODS_ENABLE
27# define SPLIT_TRANSPORT_MIRROR 27# define SPLIT_LAYER_STATE_ENABLE
28# define SPLIT_LED_STATE_ENABLE
29
30// # define SPLIT_TRANSPORT_MIRROR
28# define SERIAL_USE_MULTI_TRANSACTION 31# define SERIAL_USE_MULTI_TRANSACTION
29// # define SPLIT_NUM_TRANSACTIONS_KB 2 32# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USER_STATE_SYNC
30#endif 33#endif
31 34
32#ifdef AUDIO_ENABLE 35#ifdef AUDIO_ENABLE
33
34# define AUDIO_CLICKY 36# define AUDIO_CLICKY
35# define STARTUP_SONG SONG(RICK_ROLL)
36# define GOODBYE_SONG SONG(SONIC_RING)
37# define DEFAULT_LAYER_SONGS \
38 { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) }
39
40# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f 37# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
41 38
42# define UNICODE_SONG_MAC SONG(RICK_ROLL) 39# ifdef USER_SONG_LIST
43# define UNICODE_SONG_LNX SONG(RICK_ROLL) 40# define STARTUP_SONG SONG(RICK_ROLL)
44# define UNICODE_SONG_WIN SONG(RICK_ROLL) 41# define GOODBYE_SONG SONG(SONIC_RING)
45# define UNICODE_SONG_BSD SONG(RICK_ROLL) 42# define DEFAULT_LAYER_SONGS \
46# define UNICODE_SONG_WINC SONG(RICK_ROLL) 43 { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) }
47#endif // !AUDIO_ENABLE 44# define UNICODE_SONG_MAC SONG(MARIO_THEME)
45# define UNICODE_SONG_LNX SONG(MARIO_POWERUP)
46# define UNICODE_SONG_WIN SONG(MARIO_ONEUP)
47# define UNICODE_SONG_BSD SONG(RICK_ROLL)
48# define UNICODE_SONG_WINC SONG(RICK_ROLL)
49# else
50# define STARTUP_SONG SONG(STARTUP_SOUND)
51# define GOODBYE_SONG SONG(GOODBYE_SOUND)
52# define DEFAULT_LAYER_SONGS \
53 { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(WORKMAN_SOUND) }
54# define UNICODE_SONG_MAC SONG(QWERTY_SOUND)
55# define UNICODE_SONG_LNX SONG(COLEMAK_SOUND)
56# define UNICODE_SONG_WIN SONG(DVORAK_SOUND)
57# define UNICODE_SONG_BSD SONG(WORKMAN_SOUND)
58# define UNICODE_SONG_WINC SONG(PLOVER_GOODBYE_SOUND)
59# endif
60#endif // !AUDIO_ENABLE
61
62#define UNICODE_SELECTED_MODES UC_WIN, UC_MAC
48 63
49#ifdef RGBLIGHT_ENABLE 64#ifdef RGBLIGHT_ENABLE
50# define RGBLIGHT_SLEEP 65# define RGBLIGHT_SLEEP
@@ -56,18 +71,16 @@
56# else 71# else
57# define RGBLIGHT_ANIMATIONS 72# define RGBLIGHT_ANIMATIONS
58# endif 73# endif
59# define RGBLIGHT_EFFECT_TWINKLE_LIFE 250 74# define RGBLIGHT_EFFECT_TWINKLE_LIFE 250
60# define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1/24 75# define RGBLIGHT_EFFECT_TWINKLE_PROBABILITY 1 / 24
61#endif // RGBLIGHT_ENABLE 76#endif // RGBLIGHT_ENABLE
62 77
63#ifdef RGB_MATRIX_ENABLE 78#ifdef RGB_MATRIX_ENABLE
64# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) 79# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
65// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) 80// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
66# define RGB_MATRIX_FRAMEBUFFER_EFFECTS 81# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
67// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects 82// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
68# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended 83// # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
69// # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
70// # define EECONFIG_RGB_MATRIX (uint32_t *)16
71 84
72# if defined(__AVR__) && !defined(__AVR_AT90USB1286__) && !defined(KEYBOARD_launchpad) 85# if defined(__AVR__) && !defined(__AVR_AT90USB1286__) && !defined(KEYBOARD_launchpad)
73# define DISABLE_RGB_MATRIX_ALPHAS_MODS 86# define DISABLE_RGB_MATRIX_ALPHAS_MODS
@@ -107,8 +120,8 @@
107# define DISABLE_RGB_MATRIX_MULTISPLASH 120# define DISABLE_RGB_MATRIX_MULTISPLASH
108# define DISABLE_RGB_MATRIX_SOLID_SPLASH 121# define DISABLE_RGB_MATRIX_SOLID_SPLASH
109# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH 122# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
110# endif // AVR 123# endif // AVR
111#endif // RGB_MATRIX_ENABLE 124#endif // RGB_MATRIX_ENABLE
112 125
113#ifdef OLED_DRIVER_ENABLE 126#ifdef OLED_DRIVER_ENABLE
114# ifdef SPLIT_KEYBOARD 127# ifdef SPLIT_KEYBOARD
@@ -120,7 +133,7 @@
120# ifdef OLED_FONT_H 133# ifdef OLED_FONT_H
121# undef OLED_FONT_H 134# undef OLED_FONT_H
122# endif 135# endif
123# define OLED_FONT_H "drashna_font.h" 136# define OLED_FONT_H "drashna_font.h"
124# define OLED_FONT_END 255 137# define OLED_FONT_END 255
125// # define OLED_FONT_5X5 138// # define OLED_FONT_5X5
126// # define OLED_FONT_AZTECH 139// # define OLED_FONT_AZTECH
@@ -135,16 +148,16 @@
135 148
136#ifndef ONESHOT_TAP_TOGGLE 149#ifndef ONESHOT_TAP_TOGGLE
137# define ONESHOT_TAP_TOGGLE 2 150# define ONESHOT_TAP_TOGGLE 2
138#endif // !ONESHOT_TAP_TOGGLE 151#endif // !ONESHOT_TAP_TOGGLE
139 152
140#ifndef ONESHOT_TIMEOUT 153#ifndef ONESHOT_TIMEOUT
141# define ONESHOT_TIMEOUT 3000 154# define ONESHOT_TIMEOUT 3000
142#endif // !ONESHOT_TIMEOUT 155#endif // !ONESHOT_TIMEOUT
143 156
144#ifdef QMK_KEYS_PER_SCAN 157#ifdef QMK_KEYS_PER_SCAN
145# undef QMK_KEYS_PER_SCAN 158# undef QMK_KEYS_PER_SCAN
146# define QMK_KEYS_PER_SCAN 2 159# define QMK_KEYS_PER_SCAN 2
147#endif // !QMK_KEYS_PER_SCAN 160#endif // !QMK_KEYS_PER_SCAN
148 161
149// this makes it possible to do rolling combos (zx) with keys that 162// this makes it possible to do rolling combos (zx) with keys that
150// convert to other keys on hold (z becomes ctrl when you hold it, 163// convert to other keys on hold (z becomes ctrl when you hold it,
@@ -152,8 +165,8 @@
152// actually sends Ctrl-x. That's bad.) 165// actually sends Ctrl-x. That's bad.)
153#define IGNORE_MOD_TAP_INTERRUPT 166#define IGNORE_MOD_TAP_INTERRUPT
154#undef PERMISSIVE_HOLD 167#undef PERMISSIVE_HOLD
155//#define TAPPING_FORCE_HOLD 168//#define TAPPING_FORCE_HOLD_PER_KEY
156//#define RETRO_TAPPING 169//#define RETRO_TAPPING_PER_KEY
157#ifndef KEYBOARD_kyria_rev1 170#ifndef KEYBOARD_kyria_rev1
158# define TAPPING_TERM_PER_KEY 171# define TAPPING_TERM_PER_KEY
159#endif 172#endif
@@ -166,7 +179,7 @@
166 179
167#ifdef TAPPING_TERM 180#ifdef TAPPING_TERM
168# undef TAPPING_TERM 181# undef TAPPING_TERM
169#endif // TAPPING_TERM 182#endif // TAPPING_TERM
170#if defined(KEYBOARD_ergodox_ez) 183#if defined(KEYBOARD_ergodox_ez)
171# define TAPPING_TERM 185 184# define TAPPING_TERM 185
172#elif defined(KEYBOARD_crkbd) 185#elif defined(KEYBOARD_crkbd)
@@ -185,14 +198,16 @@
185# undef LOCKING_RESYNC_ENABLE 198# undef LOCKING_RESYNC_ENABLE
186#endif 199#endif
187 200
201#define LAYER_STATE_16BIT
202
188#ifdef CONVERT_TO_PROTON_C 203#ifdef CONVERT_TO_PROTON_C
189// pins that are available but not present on Pro Micro 204// pins that are available but not present on Pro Micro
190# define A3 PAL_LINE(GPIOA, 3) 205# define A3 PAL_LINE(GPIOA, 3)
191# define A4 PAL_LINE(GPIOA, 4) 206# define A4 PAL_LINE(GPIOA, 4)
192# define A5 PAL_LINE(GPIOA, 5) 207# define A5 PAL_LINE(GPIOA, 5)
193# define A6 PAL_LINE(GPIOA, 6) 208# define A6 PAL_LINE(GPIOA, 6)
194# define A7 PAL_LINE(GPIOA, 7) 209# define A7 PAL_LINE(GPIOA, 7)
195# define A8 PAL_LINE(GPIOA, 8) 210# define A8 PAL_LINE(GPIOA, 8)
196# define A13 PAL_LINE(GPIOA, 13) 211# define A13 PAL_LINE(GPIOA, 13)
197# define A14 PAL_LINE(GPIOA, 14) 212# define A14 PAL_LINE(GPIOA, 14)
198# define A15 PAL_LINE(GPIOA, 15) 213# define A15 PAL_LINE(GPIOA, 15)
@@ -203,3 +218,79 @@
203# define C14 PAL_LINE(GPIOC, 14) 218# define C14 PAL_LINE(GPIOC, 14)
204# define C15 PAL_LINE(GPIOC, 15) 219# define C15 PAL_LINE(GPIOC, 15)
205#endif 220#endif
221
222#ifdef MOUSEKEY_ENABLE
223// mouse movement config
224# ifdef MK_3_SPEED
225# undef MK_3_SPEED
226# endif
227# define MK_KINETIC_SPEED
228# ifdef MK_KINETIC_SPEED
229# ifndef MOUSEKEY_DELAY
230# define MOUSEKEY_DELAY 8
231# endif
232# ifndef MOUSEKEY_INTERVAL
233# define MOUSEKEY_INTERVAL 20
234# endif
235# ifdef MOUSEKEY_MOVE_DELTA
236# define MOUSEKEY_MOVE_DELTA 25
237# endif
238# else
239# ifndef MOUSEKEY_DELAY
240# define MOUSEKEY_DELAY 300
241# endif
242# ifndef MOUSEKEY_INTERVAL
243# define MOUSEKEY_INTERVAL 50
244# endif
245# ifndef MOUSEKEY_MOVE_DELTA
246# define MOUSEKEY_MOVE_DELTA 5
247# endif
248# endif
249# ifndef MOUSEKEY_MAX_SPEED
250# define MOUSEKEY_MAX_SPEED 7
251# endif
252# ifndef MOUSEKEY_TIME_TO_MAX
253# define MOUSEKEY_TIME_TO_MAX 60
254# endif
255# ifndef MOUSEKEY_INITIAL_SPEED
256# define MOUSEKEY_INITIAL_SPEED 100
257# endif
258# ifndef MOUSEKEY_BASE_SPEED
259# define MOUSEKEY_BASE_SPEED 1000
260# endif
261# ifndef MOUSEKEY_DECELERATED_SPEED
262# define MOUSEKEY_DECELERATED_SPEED 400
263# endif
264# ifndef MOUSEKEY_ACCELERATED_SPEED
265# define MOUSEKEY_ACCELERATED_SPEED 3000
266# endif
267// mouse scroll config
268# ifndef MOUSEKEY_WHEEL_DELAY
269# define MOUSEKEY_WHEEL_DELAY 15
270# endif
271# ifndef MOUSEKEY_WHEEL_DELTA
272# define MOUSEKEY_WHEEL_DELTA 1
273# endif
274# ifndef MOUSEKEY_WHEEL_INTERVAL
275# define MOUSEKEY_WHEEL_INTERVAL 50
276# endif
277# ifndef MOUSEKEY_WHEEL_MAX_SPEED
278# define MOUSEKEY_WHEEL_MAX_SPEED 8
279# endif
280# ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
281# define MOUSEKEY_WHEEL_TIME_TO_MAX 80
282# endif
283// mouse scroll kinetic config
284# ifndef MOUSEKEY_WHEEL_INITIAL_MOVEMENTS
285# define MOUSEKEY_WHEEL_INITIAL_MOVEMENTS 8
286# endif
287# ifndef MOUSEKEY_WHEEL_BASE_MOVEMENTS
288# define MOUSEKEY_WHEEL_BASE_MOVEMENTS 48
289# endif
290# ifndef MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS
291# define MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS 48
292# endif
293# ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS
294# define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8
295# endif
296#endif // MOUSEKEY_ENABLE
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index a49373726..b54d0cfcc 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -86,6 +86,9 @@ void keyboard_post_init_user(void) {
86#if defined(RGB_MATRIX_ENABLE) 86#if defined(RGB_MATRIX_ENABLE)
87 keyboard_post_init_rgb_matrix(); 87 keyboard_post_init_rgb_matrix();
88#endif 88#endif
89#if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER)
90 keyboard_post_init_transport_sync();
91#endif
89 keyboard_post_init_keymap(); 92 keyboard_post_init_keymap();
90} 93}
91 94
@@ -100,12 +103,12 @@ void shutdown_user(void) {
100 rgblight_enable_noeeprom(); 103 rgblight_enable_noeeprom();
101 rgblight_mode_noeeprom(1); 104 rgblight_mode_noeeprom(1);
102 rgblight_setrgb_red(); 105 rgblight_setrgb_red();
103#endif // RGBLIGHT_ENABLE 106#endif // RGBLIGHT_ENABLE
104#ifdef RGB_MATRIX_ENABLE 107#ifdef RGB_MATRIX_ENABLE
105 rgb_matrix_set_color_all(0xFF, 0x00, 0x00); 108 rgb_matrix_set_color_all(0xFF, 0x00, 0x00);
106 rgb_matrix_update_pwm_buffers(); 109 rgb_matrix_update_pwm_buffers();
107 110
108#endif // RGB_MATRIX_ENABLE 111#endif // RGB_MATRIX_ENABLE
109 shutdown_keymap(); 112 shutdown_keymap();
110} 113}
111 114
@@ -120,7 +123,11 @@ void suspend_power_down_user(void) {
120 123
121__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} 124__attribute__((weak)) void suspend_wakeup_init_keymap(void) {}
122 125
123void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); } 126void suspend_wakeup_init_user(void) {
127 if (layer_state_is(_GAMEPAD)) { layer_off(_GAMEPAD); }
128 if (layer_state_is(_DIABLO)) { layer_off(_DIABLO); }
129 suspend_wakeup_init_keymap();
130}
124 131
125__attribute__((weak)) void matrix_scan_keymap(void) {} 132__attribute__((weak)) void matrix_scan_keymap(void) {}
126 133
@@ -135,13 +142,13 @@ void matrix_scan_user(void) {
135 startup_user(); 142 startup_user();
136 } 143 }
137 144
138#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. 145#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
139 run_diablo_macro_check(); 146 run_diablo_macro_check();
140#endif // TAP_DANCE_ENABLE 147#endif // TAP_DANCE_ENABLE
141 148
142#if defined(RGBLIGHT_ENABLE) 149#if defined(RGBLIGHT_ENABLE)
143 matrix_scan_rgb_light(); 150 matrix_scan_rgb_light();
144#endif // RGBLIGHT_ENABLE 151#endif // RGBLIGHT_ENABLE
145#if defined(RGB_MATRIX_ENABLE) 152#if defined(RGB_MATRIX_ENABLE)
146 matrix_scan_rgb_matrix(); 153 matrix_scan_rgb_matrix();
147#endif 154#endif
@@ -160,15 +167,13 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state)
160// on layer change, no matter where the change was initiated 167// on layer change, no matter where the change was initiated
161// Then runs keymap's layer change check 168// Then runs keymap's layer change check
162layer_state_t layer_state_set_user(layer_state_t state) { 169layer_state_t layer_state_set_user(layer_state_t state) {
163 if (!is_keyboard_master()) { 170 if (!is_keyboard_master()) { return state; }
164 return state;
165 }
166 171
167 state = layer_state_set_keymap(state); 172 state = layer_state_set_keymap(state);
168 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); 173 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
169#if defined(RGBLIGHT_ENABLE) 174#if defined(RGBLIGHT_ENABLE)
170 state = layer_state_set_rgb_light(state); 175 state = layer_state_set_rgb_light(state);
171#endif // RGBLIGHT_ENABLE 176#endif // RGBLIGHT_ENABLE
172#if defined(AUDIO_ENABLE) && !defined(__arm__) 177#if defined(AUDIO_ENABLE) && !defined(__arm__)
173 static bool is_gamepad_on = false; 178 static bool is_gamepad_on = false;
174 if (layer_state_cmp(state, _GAMEPAD) != is_gamepad_on) { 179 if (layer_state_cmp(state, _GAMEPAD) != is_gamepad_on) {
@@ -187,15 +192,13 @@ __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t
187 192
188// Runs state check and changes underglow color and animation 193// Runs state check and changes underglow color and animation
189layer_state_t default_layer_state_set_user(layer_state_t state) { 194layer_state_t default_layer_state_set_user(layer_state_t state) {
190 if (!is_keyboard_master()) { 195 if (!is_keyboard_master()) { return state; }
191 return state;
192 }
193 196
194 state = default_layer_state_set_keymap(state); 197 state = default_layer_state_set_keymap(state);
195#if 0 198#if 0
196# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 199# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
197 state = default_layer_state_set_rgb(state); 200 state = default_layer_state_set_rgb(state);
198# endif // RGBLIGHT_ENABLE 201# endif // RGBLIGHT_ENABLE
199#endif 202#endif
200 return state; 203 return state;
201} 204}
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h
index e66f10657..f1d756f74 100644
--- a/users/drashna/drashna.h
+++ b/users/drashna/drashna.h
@@ -22,7 +22,7 @@
22#include "process_records.h" 22#include "process_records.h"
23#ifdef TAP_DANCE_ENABLE 23#ifdef TAP_DANCE_ENABLE
24# include "tap_dances.h" 24# include "tap_dances.h"
25#endif // TAP_DANCE_ENABLE 25#endif // TAP_DANCE_ENABLE
26#if defined(RGBLIGHT_ENABLE) 26#if defined(RGBLIGHT_ENABLE)
27# include "rgb_stuff.h" 27# include "rgb_stuff.h"
28#endif 28#endif
@@ -33,7 +33,10 @@
33# include "oled_stuff.h" 33# include "oled_stuff.h"
34#endif 34#endif
35#if defined(PIMORONI_TRACKBALL_ENABLE) 35#if defined(PIMORONI_TRACKBALL_ENABLE)
36# include "pimoroni_trackball.h" 36# include "drivers/sensors/pimoroni_trackball.h"
37#endif
38#ifdef SPLIT_KEYBOARD
39# include "transport_sync.h"
37#endif 40#endif
38 41
39/* Define layer names */ 42/* Define layer names */
@@ -98,12 +101,12 @@ We use custom codes here, so we can substitute the right stuff
98# define KC_D3_2 TD(TD_D3_2) 101# define KC_D3_2 TD(TD_D3_2)
99# define KC_D3_3 TD(TD_D3_3) 102# define KC_D3_3 TD(TD_D3_3)
100# define KC_D3_4 TD(TD_D3_4) 103# define KC_D3_4 TD(TD_D3_4)
101#else // TAP_DANCE_ENABLE 104#else // TAP_DANCE_ENABLE
102# define KC_D3_1 KC_1 105# define KC_D3_1 KC_1
103# define KC_D3_2 KC_2 106# define KC_D3_2 KC_2
104# define KC_D3_3 KC_3 107# define KC_D3_3 KC_3
105# define KC_D3_4 KC_4 108# define KC_D3_4 KC_4
106#endif // TAP_DANCE_ENABLE 109#endif // TAP_DANCE_ENABLE
107 110
108#if defined(DRASHNA_CUSTOM_TRANSPORT) && defined(POINTING_DEVICE_ENABLE) 111#if defined(DRASHNA_CUSTOM_TRANSPORT) && defined(POINTING_DEVICE_ENABLE)
109void master_mouse_send(int8_t x, int8_t y); 112void master_mouse_send(int8_t x, int8_t y);
diff --git a/users/drashna/drashna_font.h b/users/drashna/drashna_font.h
index 6a3865a44..46ebf3710 100644
--- a/users/drashna/drashna_font.h
+++ b/users/drashna/drashna_font.h
@@ -5,8 +5,9 @@
5 5
6#include "progmem.h" 6#include "progmem.h"
7 7
8// clang-format off
8static const unsigned char font[] PROGMEM = { 9static const unsigned char font[] PROGMEM = {
9 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x00 0 10 0x07, 0x08, 0x7F, 0x08, 0x07, 0x00, // 0x00 0
10 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, // 0x01 1 11 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, // 0x01 1
11 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, // 0x02 2 12 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, // 0x02 2
12 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, // 0x03 3 ♥ 13 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, // 0x03 3 ♥
@@ -1304,3 +1305,5 @@ static const unsigned char font[] PROGMEM = {
1304 1305
1305#endif 1306#endif
1306 }; 1307 };
1308
1309// clang-format on
diff --git a/users/drashna/drashna_transport.c b/users/drashna/drashna_transport.c
deleted file mode 100644
index 9df11c9bd..000000000
--- a/users/drashna/drashna_transport.c
+++ /dev/null
@@ -1,603 +0,0 @@
1/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <string.h>
18#include <stddef.h>
19
20#include "matrix.h"
21#include QMK_KEYBOARD_H
22
23#define ROWS_PER_HAND (MATRIX_ROWS / 2)
24#define SYNC_TIMER_OFFSET 2
25
26#ifdef RGBLIGHT_ENABLE
27# include "rgblight.h"
28#endif
29
30#ifdef BACKLIGHT_ENABLE
31# include "backlight.h"
32#endif
33
34#ifdef ENCODER_ENABLE
35# include "encoder.h"
36static pin_t encoders_pad[] = ENCODERS_PAD_A;
37# define NUMBER_OF_ENCODERS (sizeof(encoders_pad) / sizeof(pin_t))
38#endif
39
40#ifdef POINTING_DEVICE_ENABLE
41static uint16_t device_cpi = 0;
42static int8_t split_mouse_x = 0, split_mouse_y = 0;
43#endif
44
45#ifdef OLED_DRIVER_ENABLE
46# include "oled_driver.h"
47#endif
48
49#if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
50# include "led_matrix.h"
51#endif
52#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
53# include "rgb_matrix.h"
54#endif
55
56#if defined(USE_I2C)
57
58# include "i2c_master.h"
59# include "i2c_slave.h"
60
61typedef struct _I2C_slave_buffer_t {
62# ifndef DISABLE_SYNC_TIMER
63 uint32_t sync_timer;
64# endif
65# ifdef SPLIT_TRANSPORT_MIRROR
66 matrix_row_t mmatrix[ROWS_PER_HAND];
67# endif
68 matrix_row_t smatrix[ROWS_PER_HAND];
69# ifdef SPLIT_MODS_ENABLE
70 uint8_t real_mods;
71 uint8_t weak_mods;
72# ifndef NO_ACTION_ONESHOT
73 uint8_t oneshot_mods;
74# endif
75# endif
76# ifdef BACKLIGHT_ENABLE
77 uint8_t backlight_level;
78# endif
79# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
80 rgblight_syncinfo_t rgblight_sync;
81# endif
82# ifdef ENCODER_ENABLE
83 uint8_t encoder_state[NUMBER_OF_ENCODERS];
84# endif
85# ifdef WPM_ENABLE
86 uint8_t current_wpm;
87# endif
88# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
89 led_eeconfig_t led_matrix;
90 bool led_suspend_state;
91# endif
92# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
93 rgb_config_t rgb_matrix;
94 bool rgb_suspend_state;
95# endif
96 int8_t mouse_x;
97 int8_t mouse_y;
98 uint16_t device_cpi;
99 bool oled_on;
100 layer_state_t t_layer_state;
101 layer_state_t t_default_layer_state;
102} __attribute__((packed)) I2C_slave_buffer_t;
103
104static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_reg;
105
106# define I2C_BACKLIGHT_START offsetof(I2C_slave_buffer_t, backlight_level)
107# define I2C_RGB_START offsetof(I2C_slave_buffer_t, rgblight_sync)
108# define I2C_KEYMAP_MASTER_START offsetof(I2C_slave_buffer_t, mmatrix)
109# define I2C_KEYMAP_SLAVE_START offsetof(I2C_slave_buffer_t, smatrix)
110# define I2C_SYNC_TIME_START offsetof(I2C_slave_buffer_t, sync_timer)
111# define I2C_REAL_MODS_START offsetof(I2C_slave_buffer_t, real_mods)
112# define I2C_WEAK_MODS_START offsetof(I2C_slave_buffer_t, weak_mods)
113# define I2C_ONESHOT_MODS_START offsetof(I2C_slave_buffer_t, oneshot_mods)
114# define I2C_ENCODER_START offsetof(I2C_slave_buffer_t, encoder_state)
115# define I2C_WPM_START offsetof(I2C_slave_buffer_t, current_wpm)
116# define I2C_MOUSE_X_START offsetof(I2C_slave_buffer_t, mouse_x)
117# define I2C_MOUSE_Y_START offsetof(I2C_slave_buffer_t, mouse_y)
118# define I2C_MOUSE_DPI_START offsetof(I2C_slave_buffer_t, device_cpi)
119# define I2C_OLED_ON_START offsetof(I2C_slave_buffer_t, oled_on)
120# define I2C_LAYER_STATE_START offsetof(I2C_slave_buffer_t, t_layer_state)
121# define I2C_DEFAULT_LAYER_STATE_START offsetof(I2C_slave_buffer_t, t_default_layer_state)
122# define I2C_LED_MATRIX_START offsetof(I2C_slave_buffer_t, led_matrix)
123# define I2C_LED_SUSPEND_START offsetof(I2C_slave_buffer_t, led_suspend_state)
124# define I2C_RGB_MATRIX_START offsetof(I2C_slave_buffer_t, rgb_matrix)
125# define I2C_RGB_SUSPEND_START offsetof(I2C_slave_buffer_t, rgb_suspend_state)
126
127# define TIMEOUT 100
128
129# ifndef SLAVE_I2C_ADDRESS
130# define SLAVE_I2C_ADDRESS 0x32
131# endif
132
133// Get rows from other half over i2c
134bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
135 i2c_readReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_SLAVE_START, (void *)slave_matrix, sizeof(i2c_buffer->smatrix), TIMEOUT);
136# ifdef SPLIT_TRANSPORT_MIRROR
137 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_MASTER_START, (void *)master_matrix, sizeof(i2c_buffer->mmatrix), TIMEOUT);
138# endif
139 // write backlight info
140# ifdef BACKLIGHT_ENABLE
141 uint8_t level = is_backlight_enabled() ? get_backlight_level() : 0;
142 if (level != i2c_buffer->backlight_level) {
143 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_BACKLIGHT_START, (void *)&level, sizeof(level), TIMEOUT) >= 0) {
144 i2c_buffer->backlight_level = level;
145 }
146 }
147# endif
148
149# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
150 if (rgblight_get_change_flags()) {
151 rgblight_syncinfo_t rgblight_sync;
152 rgblight_get_syncinfo(&rgblight_sync);
153 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_RGB_START, (void *)&rgblight_sync, sizeof(rgblight_sync), TIMEOUT) >= 0) {
154 rgblight_clear_change_flags();
155 }
156 }
157# endif
158
159# ifdef ENCODER_ENABLE
160 i2c_readReg(SLAVE_I2C_ADDRESS, I2C_ENCODER_START, (void *)i2c_buffer->encoder_state, sizeof(i2c_buffer->encoder_state), TIMEOUT);
161 encoder_update_raw(i2c_buffer->encoder_state);
162# endif
163
164# ifdef WPM_ENABLE
165 uint8_t current_wpm = get_current_wpm();
166 if (current_wpm != i2c_buffer->current_wpm) {
167 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_WPM_START, (void *)&current_wpm, sizeof(current_wpm), TIMEOUT) >= 0) {
168 i2c_buffer->current_wpm = current_wpm;
169 }
170 }
171# endif
172
173# ifdef POINTING_DEVICE_ENABLE
174 if (is_keyboard_left()) {
175 report_mouse_t temp_report = pointing_device_get_report();
176 i2c_readReg(SLAVE_I2C_ADDRESS, I2C_MOUSE_X_START, (void *)&i2c_buffer->mouse_x, sizeof(i2c_buffer->mouse_x), TIMEOUT);
177 temp_report.x = i2c_buffer->mouse_x;
178 i2c_readReg(SLAVE_I2C_ADDRESS, I2C_MOUSE_Y_START, (void *)&i2c_buffer->mouse_y, sizeof(i2c_buffer->mouse_y), TIMEOUT);
179 temp_report.y = i2c_buffer->mouse_y;
180 pointing_device_set_report(temp_report);
181
182 if (device_cpi != i2c_buffer->device_cpi) {
183 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MOUSE_DPI_START, (void *)&device_cpi, sizeof(device_cpi), TIMEOUT) >= 0) {
184 i2c_buffer->device_cpi = device_cpi
185 }
186 }
187 }
188# endif
189
190# ifdef SPLIT_MODS_ENABLE
191 uint8_t real_mods = get_mods();
192 if (real_mods != i2c_buffer->real_mods) {
193 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_REAL_MODS_START, (void *)&real_mods, sizeof(real_mods), TIMEOUT) >= 0) {
194 i2c_buffer->real_mods = real_mods;
195 }
196 }
197
198 uint8_t weak_mods = get_weak_mods();
199 if (weak_mods != i2c_buffer->weak_mods) {
200 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_WEAK_MODS_START, (void *)&weak_mods, sizeof(weak_mods), TIMEOUT) >= 0) {
201 i2c_buffer->weak_mods = weak_mods;
202 }
203 }
204
205# ifndef NO_ACTION_ONESHOT
206 uint8_t oneshot_mods = get_oneshot_mods();
207 if (oneshot_mods != i2c_buffer->oneshot_mods) {
208 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_ONESHOT_MODS_START, (void *)&oneshot_mods, sizeof(oneshot_mods), TIMEOUT) >= 0) {
209 i2c_buffer->oneshot_mods = oneshot_mods;
210 }
211 }
212# endif
213# endif
214
215 if (layer_state != i2c_buffer->t_layer_state) {
216 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_LAYER_STATE_START, (void *)&layer_state, sizeof(layer_state), TIMEOUT) >= 0) {
217 i2c_buffer->t_layer_state = layer_state;
218 }
219 }
220
221 if (default_layer_state != i2c_buffer->t_default_layer_state) {
222 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_DEFAULT_LAYER_STATE_START, (void *)&default_layer_state, sizeof(default_layer_state), TIMEOUT) >= 0) {
223 i2c_buffer->t_default_layer_state = default_layer_state;
224 }
225 }
226
227# ifdef OLED_DRIVER_ENABLE
228 bool is_oled_on = is_oled_on();
229 if (is_oled_on != i2c_buffer->oled_on) {
230 if (i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_LAYER_STATE_START, (void *)&is_oled_on, sizeof(is_oled_on), TIMEOUT) >= 0) {
231 i2c_buffer->oled_on = is_oled_on;
232 }
233 }
234# endif
235
236# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
237 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_LED_MATRIX_START, (void *)led_matrix_eeconfig, sizeof(i2c_buffer->led_matrix), TIMEOUT);
238 bool suspend_state = led_matrix_get_suspend_state();
239 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_LED_SUSPEND_START, (void *)suspend_state, sizeof(i2c_buffer->led_suspend_state), TIMEOUT);
240# endif
241# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
242 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_RGB_MATRIX_START, (void *)rgb_matrix_config, sizeof(i2c_buffer->rgb_matrix), TIMEOUT);
243 bool suspend_state = rgb_matrix_get_suspend_state();
244 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_RGB_SUSPEND_START, (void *)suspend_state, sizeof(i2c_buffer->rgb_suspend_state), TIMEOUT);
245# endif
246
247# ifndef DISABLE_SYNC_TIMER
248 i2c_buffer->sync_timer = sync_timer_read32() + SYNC_TIMER_OFFSET;
249 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_SYNC_TIME_START, (void *)&i2c_buffer->sync_timer, sizeof(i2c_buffer->sync_timer), TIMEOUT);
250# endif
251
252 return true;
253}
254
255void transport_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
256# ifndef DISABLE_SYNC_TIMER
257 sync_timer_update(i2c_buffer->sync_timer);
258# endif
259 // Copy matrix to I2C buffer
260 memcpy((void *)i2c_buffer->smatrix, (void *)slave_matrix, sizeof(i2c_buffer->smatrix));
261# ifdef SPLIT_TRANSPORT_MIRROR
262 memcpy((void *)master_matrix, (void *)i2c_buffer->mmatrix, sizeof(i2c_buffer->mmatrix));
263# endif
264
265// Read Backlight Info
266# ifdef BACKLIGHT_ENABLE
267 backlight_set(i2c_buffer->backlight_level);
268# endif
269
270# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
271 // Update the RGB with the new data
272 if (i2c_buffer->rgblight_sync.status.change_flags != 0) {
273 rgblight_update_sync(&i2c_buffer->rgblight_sync, false);
274 i2c_buffer->rgblight_sync.status.change_flags = 0;
275 }
276# endif
277
278# ifdef ENCODER_ENABLE
279 encoder_state_raw(i2c_buffer->encoder_state);
280# endif
281
282# ifdef WPM_ENABLE
283 set_current_wpm(i2c_buffer->current_wpm);
284# endif
285
286# ifdef POINTING_DEVICE_ENABLE
287 if (!is_keyboard_left()) {
288 static uint16_t cpi;
289 if (cpi != i2c_buffer->device_cpi) {
290 cpi = i2c_buffer->device_cpi;
291 pmw_set_cpi(cpi);
292 }
293 i2c_buffer->mouse_x = split_mouse_x;
294 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MOUSE_X_START, (void *)&i2c_buffer->mouse_x, sizeof(i2c_buffer->mouse_x), TIMEOUT);
295 i2c_buffer->mouse_y = split_mouse_y;
296 i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_MOUSE_Y_START, (void *)&i2c_buffer->mouse_y, sizeof(i2c_buffer->mouse_y), TIMEOUT);
297 }
298
299# endif
300
301# ifdef SPLIT_MODS_ENABLE
302 set_mods(i2c_buffer->real_mods);
303 set_weak_mods(i2c_buffer->weak_mods);
304# ifndef NO_ACTION_ONESHOT
305 set_oneshot_mods(i2c_buffer->oneshot_mods);
306# endif
307# endif
308
309 if (layer_state != i2c_buffer->t_layer_state) {
310 layer_state = i2c_buffer->t_layer_state;
311 }
312 if (default_layer_state != i2c_buffer->t_default_layer_state) {
313 default_layer_state = i2c_buffer->t_default_layer_state;
314 }
315
316# ifdef OLED_DRIVER_ENABLE
317 if (i2c_buffer->oled_on) {
318 oled_on();
319 } else {
320 oled_off();
321 }
322# endif
323
324# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
325 memcpy((void *)i2c_buffer->led_matrix, (void *)led_matrix_eeconfig, sizeof(i2c_buffer->led_matrix));
326 led_matrix_set_suspend_state(i2c_buffer->led_suspend_state);
327# endif
328# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
329 memcpy((void *)i2c_buffer->rgb_matrix, (void *)rgb_matrix_config, sizeof(i2c_buffer->rgb_matrix));
330 rgb_matrix_set_suspend_state(i2c_buffer->rgb_suspend_state);
331# endif
332}
333
334void transport_master_init(void) { i2c_init(); }
335
336void transport_slave_init(void) { i2c_slave_init(SLAVE_I2C_ADDRESS); }
337
338#else // USE_SERIAL
339
340# include "serial.h"
341
342typedef struct _Serial_s2m_buffer_t {
343 // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack
344 matrix_row_t smatrix[ROWS_PER_HAND];
345# ifdef ENCODER_ENABLE
346 uint8_t encoder_state[NUMBER_OF_ENCODERS];
347# endif
348 int8_t mouse_x;
349 int8_t mouse_y;
350} __attribute__((packed)) Serial_s2m_buffer_t;
351
352typedef struct _Serial_m2s_buffer_t {
353# ifdef SPLIT_MODS_ENABLE
354 uint8_t real_mods;
355 uint8_t weak_mods;
356# ifndef NO_ACTION_ONESHOT
357 uint8_t oneshot_mods;
358# endif
359# endif
360# ifndef DISABLE_SYNC_TIMER
361 uint32_t sync_timer;
362# endif
363# ifdef SPLIT_TRANSPORT_MIRROR
364 matrix_row_t mmatrix[ROWS_PER_HAND];
365# endif
366# ifdef BACKLIGHT_ENABLE
367 uint8_t backlight_level;
368# endif
369# ifdef WPM_ENABLE
370 uint8_t current_wpm;
371# endif
372 uint16_t device_cpi;
373 bool oled_on;
374 layer_state_t t_layer_state;
375 layer_state_t t_default_layer_state;
376# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
377 led_eeconfig_t led_matrix;
378 bool led_suspend_state;
379# endif
380# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
381 rgb_config_t rgb_matrix;
382 bool rgb_suspend_state;
383# endif
384} __attribute__((packed)) Serial_m2s_buffer_t;
385
386# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
387// When MCUs on both sides drive their respective RGB LED chains,
388// it is necessary to synchronize, so it is necessary to communicate RGB
389// information. In that case, define RGBLIGHT_SPLIT with info on the number
390// of LEDs on each half.
391//
392// Otherwise, if the master side MCU drives both sides RGB LED chains,
393// there is no need to communicate.
394
395typedef struct _Serial_rgblight_t {
396 rgblight_syncinfo_t rgblight_sync;
397} Serial_rgblight_t;
398
399volatile Serial_rgblight_t serial_rgblight = {};
400uint8_t volatile status_rgblight = 0;
401# endif
402
403volatile Serial_s2m_buffer_t serial_s2m_buffer = {};
404volatile Serial_m2s_buffer_t serial_m2s_buffer = {};
405uint8_t volatile status0 = 0;
406
407enum serial_transaction_id {
408 GET_SLAVE_MATRIX = 0,
409# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
410 PUT_RGBLIGHT,
411# endif
412};
413
414SSTD_t transactions[] = {
415 [GET_SLAVE_MATRIX] =
416 {
417 (uint8_t *)&status0,
418 sizeof(serial_m2s_buffer),
419 (uint8_t *)&serial_m2s_buffer,
420 sizeof(serial_s2m_buffer),
421 (uint8_t *)&serial_s2m_buffer,
422 },
423# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
424 [PUT_RGBLIGHT] =
425 {
426 (uint8_t *)&status_rgblight, sizeof(serial_rgblight), (uint8_t *)&serial_rgblight, 0, NULL // no slave to master transfer
427 },
428# endif
429};
430
431void transport_master_init(void) { soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); }
432
433void transport_slave_init(void) { soft_serial_target_init(transactions, TID_LIMIT(transactions)); }
434
435# if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
436
437// rgblight synchronization information communication.
438
439void transport_rgblight_master(void) {
440 if (rgblight_get_change_flags()) {
441 rgblight_get_syncinfo((rgblight_syncinfo_t *)&serial_rgblight.rgblight_sync);
442 if (soft_serial_transaction(PUT_RGBLIGHT) == TRANSACTION_END) {
443 rgblight_clear_change_flags();
444 }
445 }
446}
447
448void transport_rgblight_slave(void) {
449 if (status_rgblight == TRANSACTION_ACCEPTED) {
450 rgblight_update_sync((rgblight_syncinfo_t *)&serial_rgblight.rgblight_sync, false);
451 status_rgblight = TRANSACTION_END;
452 }
453}
454
455# else
456# define transport_rgblight_master()
457# define transport_rgblight_slave()
458# endif
459
460bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
461# ifndef SERIAL_USE_MULTI_TRANSACTION
462 if (soft_serial_transaction() != TRANSACTION_END) {
463 return false;
464 }
465# else
466 transport_rgblight_master();
467 if (soft_serial_transaction(GET_SLAVE_MATRIX) != TRANSACTION_END) {
468 return false;
469 }
470# endif
471
472 // TODO: if MATRIX_COLS > 8 change to unpack()
473 for (int i = 0; i < ROWS_PER_HAND; ++i) {
474 slave_matrix[i] = serial_s2m_buffer.smatrix[i];
475# ifdef SPLIT_TRANSPORT_MIRROR
476 serial_m2s_buffer.mmatrix[i] = master_matrix[i];
477# endif
478 }
479
480# ifdef BACKLIGHT_ENABLE
481 // Write backlight level for slave to read
482 serial_m2s_buffer.backlight_level = is_backlight_enabled() ? get_backlight_level() : 0;
483# endif
484
485# ifdef ENCODER_ENABLE
486 encoder_update_raw((uint8_t *)serial_s2m_buffer.encoder_state);
487# endif
488
489# ifdef WPM_ENABLE
490 // Write wpm to slave
491 serial_m2s_buffer.current_wpm = get_current_wpm();
492# endif
493
494# ifdef SPLIT_MODS_ENABLE
495 serial_m2s_buffer.real_mods = get_mods();
496 serial_m2s_buffer.weak_mods = get_weak_mods();
497# ifndef NO_ACTION_ONESHOT
498 serial_m2s_buffer.oneshot_mods = get_oneshot_mods();
499# endif
500# endif
501
502# ifdef POINTING_DEVICE_ENABLE
503 if (is_keyboard_left()) {
504 report_mouse_t temp_report = pointing_device_get_report();
505 temp_report.x = serial_s2m_buffer.mouse_x;
506 temp_report.y = serial_s2m_buffer.mouse_y;
507 pointing_device_set_report(temp_report);
508 serial_m2s_buffer.device_cpi = device_cpi;
509 }
510# endif
511
512 serial_m2s_buffer.t_layer_state = layer_state;
513 serial_m2s_buffer.t_default_layer_state = default_layer_state;
514# ifdef OLED_DRIVER_ENABLE
515 serial_m2s_buffer.oled_on = is_oled_on();
516# endif
517
518# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
519 serial_m2s_buffer.led_matrix = led_matrix_eeconfig;
520 serial_m2s_buffer.led_suspend_state = led_matrix_get_suspend_state();
521# endif
522# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
523 serial_m2s_buffer.rgb_matrix = rgb_matrix_config;
524 serial_m2s_buffer.rgb_suspend_state = rgb_matrix_get_suspend_state();
525# endif
526
527# ifndef DISABLE_SYNC_TIMER
528 serial_m2s_buffer.sync_timer = sync_timer_read32() + SYNC_TIMER_OFFSET;
529# endif
530 return true;
531}
532
533void transport_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
534 transport_rgblight_slave();
535# ifndef DISABLE_SYNC_TIMER
536 sync_timer_update(serial_m2s_buffer.sync_timer);
537# endif
538
539 // TODO: if MATRIX_COLS > 8 change to pack()
540 for (int i = 0; i < ROWS_PER_HAND; ++i) {
541 serial_s2m_buffer.smatrix[i] = slave_matrix[i];
542# ifdef SPLIT_TRANSPORT_MIRROR
543 master_matrix[i] = serial_m2s_buffer.mmatrix[i];
544# endif
545 }
546
547# ifdef BACKLIGHT_ENABLE
548 backlight_set(serial_m2s_buffer.backlight_level);
549# endif
550
551# ifdef ENCODER_ENABLE
552 encoder_state_raw((uint8_t *)serial_s2m_buffer.encoder_state);
553# endif
554
555# ifdef WPM_ENABLE
556 set_current_wpm(serial_m2s_buffer.current_wpm);
557# endif
558
559# ifdef SPLIT_MODS_ENABLE
560 set_mods(serial_m2s_buffer.real_mods);
561 set_weak_mods(serial_m2s_buffer.weak_mods);
562# ifndef NO_ACTION_ONESHOT
563 set_oneshot_mods(serial_m2s_buffer.oneshot_mods);
564# endif
565# endif
566
567# ifdef POINTING_DEVICE_ENABLE
568 if (!is_keyboard_left()) {
569 static uint16_t cpi;
570 if (cpi != serial_m2s_buffer.device_cpi) {
571 cpi = serial_m2s_buffer.device_cpi;
572 pmw_set_cpi(cpi);
573 }
574 serial_s2m_buffer.mouse_x = split_mouse_x;
575 serial_s2m_buffer.mouse_y = split_mouse_y;
576 }
577# endif
578
579 if (layer_state != serial_m2s_buffer.t_layer_state) {
580 layer_state = serial_m2s_buffer.t_layer_state;
581 }
582 if (default_layer_state != serial_m2s_buffer.t_default_layer_state) {
583 default_layer_state = serial_m2s_buffer.t_default_layer_state;
584 }
585# ifdef OLED_DRIVER_ENABLE
586 if (serial_m2s_buffer.oled_on) {
587 oled_on();
588 } else {
589 oled_off();
590 }
591# endif
592
593# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
594 led_matrix_eeconfig = serial_m2s_buffer.led_matrix;
595 led_matrix_set_suspend_state(serial_m2s_buffer.led_suspend_state);
596# endif
597# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
598 rgb_matrix_config = serial_m2s_buffer.rgb_matrix;
599 rgb_matrix_set_suspend_state(serial_m2s_buffer.rgb_suspend_state);
600# endif
601}
602
603#endif
diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c
index 98e467d93..253c5181e 100644
--- a/users/drashna/oled_stuff.c
+++ b/users/drashna/oled_stuff.c
@@ -25,7 +25,7 @@
25#endif 25#endif
26 26
27uint32_t oled_timer = 0; 27uint32_t oled_timer = 0;
28static char keylog_str[KEYLOGGER_LENGTH + 1] = {"\n"}; 28static char keylog_str[KEYLOGGER_LENGTH + 1] = { 0 };
29static uint16_t log_timer = 0; 29static uint16_t log_timer = 0;
30 30
31// clang-format off 31// clang-format off
@@ -57,12 +57,12 @@ void add_keylog(uint16_t keycode) {
57 keycode = 0; 57 keycode = 0;
58 } 58 }
59 59
60 for (uint8_t i = (KEYLOGGER_LENGTH - 1); i > 0; --i) { 60 for (uint8_t i = 1; i < KEYLOGGER_LENGTH; i++) {
61 keylog_str[i] = keylog_str[i - 1]; 61 keylog_str[i-1] = keylog_str[i];
62 } 62 }
63 63
64 if (keycode < (sizeof(code_to_name) / sizeof(char))) { 64 if (keycode < (sizeof(code_to_name) / sizeof(char))) {
65 keylog_str[0] = pgm_read_byte(&code_to_name[keycode]); 65 keylog_str[(KEYLOGGER_LENGTH - 1)] = pgm_read_byte(&code_to_name[keycode]);
66 } 66 }
67 67
68 log_timer = timer_read(); 68 log_timer = timer_read();
@@ -92,30 +92,14 @@ void render_keylogger_status(void) {
92void render_default_layer_state(void) { 92void render_default_layer_state(void) {
93 oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); 93 oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false);
94 switch (get_highest_layer(default_layer_state)) { 94 switch (get_highest_layer(default_layer_state)) {
95 case _QWERTY: 95 case _QWERTY: oled_write_P(PSTR(OLED_RENDER_LAYOUT_QWERTY), false); break;
96 oled_write_P(PSTR(OLED_RENDER_LAYOUT_QWERTY), false); 96 case _COLEMAK: oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK), false); break;
97 break; 97 case _DVORAK: oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); break;
98 case _COLEMAK: 98 case _WORKMAN: oled_write_P(PSTR(OLED_RENDER_LAYOUT_WORKMAN), false); break;
99 oled_write_P(PSTR(OLED_RENDER_LAYOUT_COLEMAK), false); 99 case _NORMAN: oled_write_P(PSTR(OLED_RENDER_LAYOUT_NORMAN), false); break;
100 break; 100 case _MALTRON: oled_write_P(PSTR(OLED_RENDER_LAYOUT_MALTRON), false); break;
101 case _DVORAK: 101 case _EUCALYN: oled_write_P(PSTR(OLED_RENDER_LAYOUT_EUCALYN), false); break;
102 oled_write_P(PSTR(OLED_RENDER_LAYOUT_DVORAK), false); 102 case _CARPLAX: oled_write_P(PSTR(OLED_RENDER_LAYOUT_CARPLAX), false); break;
103 break;
104 case _WORKMAN:
105 oled_write_P(PSTR(OLED_RENDER_LAYOUT_WORKMAN), false);
106 break;
107 case _NORMAN:
108 oled_write_P(PSTR(OLED_RENDER_LAYOUT_NORMAN), false);
109 break;
110 case _MALTRON:
111 oled_write_P(PSTR(OLED_RENDER_LAYOUT_MALTRON), false);
112 break;
113 case _EUCALYN:
114 oled_write_P(PSTR(OLED_RENDER_LAYOUT_EUCALYN), false);
115 break;
116 case _CARPLAX:
117 oled_write_P(PSTR(OLED_RENDER_LAYOUT_CARPLAX), false);
118 break;
119 } 103 }
120#ifdef OLED_DISPLAY_128X64 104#ifdef OLED_DISPLAY_128X64
121 oled_advance_page(true); 105 oled_advance_page(true);
@@ -159,12 +143,12 @@ void render_keylock_status(uint8_t led_usb_state) {
159} 143}
160void render_matrix_scan_rate(void) { 144void render_matrix_scan_rate(void) {
161#ifdef DEBUG_MATRIX_SCAN_RATE 145#ifdef DEBUG_MATRIX_SCAN_RATE
162 char matrix_rate[5]; 146 char matrix_rate[5];
163 uint16_t n = get_matrix_scan_rate(); 147 uint16_t n = get_matrix_scan_rate();
164 matrix_rate[4] = '\0'; 148 matrix_rate[4] = '\0';
165 matrix_rate[3] = '0' + n % 10; 149 matrix_rate[3] = '0' + n % 10;
166 matrix_rate[2] = ( n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; 150 matrix_rate[2] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
167 matrix_rate[1] = n / 10 ? '0' + n / 10 : ' '; 151 matrix_rate[1] = n / 10 ? '0' + n / 10 : ' ';
168 matrix_rate[0] = ' '; 152 matrix_rate[0] = ' ';
169 oled_write_P(PSTR("MS:"), false); 153 oled_write_P(PSTR("MS:"), false);
170 oled_write(matrix_rate, false); 154 oled_write(matrix_rate, false);
@@ -284,6 +268,10 @@ void render_user_status(void) {
284 oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false); 268 oled_write_P(rgb_layer_status[userspace_config.rgb_layer_change], false);
285 static const char PROGMEM nukem_good[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}}; 269 static const char PROGMEM nukem_good[2][3] = {{0xF8, 0xF9, 0}, {0xF6, 0xF7, 0}};
286 oled_write_P(nukem_good[0], userspace_config.nuke_switch); 270 oled_write_P(nukem_good[0], userspace_config.nuke_switch);
271#if defined(UNICODE_ENABLE)
272 static const char PROGMEM uc_mod_status[5][3] = {{0xEA, 0xEB, 0}, {0xEC, 0xED, 0}};
273 oled_write_P(uc_mod_status[get_unicode_input_mode() == UC_MAC], false);
274#endif
287#if defined(OLED_DISPLAY_128X64) 275#if defined(OLED_DISPLAY_128X64)
288 oled_advance_page(true); 276 oled_advance_page(true);
289#endif 277#endif
@@ -306,34 +294,34 @@ void render_wpm(void) {
306 char wpm_counter[4]; 294 char wpm_counter[4];
307 wpm_counter[3] = '\0'; 295 wpm_counter[3] = '\0';
308 wpm_counter[2] = '0' + n % 10; 296 wpm_counter[2] = '0' + n % 10;
309 wpm_counter[1] = ( n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; 297 wpm_counter[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
310 wpm_counter[0] = n / 10 ? '0' + n / 10 : ' '; 298 wpm_counter[0] = n / 10 ? '0' + n / 10 : ' ';
311# else 299# else
312 char wpm_counter[6]; 300 char wpm_counter[6];
313 wpm_counter[5] = '\0'; 301 wpm_counter[5] = '\0';
314 wpm_counter[4] = '0' + n % 10; 302 wpm_counter[4] = '0' + n % 10;
315 wpm_counter[3] = ( n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; 303 wpm_counter[3] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
316 wpm_counter[2] = n / 10 ? '0' + n / 10 : ' '; 304 wpm_counter[2] = n / 10 ? '0' + n / 10 : ' ';
317 wpm_counter[1] = ' '; 305 wpm_counter[1] = ' ';
318 wpm_counter[0] = ' '; 306 wpm_counter[0] = ' ';
319 # endif 307# endif
320 oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false); 308 oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false);
321 oled_write(wpm_counter, false); 309 oled_write(wpm_counter, false);
322#endif 310#endif
323} 311}
324 312
325#ifdef KEYBOARD_handwired_dactyl_manuform_5x6_right_trackball 313#if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right)
326extern keyboard_config_t keyboard_config; 314extern keyboard_config_t keyboard_config;
327extern uint16_t dpi_array[]; 315extern uint16_t dpi_array[];
328 316
329void render_pointing_dpi_status(void) { 317void render_pointing_dpi_status(void) {
330 char dpi_status[6]; 318 char dpi_status[6];
331 uint16_t n = dpi_array[keyboard_config.dpi_config]; 319 uint16_t n = dpi_array[keyboard_config.dpi_config];
332 dpi_status[5] = '\0'; 320 dpi_status[5] = '\0';
333 dpi_status[4] = '0' + n % 10; 321 dpi_status[4] = '0' + n % 10;
334 dpi_status[3] = ( n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; 322 dpi_status[3] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
335 dpi_status[2] = ( n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; 323 dpi_status[2] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
336 dpi_status[1] = n / 10 ? '0' + n / 10 : ' '; 324 dpi_status[1] = n / 10 ? '0' + n / 10 : ' ';
337 dpi_status[0] = ' '; 325 dpi_status[0] = ' ';
338 oled_write_P(PSTR(" DPI: "), false); 326 oled_write_P(PSTR(" DPI: "), false);
339 oled_write(dpi_status, false); 327 oled_write(dpi_status, false);
@@ -360,7 +348,7 @@ void render_status_main(void) {
360# else 348# else
361 render_wpm(); 349 render_wpm();
362# endif 350# endif
363# ifdef KEYBOARD_handwired_dactyl_manuform_5x6_right_trackball 351# if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right)
364 render_pointing_dpi_status(); 352 render_pointing_dpi_status();
365# endif 353# endif
366 oled_write_P(PSTR("\n"), false); 354 oled_write_P(PSTR("\n"), false);
@@ -375,6 +363,15 @@ void render_status_main(void) {
375 render_keylogger_status(); 363 render_keylogger_status();
376} 364}
377 365
366__attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; }
367
368oled_rotation_t oled_init_user(oled_rotation_t rotation) {
369 for (uint8_t i = 0; i < (KEYLOGGER_LENGTH - 1); i++) {
370 add_keylog(0);
371 }
372 return oled_init_keymap(rotation);
373}
374
378void oled_task_user(void) { 375void oled_task_user(void) {
379 update_log(); 376 update_log();
380 377
@@ -385,7 +382,7 @@ void oled_task_user(void) {
385 } else { 382 } else {
386 oled_on(); 383 oled_on();
387 } 384 }
388 render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) 385 render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
389 } else { 386 } else {
390 render_status_secondary(); 387 render_status_secondary();
391 } 388 }
diff --git a/users/drashna/oled_stuff.h b/users/drashna/oled_stuff.h
index 1f4440bd4..ad9cf09ed 100644
--- a/users/drashna/oled_stuff.h
+++ b/users/drashna/oled_stuff.h
@@ -19,97 +19,98 @@
19#include "quantum.h" 19#include "quantum.h"
20#include "oled_driver.h" 20#include "oled_driver.h"
21 21
22void oled_driver_render_logo(void); 22void oled_driver_render_logo(void);
23bool process_record_user_oled(uint16_t keycode, keyrecord_t *record); 23bool process_record_user_oled(uint16_t keycode, keyrecord_t *record);
24oled_rotation_t oled_init_keymap(oled_rotation_t rotation);
24extern uint32_t oled_timer; 25extern uint32_t oled_timer;
25 26
26#ifdef OLED_DISPLAY_128X64 27#ifdef OLED_DISPLAY_128X64
27# define OLED_RENDER_KEYLOGGER "Keylogger: " 28# define OLED_RENDER_KEYLOGGER "Keylogger: "
28 29
29# define OLED_RENDER_LAYOUT_NAME "Layout: " 30# define OLED_RENDER_LAYOUT_NAME "Layout: "
30# define OLED_RENDER_LAYOUT_QWERTY "Qwerty" 31# define OLED_RENDER_LAYOUT_QWERTY "Qwerty"
31# define OLED_RENDER_LAYOUT_COLEMAK "Colemak" 32# define OLED_RENDER_LAYOUT_COLEMAK "Colemak"
32# define OLED_RENDER_LAYOUT_DVORAK "Dvorak" 33# define OLED_RENDER_LAYOUT_DVORAK "Dvorak"
33# define OLED_RENDER_LAYOUT_WORKMAN "Workman" 34# define OLED_RENDER_LAYOUT_WORKMAN "Workman"
34# define OLED_RENDER_LAYOUT_NORMAN "Norman" 35# define OLED_RENDER_LAYOUT_NORMAN "Norman"
35# define OLED_RENDER_LAYOUT_MALTRON "Matron" 36# define OLED_RENDER_LAYOUT_MALTRON "Matron"
36# define OLED_RENDER_LAYOUT_EUCALYN "Eucalyn" 37# define OLED_RENDER_LAYOUT_EUCALYN "Eucalyn"
37# define OLED_RENDER_LAYOUT_CARPLAX "Carplax" 38# define OLED_RENDER_LAYOUT_CARPLAX "Carplax"
38 39
39# define OLED_RENDER_LAYER_NAME "Layer:" 40# define OLED_RENDER_LAYER_NAME "Layer:"
40# define OLED_RENDER_LAYER_LOWER "Lower" 41# define OLED_RENDER_LAYER_LOWER "Lower"
41# define OLED_RENDER_LAYER_RAISE "Raise" 42# define OLED_RENDER_LAYER_RAISE "Raise"
42# define OLED_RENDER_LAYER_ADJUST "Adjust" 43# define OLED_RENDER_LAYER_ADJUST "Adjust"
43# define OLED_RENDER_LAYER_MODS "Mods" 44# define OLED_RENDER_LAYER_MODS "Mods"
44 45
45# define OLED_RENDER_LOCK_NAME "Lock: " 46# define OLED_RENDER_LOCK_NAME "Lock: "
46# define OLED_RENDER_LOCK_NUML "NUML" 47# define OLED_RENDER_LOCK_NUML "NUML"
47# define OLED_RENDER_LOCK_CAPS "CAPS" 48# define OLED_RENDER_LOCK_CAPS "CAPS"
48# define OLED_RENDER_LOCK_SCLK "SCLK" 49# define OLED_RENDER_LOCK_SCLK "SCLK"
49 50
50# define OLED_RENDER_MODS_NAME "Mods:" 51# define OLED_RENDER_MODS_NAME "Mods:"
51# define OLED_RENDER_MODS_SFT "Sft" 52# define OLED_RENDER_MODS_SFT "Sft"
52# define OLED_RENDER_MODS_CTL "Ctl" 53# define OLED_RENDER_MODS_CTL "Ctl"
53# define OLED_RENDER_MODS_ALT "Alt" 54# define OLED_RENDER_MODS_ALT "Alt"
54# define OLED_RENDER_MODS_GUI "GUI" 55# define OLED_RENDER_MODS_GUI "GUI"
55 56
56# define OLED_RENDER_BOOTMAGIC_NAME "Boot " 57# define OLED_RENDER_BOOTMAGIC_NAME "Boot "
57# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" 58# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO"
58# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" 59# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI"
59# define OLED_RENDER_BOOTMAGIC_GRV "GRV" 60# define OLED_RENDER_BOOTMAGIC_GRV "GRV"
60# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" 61# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT"
61# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" 62# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP"
62# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" 63# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS"
63 64
64# define OLED_RENDER_USER_NAME "USER:" 65# define OLED_RENDER_USER_NAME "USER:"
65# define OLED_RENDER_USER_ANIM "Anim" 66# define OLED_RENDER_USER_ANIM "Anim"
66# define OLED_RENDER_USER_LAYR "Layr" 67# define OLED_RENDER_USER_LAYR "Layr"
67# define OLED_RENDER_USER_NUKE "Nuke" 68# define OLED_RENDER_USER_NUKE "Nuke"
68 69
69# define OLED_RENDER_WPM_COUNTER "WPM: " 70# define OLED_RENDER_WPM_COUNTER "WPM: "
70#else 71#else
71# define OLED_RENDER_KEYLOGGER "KLogr" 72# define OLED_RENDER_KEYLOGGER "KLogr"
72 73
73# define OLED_RENDER_LAYOUT_NAME "Lyout" 74# define OLED_RENDER_LAYOUT_NAME "Lyout"
74# define OLED_RENDER_LAYOUT_QWERTY " QRTY" 75# define OLED_RENDER_LAYOUT_QWERTY " QRTY"
75# define OLED_RENDER_LAYOUT_COLEMAK " COLE" 76# define OLED_RENDER_LAYOUT_COLEMAK " COLE"
76# define OLED_RENDER_LAYOUT_DVORAK " DVRK" 77# define OLED_RENDER_LAYOUT_DVORAK " DVRK"
77# define OLED_RENDER_LAYOUT_WORKMAN " WKMN" 78# define OLED_RENDER_LAYOUT_WORKMAN " WKMN"
78# define OLED_RENDER_LAYOUT_NORMAN " NORM" 79# define OLED_RENDER_LAYOUT_NORMAN " NORM"
79# define OLED_RENDER_LAYOUT_MALTRON " MLTN" 80# define OLED_RENDER_LAYOUT_MALTRON " MLTN"
80# define OLED_RENDER_LAYOUT_EUCALYN " ECLN" 81# define OLED_RENDER_LAYOUT_EUCALYN " ECLN"
81# define OLED_RENDER_LAYOUT_CARPLAX " CRPX" 82# define OLED_RENDER_LAYOUT_CARPLAX " CRPX"
82 83
83# define OLED_RENDER_LAYER_NAME "LAYER" 84# define OLED_RENDER_LAYER_NAME "LAYER"
84# define OLED_RENDER_LAYER_LOWER "Lower" 85# define OLED_RENDER_LAYER_LOWER "Lower"
85# define OLED_RENDER_LAYER_RAISE "Raise" 86# define OLED_RENDER_LAYER_RAISE "Raise"
86# define OLED_RENDER_LAYER_ADJUST "Adjst" 87# define OLED_RENDER_LAYER_ADJUST "Adjst"
87# define OLED_RENDER_LAYER_MODS " Mods" 88# define OLED_RENDER_LAYER_MODS " Mods"
88 89
89# define OLED_RENDER_LOCK_NAME "Lock:" 90# define OLED_RENDER_LOCK_NAME "Lock:"
90# define OLED_RENDER_LOCK_NUML "NumL" 91# define OLED_RENDER_LOCK_NUML "NumL"
91# define OLED_RENDER_LOCK_CAPS "CapL" 92# define OLED_RENDER_LOCK_CAPS "CapL"
92# define OLED_RENDER_LOCK_SCLK "ScrL" 93# define OLED_RENDER_LOCK_SCLK "ScrL"
93 94
94# define OLED_RENDER_MODS_NAME "Mods: " 95# define OLED_RENDER_MODS_NAME "Mods: "
95# define OLED_RENDER_MODS_SFT "Shft" 96# define OLED_RENDER_MODS_SFT "Shft"
96# define OLED_RENDER_MODS_CTL "Ctrl" 97# define OLED_RENDER_MODS_CTL "Ctrl"
97# define OLED_RENDER_MODS_ALT "Alt\n" 98# define OLED_RENDER_MODS_ALT "Alt\n"
98# define OLED_RENDER_MODS_GUI "GUI\n" 99# define OLED_RENDER_MODS_GUI "GUI\n"
99 100
100# define OLED_RENDER_BOOTMAGIC_NAME "BTMGK" 101# define OLED_RENDER_BOOTMAGIC_NAME "BTMGK"
101# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO" 102# define OLED_RENDER_BOOTMAGIC_NKRO "NKRO"
102# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI" 103# define OLED_RENDER_BOOTMAGIC_NOGUI "nGUI"
103# define OLED_RENDER_BOOTMAGIC_GRV "GRV" 104# define OLED_RENDER_BOOTMAGIC_GRV "GRV"
104# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT" 105# define OLED_RENDER_BOOTMAGIC_ONESHOT "1SHT"
105# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP" 106# define OLED_RENDER_BOOTMAGIC_SWAP "SWAP"
106# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS" 107# define OLED_RENDER_BOOTMAGIC_CAPS "CAPS"
107 108
108# define OLED_RENDER_USER_NAME "USER:" 109# define OLED_RENDER_USER_NAME "USER:"
109# define OLED_RENDER_USER_ANIM "Anim" 110# define OLED_RENDER_USER_ANIM "Anim"
110# define OLED_RENDER_USER_LAYR "Layr" 111# define OLED_RENDER_USER_LAYR "Layr"
111# define OLED_RENDER_USER_NUKE "Nuke" 112# define OLED_RENDER_USER_NUKE "Nuke"
112 113
113# define OLED_RENDER_WPM_COUNTER "WPM: " 114# define OLED_RENDER_WPM_COUNTER "WPM: "
114 115
115#endif 116#endif
diff --git a/users/drashna/pimoroni_trackball.c b/users/drashna/pimoroni_trackball.c
deleted file mode 100644
index a6ca6c996..000000000
--- a/users/drashna/pimoroni_trackball.c
+++ /dev/null
@@ -1,151 +0,0 @@
1/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "pimoroni_trackball.h"
18#include "i2c_master.h"
19
20static uint8_t scrolling = 0;
21static int16_t x_offset = 0;
22static int16_t y_offset = 0;
23static int16_t h_offset = 0;
24static int16_t v_offset = 0;
25static float precisionSpeed = 1;
26
27#ifndef I2C_TIMEOUT
28# define I2C_TIMEOUT 100
29#endif
30#ifndef MOUSE_DEBOUNCE
31# define MOUSE_DEBOUNCE 5
32#endif
33
34void trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white) {
35 uint8_t data[] = {0x00, red, green, blue, white};
36 i2c_transmit(TRACKBALL_ADDRESS << 1, data, sizeof(data), I2C_TIMEOUT);
37}
38
39int16_t mouse_offset(uint8_t positive, uint8_t negative, int16_t scale) {
40 int16_t offset = (int16_t)positive - (int16_t)negative;
41 int16_t magnitude = (int16_t)(scale * offset * offset * precisionSpeed);
42 return offset < 0 ? -magnitude : magnitude;
43}
44
45void update_member(int8_t* member, int16_t* offset) {
46 if (*offset > 127) {
47 *member = 127;
48 *offset -= 127;
49 } else if (*offset < -127) {
50 *member = -127;
51 *offset += 127;
52 } else {
53 *member = *offset;
54 *offset = 0;
55 }
56}
57
58__attribute__((weak)) void trackball_check_click(bool pressed, report_mouse_t* mouse) {
59 if (pressed) {
60 mouse->buttons |= MOUSE_BTN1;
61 } else {
62 mouse->buttons &= ~MOUSE_BTN1;
63 }
64}
65
66void trackball_register_button(bool pressed, enum mouse_buttons button) {
67 report_mouse_t currentReport = pointing_device_get_report();
68 if (pressed) {
69 currentReport.buttons |= button;
70 } else {
71 currentReport.buttons &= ~button;
72 }
73 pointing_device_set_report(currentReport);
74}
75
76float trackball_get_precision(void) { return precisionSpeed; }
77void trackball_set_precision(float precision) { precisionSpeed = precision; }
78bool trackball_is_scrolling(void) { return scrolling; }
79void trackball_set_scrolling(bool scroll) { scrolling = scroll; }
80
81bool has_report_changed (report_mouse_t first, report_mouse_t second) {
82 return !(
83 (!first.buttons && first.buttons == second.buttons) &&
84 (!first.x && first.x == second.x) &&
85 (!first.y && first.y == second.y) &&
86 (!first.h && first.h == second.h) &&
87 (!first.v && first.v == second.v) );
88}
89
90
91__attribute__((weak)) void pointing_device_init(void) { trackball_set_rgbw(0x00, 0x00, 0x00, 0x4F); }
92
93void pointing_device_task(void) {
94 static bool debounce;
95 static uint16_t debounce_timer;
96 uint8_t state[5] = {};
97 if (i2c_readReg(TRACKBALL_ADDRESS << 1, 0x04, state, 5, I2C_TIMEOUT) == I2C_STATUS_SUCCESS) {
98 if (!state[4] && !debounce) {
99 if (scrolling) {
100#ifdef PIMORONI_TRACKBALL_INVERT_X
101 h_offset += mouse_offset(state[2], state[3], 1);
102#else
103 h_offset -= mouse_offset(state[2], state[3], 1);
104#endif
105#ifdef PIMORONI_TRACKBALL_INVERT_Y
106 v_offset += mouse_offset(state[1], state[0], 1);
107#else
108 v_offset -= mouse_offset(state[1], state[0], 1);
109#endif
110 } else {
111#ifdef PIMORONI_TRACKBALL_INVERT_X
112 x_offset -= mouse_offset(state[2], state[3], 5);
113#else
114 x_offset += mouse_offset(state[2], state[3], 5);
115#endif
116#ifdef PIMORONI_TRACKBALL_INVERT_Y
117 y_offset -= mouse_offset(state[1], state[0], 5);
118#else
119 y_offset += mouse_offset(state[1], state[0], 5);
120#endif
121 }
122 } else {
123 if (state[4]) {
124 debounce = true;
125 debounce_timer = timer_read();
126 }
127 }
128 }
129
130 if (timer_elapsed(debounce_timer) > MOUSE_DEBOUNCE) debounce = false;
131
132 report_mouse_t mouse = pointing_device_get_report();
133
134 trackball_check_click(state[4] & (1 << 7), &mouse);
135
136#ifndef PIMORONI_TRACKBALL_ROTATE
137 update_member(&mouse.x, &x_offset);
138 update_member(&mouse.y, &y_offset);
139 update_member(&mouse.h, &h_offset);
140 update_member(&mouse.v, &v_offset);
141#else
142 update_member(&mouse.x, &y_offset);
143 update_member(&mouse.y, &x_offset);
144 update_member(&mouse.h, &v_offset);
145 update_member(&mouse.v, &h_offset);
146#endif
147 pointing_device_set_report(mouse);
148 if (has_report_changed(mouse, pointing_device_get_report())) {
149 pointing_device_send();
150 }
151}
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c
index ef901226e..124354a5b 100644
--- a/users/drashna/process_records.c
+++ b/users/drashna/process_records.c
@@ -29,10 +29,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
29 // 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
30#ifdef KEYLOGGER_ENABLE 30#ifdef KEYLOGGER_ENABLE
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 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);
32#endif // KEYLOGGER_ENABLE 32#endif // KEYLOGGER_ENABLE
33#ifdef OLED_DRIVER_ENABLE 33#ifdef OLED_DRIVER_ENABLE
34 process_record_user_oled(keycode, record); 34 process_record_user_oled(keycode, record);
35#endif // OLED 35#endif // OLED
36 36
37 if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record) 37 if (!(process_record_keymap(keycode, record) && process_record_secrets(keycode, record)
38#ifdef RGB_MATRIX_ENABLE 38#ifdef RGB_MATRIX_ENABLE
@@ -59,7 +59,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
59 } 59 }
60 break; 60 break;
61 61
62 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader 62 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
63 if (!record->event.pressed) { 63 if (!record->event.pressed) {
64#ifndef MAKE_BOOTLOADER 64#ifndef MAKE_BOOTLOADER
65 uint8_t temp_mod = mod_config(get_mods()); 65 uint8_t temp_mod = mod_config(get_mods());
@@ -90,56 +90,44 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
90 90
91 break; 91 break;
92 92
93 case VRSN: // Prints firmware version 93 case VRSN: // Prints firmware version
94 if (record->event.pressed) { 94 if (record->event.pressed) { send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); }
95 send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY);
96 }
97 break; 95 break;
98 96
99 case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them 97 case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
100#ifdef TAP_DANCE_ENABLE 98#ifdef TAP_DANCE_ENABLE
101 if (record->event.pressed) { 99 if (record->event.pressed) {
102 for (uint8_t index = 0; index < 4; index++) { 100 for (uint8_t index = 0; index < 4; index++) { diablo_timer[index].key_interval = 0; }
103 diablo_timer[index].key_interval = 0;
104 }
105 } 101 }
106#endif // TAP_DANCE_ENABLE 102#endif // TAP_DANCE_ENABLE
107 break; 103 break;
108 104
109 case KC_CCCV: // One key copy/paste 105 case KC_CCCV: // One key copy/paste
110 if (record->event.pressed) { 106 if (record->event.pressed) {
111 copy_paste_timer = timer_read(); 107 copy_paste_timer = timer_read();
112 } else { 108 } else {
113 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy 109 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
114 tap_code16(LCTL(KC_C)); 110 tap_code16(LCTL(KC_C));
115 } else { // Tap, paste 111 } else { // Tap, paste
116 tap_code16(LCTL(KC_V)); 112 tap_code16(LCTL(KC_V));
117 } 113 }
118 } 114 }
119 break; 115 break;
120#ifdef UNICODE_ENABLE 116#ifdef UNICODE_ENABLE
121 case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ 117 case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
122 if (record->event.pressed) { 118 if (record->event.pressed) { send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻"); }
123 send_unicode_string("(ノಠ痊ಠ)ノ彡┻━┻");
124 }
125 break; 119 break;
126 case UC_TABL: // ┬─┬ノ( º _ ºノ) 120 case UC_TABL: // ┬─┬ノ( º _ ºノ)
127 if (record->event.pressed) { 121 if (record->event.pressed) { send_unicode_string("┬─┬ノ( º _ ºノ)"); }
128 send_unicode_string("┬─┬ノ( º _ ºノ)");
129 }
130 break; 122 break;
131 case UC_SHRG: // ¯\_(ツ)_/¯ 123 case UC_SHRG: // ¯\_(ツ)_/¯
132 if (record->event.pressed) { 124 if (record->event.pressed) { send_unicode_string("¯\\_(ツ)_/¯"); }
133 send_unicode_string("¯\\_(ツ)_/¯");
134 }
135 break; 125 break;
136 case UC_DISA: // ಠ_ಠ 126 case UC_DISA: // ಠ_ಠ
137 if (record->event.pressed) { 127 if (record->event.pressed) { send_unicode_string("ಠ_ಠ"); }
138 send_unicode_string("ಠ_ಠ");
139 }
140 break; 128 break;
141#endif 129#endif
142 case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal 130 case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
143#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 131#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
144 if (record->event.pressed) { 132 if (record->event.pressed) {
145 userspace_config.rgb_layer_change ^= 1; 133 userspace_config.rgb_layer_change ^= 1;
@@ -149,14 +137,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
149# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) 137# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
150 rgblight_enable_noeeprom(); 138 rgblight_enable_noeeprom();
151# endif 139# endif
152 layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) 140 layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
153# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE) 141# if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
154 } else { 142 } else {
155 rgblight_disable_noeeprom(); 143 rgblight_disable_noeeprom();
156# endif 144# endif
157 } 145 }
158 } 146 }
159#endif // RGBLIGHT_ENABLE 147#endif // RGBLIGHT_ENABLE
160 break; 148 break;
161 149
162#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 150#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
@@ -176,7 +164,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
176 } 164 }
177 return false; 165 return false;
178 break; 166 break;
179 case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions 167 case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
180 if (record->event.pressed) { 168 if (record->event.pressed) {
181 bool is_eeprom_updated; 169 bool is_eeprom_updated;
182# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) 170# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
@@ -194,9 +182,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
194 is_eeprom_updated = true; 182 is_eeprom_updated = true;
195 } 183 }
196# endif 184# endif
197 if (is_eeprom_updated) { 185 if (is_eeprom_updated) { eeconfig_update_user(userspace_config.raw); }
198 eeconfig_update_user(userspace_config.raw);
199 }
200 } 186 }
201#endif 187#endif
202 } 188 }
diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h
index f60e6d7eb..f65cfc03c 100644
--- a/users/drashna/process_records.h
+++ b/users/drashna/process_records.h
@@ -17,58 +17,58 @@
17#pragma once 17#pragma once
18#include "drashna.h" 18#include "drashna.h"
19 19
20#if defined(KEYBOARD_handwired_dactyl_manuform_5x6_right_trackball) 20#if defined(KEYBOARD_handwired_tractyl_manuform_5x6_right)
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
24#endif 24#endif
25 25
26enum userspace_custom_keycodes { 26enum userspace_custom_keycodes {
27 VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info 27 VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info
28 KC_QWERTY, // Sets default layer to QWERTY 28 KC_QWERTY, // Sets default layer to QWERTY
29 KC_COLEMAK, // Sets default layer to COLEMAK 29 KC_COLEMAK, // Sets default layer to COLEMAK
30 KC_DVORAK, // Sets default layer to DVORAK 30 KC_DVORAK, // Sets default layer to DVORAK
31 KC_WORKMAN, // Sets default layer to WORKMAN 31 KC_WORKMAN, // Sets default layer to WORKMAN
32 KC_DIABLO_CLEAR, // Clears all Diablo Timers 32 KC_DIABLO_CLEAR, // Clears all Diablo Timers
33 KC_MAKE, // Run keyboard's customized make command 33 KC_MAKE, // Run keyboard's customized make command
34 KC_RGB_T, // Toggles RGB Layer Indication mode 34 KC_RGB_T, // Toggles RGB Layer Indication mode
35 RGB_IDL, // RGB Idling animations 35 RGB_IDL, // RGB Idling animations
36 KC_SECRET_1, // test1 36 KC_SECRET_1, // test1
37 KC_SECRET_2, // test2 37 KC_SECRET_2, // test2
38 KC_SECRET_3, // test3 38 KC_SECRET_3, // test3
39 KC_SECRET_4, // test4 39 KC_SECRET_4, // test4
40 KC_SECRET_5, // test5 40 KC_SECRET_5, // test5
41 KC_CCCV, // Hold to copy, tap to paste 41 KC_CCCV, // Hold to copy, tap to paste
42 KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! 42 KC_NUKE, // NUCLEAR LAUNCH DETECTED!!!
43 UC_FLIP, // (ಠ痊ಠ)┻━┻ 43 UC_FLIP, // (ಠ痊ಠ)┻━┻
44 UC_TABL, // ┬─┬ノ( º _ ºノ) 44 UC_TABL, // ┬─┬ノ( º _ ºノ)
45 UC_SHRG, // ¯\_(ツ)_/¯ 45 UC_SHRG, // ¯\_(ツ)_/¯
46 UC_DISA, // ಠ_ಠ 46 UC_DISA, // ಠ_ಠ
47 NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes 47 NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes
48}; 48};
49 49
50bool process_record_secrets(uint16_t keycode, keyrecord_t *record); 50bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
51bool process_record_keymap(uint16_t keycode, keyrecord_t *record); 51bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
52 52
53#define LOWER MO(_LOWER) 53#define LOWER MO(_LOWER)
54#define RAISE MO(_RAISE) 54#define RAISE MO(_RAISE)
55#define ADJUST MO(_ADJUST) 55#define ADJUST MO(_ADJUST)
56#define TG_MODS OS_TOGG 56#define TG_MODS OS_TOGG
57#define TG_GAME TG(_GAMEPAD) 57#define TG_GAME TG(_GAMEPAD)
58#define TG_DBLO TG(_DIABLO) 58#define TG_DBLO TG(_DIABLO)
59#define OS_LWR OSL(_LOWER) 59#define OS_LWR OSL(_LOWER)
60#define OS_RSE OSL(_RAISE) 60#define OS_RSE OSL(_RAISE)
61 61
62#define KC_SEC1 KC_SECRET_1 62#define KC_SEC1 KC_SECRET_1
63#define KC_SEC2 KC_SECRET_2 63#define KC_SEC2 KC_SECRET_2
64#define KC_SEC3 KC_SECRET_3 64#define KC_SEC3 KC_SECRET_3
65#define KC_SEC4 KC_SECRET_4 65#define KC_SEC4 KC_SECRET_4
66#define KC_SEC5 KC_SECRET_5 66#define KC_SEC5 KC_SECRET_5
67 67
68#define QWERTY KC_QWERTY 68#define QWERTY KC_QWERTY
69#define DVORAK KC_DVORAK 69#define DVORAK KC_DVORAK
70#define COLEMAK KC_COLEMAK 70#define COLEMAK KC_COLEMAK
71#define WORKMAN KC_WORKMAN 71#define WORKMAN KC_WORKMAN
72 72
73#define KC_RESET RESET 73#define KC_RESET RESET
74#define KC_RST KC_RESET 74#define KC_RST KC_RESET
@@ -77,9 +77,9 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
77# define KC_C1R3 SH_T(KC_TAB) 77# define KC_C1R3 SH_T(KC_TAB)
78#elif defined(DRASHNA_LP) 78#elif defined(DRASHNA_LP)
79# define KC_C1R3 TG(_GAMEPAD) 79# define KC_C1R3 TG(_GAMEPAD)
80#else // SWAP_HANDS_ENABLE 80#else // SWAP_HANDS_ENABLE
81# define KC_C1R3 KC_TAB 81# define KC_C1R3 KC_TAB
82#endif // SWAP_HANDS_ENABLE 82#endif // SWAP_HANDS_ENABLE
83 83
84#define BK_LWER LT(_LOWER, KC_BSPC) 84#define BK_LWER LT(_LOWER, KC_BSPC)
85#define SP_LWER LT(_LOWER, KC_SPC) 85#define SP_LWER LT(_LOWER, KC_SPC)
diff --git a/users/drashna/rgb_matrix_stuff.c b/users/drashna/rgb_matrix_stuff.c
index 9e9e1e427..9fbe6214b 100644
--- a/users/drashna/rgb_matrix_stuff.c
+++ b/users/drashna/rgb_matrix_stuff.c
@@ -28,33 +28,27 @@ static uint32_t hypno_timer;
28 28
29void 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) { 29void 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()) { hsv.v = rgb_matrix_get_val(); }
32 hsv.v = rgb_matrix_get_val();
33 }
34 32
35 switch (mode) { 33 switch (mode) {
36 case 1: // breathing 34 case 1: // breathing
37 { 35 {
38 uint16_t time = scale16by8(g_rgb_timer, speed / 8); 36 uint16_t time = scale16by8(g_rgb_timer, speed / 8);
39 hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); 37 hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v);
40 RGB rgb = hsv_to_rgb(hsv); 38 RGB rgb = hsv_to_rgb(hsv);
41 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { 39 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
42 if (HAS_FLAGS(g_led_config.flags[i], led_type)) { 40 if (HAS_FLAGS(g_led_config.flags[i], led_type)) { RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); }
43 RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
44 } 41 }
42 break;
45 } 43 }
46 break; 44 default: // Solid Color
47 } 45 {
48 default: // Solid Color 46 RGB rgb = hsv_to_rgb(hsv);
49 { 47 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
50 RGB rgb = hsv_to_rgb(hsv); 48 if (HAS_FLAGS(g_led_config.flags[i], led_type)) { RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b); }
51 for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
52 if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
53 RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
54 } 49 }
50 break;
55 } 51 }
56 break;
57 }
58 } 52 }
59} 53}
60 54
@@ -62,38 +56,30 @@ __attribute__((weak)) void rgb_matrix_indicator_keymap(void) {}
62 56
63void matrix_scan_rgb_matrix(void) { 57void matrix_scan_rgb_matrix(void) {
64#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) 58#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
65 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && sync_timer_elapsed32(hypno_timer) > 15000) { 59 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && sync_timer_elapsed32(hypno_timer) > 15000) { rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); }
66 rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
67 }
68#endif 60#endif
69 rgb_matrix_indicator_keymap(); 61 rgb_matrix_indicator_keymap();
70} 62}
71 63
72void keyboard_post_init_rgb_matrix(void) { 64void keyboard_post_init_rgb_matrix(void) {
73#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) 65#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
74 if (userspace_config.rgb_matrix_idle_anim) { 66 if (userspace_config.rgb_matrix_idle_anim) { rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); }
75 rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE);
76 }
77#endif 67#endif
78} 68}
79 69
80bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { 70bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
81#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) 71#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
82 hypno_timer = sync_timer_read32(); 72 hypno_timer = sync_timer_read32();
83 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { 73 if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); }
84 rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP);
85 }
86#endif 74#endif
87 switch (keycode) { 75 switch (keycode) {
88 case RGB_IDL: // This allows me to use underglow as layer indication, or as normal 76 case RGB_IDL: // This allows me to use underglow as layer indication, or as normal
89#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) 77#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
90 if (record->event.pressed) { 78 if (record->event.pressed) {
91 userspace_config.rgb_matrix_idle_anim ^= 1; 79 userspace_config.rgb_matrix_idle_anim ^= 1;
92 dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); 80 dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim);
93 eeconfig_update_user(userspace_config.raw); 81 eeconfig_update_user(userspace_config.raw);
94 if (userspace_config.rgb_matrix_idle_anim) { 82 if (userspace_config.rgb_matrix_idle_anim) { rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); }
95 rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP);
96 }
97 } 83 }
98#endif 84#endif
99 break; 85 break;
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 6723ad4bf..1665638cf 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -28,7 +28,7 @@ void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight
28static rgblight_fadeout lights[RGBLED_NUM]; 28static rgblight_fadeout lights[RGBLED_NUM];
29 29
30/* Handler for fading/twinkling effect */ 30/* Handler for fading/twinkling effect */
31void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive 31void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgblight_sethsv is supppppper intensive
32 bool litup = false; 32 bool litup = false;
33 33
34 for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) { 34 for (uint8_t light_index = 0; light_index < RGBLED_NUM; ++light_index) {
@@ -38,21 +38,15 @@ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rg
38 38
39 if (light->life) { 39 if (light->life) {
40 light->life -= 1; 40 light->life -= 1;
41 if (get_highest_layer(layer_state) == 0) { 41 if (get_highest_layer(layer_state) == 0) { sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]); }
42 sethsv(light->hue + rand() % 0xF, 255, light->life, (LED_TYPE *)&led[light_index]);
43 }
44 light->timer = sync_timer_read(); 42 light->timer = sync_timer_read();
45 } else { 43 } else {
46 if (light->enabled && get_highest_layer(layer_state) == 0) { 44 if (light->enabled && get_highest_layer(layer_state) == 0) { rgblight_sethsv_default_helper(light_index); }
47 rgblight_sethsv_default_helper(light_index);
48 }
49 litup = light->enabled = false; 45 litup = light->enabled = false;
50 } 46 }
51 } 47 }
52 } 48 }
53 if (litup && get_highest_layer(layer_state) == 0) { 49 if (litup && get_highest_layer(layer_state) == 0) { rgblight_set(); }
54 rgblight_set();
55 }
56} 50}
57 51
58/* Triggers a LED to fade/twinkle. 52/* Triggers a LED to fade/twinkle.
@@ -98,9 +92,7 @@ void start_rgb_light(void) {
98bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { 92bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) {
99 uint16_t temp_keycode = keycode; 93 uint16_t temp_keycode = keycode;
100 // Filter out the actual keycode from MT and LT keys. 94 // Filter out the actual keycode from MT and LT keys.
101 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { 95 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { temp_keycode &= 0xFF; }
102 temp_keycode &= 0xFF;
103 }
104 96
105 switch (temp_keycode) { 97 switch (temp_keycode) {
106# ifdef RGBLIGHT_TWINKLE 98# ifdef RGBLIGHT_TWINKLE
@@ -110,11 +102,9 @@ bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) {
110 case KC_KP_SLASH ... KC_KP_DOT: 102 case KC_KP_SLASH ... KC_KP_DOT:
111 case KC_F13 ... KC_F24: 103 case KC_F13 ... KC_F24:
112 case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: 104 case KC_AUDIO_MUTE ... KC_MEDIA_REWIND:
113 if (record->event.pressed) { 105 if (record->event.pressed) { start_rgb_light(); }
114 start_rgb_light();
115 }
116 break; 106 break;
117# endif // RGBLIGHT_TWINKLE 107# endif // RGBLIGHT_TWINKLE
118 } 108 }
119 return true; 109 return true;
120} 110}
@@ -129,9 +119,7 @@ static uint16_t rgblight_startup_loop_timer;
129void keyboard_post_init_rgb_light(void) { 119void keyboard_post_init_rgb_light(void) {
130# if defined(RGBLIGHT_STARTUP_ANIMATION) 120# if defined(RGBLIGHT_STARTUP_ANIMATION)
131 is_enabled = rgblight_is_enabled(); 121 is_enabled = rgblight_is_enabled();
132 if (userspace_config.rgb_layer_change) { 122 if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }
133 rgblight_enable_noeeprom();
134 }
135 if (rgblight_is_enabled()) { 123 if (rgblight_is_enabled()) {
136 layer_state_set_rgb_light(layer_state); 124 layer_state_set_rgb_light(layer_state);
137 old_hue = rgblight_get_hue(); 125 old_hue = rgblight_get_hue();
@@ -145,7 +133,7 @@ void keyboard_post_init_rgb_light(void) {
145void matrix_scan_rgb_light(void) { 133void matrix_scan_rgb_light(void) {
146# ifdef RGBLIGHT_TWINKLE 134# ifdef RGBLIGHT_TWINKLE
147 scan_rgblight_fadeout(); 135 scan_rgblight_fadeout();
148# endif // RGBLIGHT_ENABLE 136# endif // RGBLIGHT_ENABLE
149 137
150# if defined(RGBLIGHT_STARTUP_ANIMATION) 138# if defined(RGBLIGHT_STARTUP_ANIMATION)
151 if (is_rgblight_startup && is_keyboard_master()) { 139 if (is_rgblight_startup && is_keyboard_master()) {
@@ -156,12 +144,8 @@ void matrix_scan_rgb_light(void) {
156 rgblight_startup_loop_timer = sync_timer_read(); 144 rgblight_startup_loop_timer = sync_timer_read();
157 if (counter == 255) { 145 if (counter == 255) {
158 is_rgblight_startup = false; 146 is_rgblight_startup = false;
159 if (!is_enabled) { 147 if (!is_enabled) { rgblight_disable_noeeprom(); }
160 rgblight_disable_noeeprom(); 148 if (userspace_config.rgb_layer_change) { layer_state_set_rgb_light(layer_state); }
161 }
162 if (userspace_config.rgb_layer_change) {
163 layer_state_set_rgb_light(layer_state);
164 }
165 } 149 }
166 } 150 }
167 } 151 }
@@ -179,55 +163,25 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) {
179 if (userspace_config.rgb_layer_change) { 163 if (userspace_config.rgb_layer_change) {
180 switch (get_highest_layer(state | default_layer_state)) { 164 switch (get_highest_layer(state | default_layer_state)) {
181 case _MACROS: // mouse 165 case _MACROS: // mouse
182 if (!layer_state_cmp(state, _GAMEPAD) && !layer_state_cmp(state, _DIABLO)) { 166 if (!layer_state_cmp(state, _GAMEPAD) && !layer_state_cmp(state, _DIABLO)) { rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3); }
183 rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3);
184 }
185 break;
186 case _MEDIA:
187 rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1);
188 break;
189 case _GAMEPAD:
190 rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2);
191 break;
192 case _DIABLO:
193 rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3);
194 break;
195 case _RAISE:
196 rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3);
197 break;
198 case _LOWER:
199 rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3);
200 break;
201 case _ADJUST:
202 rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2);
203 break;
204 case _COLEMAK:
205 rgblight_set_hsv_and_mode(HSV_MAGENTA, RGBLIGHT_MODE_STATIC_LIGHT);
206 break;
207 case _DVORAK:
208 rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, RGBLIGHT_MODE_STATIC_LIGHT);
209 break;
210 case _WORKMAN:
211 rgblight_set_hsv_and_mode(HSV_GOLDENROD, RGBLIGHT_MODE_STATIC_LIGHT);
212 break;
213 case _NORMAN:
214 rgblight_set_hsv_and_mode(HSV_CORAL, RGBLIGHT_MODE_STATIC_LIGHT);
215 break;
216 case _MALTRON:
217 rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_STATIC_LIGHT);
218 break;
219 case _EUCALYN:
220 rgblight_set_hsv_and_mode(HSV_PINK, RGBLIGHT_MODE_STATIC_LIGHT);
221 break;
222 case _CARPLAX:
223 rgblight_set_hsv_and_mode(HSV_BLUE, RGBLIGHT_MODE_STATIC_LIGHT);
224 break;
225 default:
226 rgblight_set_hsv_and_mode(HSV_CYAN, RGBLIGHT_MODE_STATIC_LIGHT);
227 break; 167 break;
168 case _MEDIA: rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); break;
169 case _GAMEPAD: rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2); break;
170 case _DIABLO: rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3); break;
171 case _RAISE: rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_BREATHING + 3); break;
172 case _LOWER: rgblight_set_hsv_and_mode(HSV_GREEN, RGBLIGHT_MODE_BREATHING + 3); break;
173 case _ADJUST: rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); break;
174 case _COLEMAK: rgblight_set_hsv_and_mode(HSV_MAGENTA, RGBLIGHT_MODE_STATIC_LIGHT); break;
175 case _DVORAK: rgblight_set_hsv_and_mode(HSV_SPRINGGREEN, RGBLIGHT_MODE_STATIC_LIGHT); break;
176 case _WORKMAN: rgblight_set_hsv_and_mode(HSV_GOLDENROD, RGBLIGHT_MODE_STATIC_LIGHT); break;
177 case _NORMAN: rgblight_set_hsv_and_mode(HSV_CORAL, RGBLIGHT_MODE_STATIC_LIGHT); break;
178 case _MALTRON: rgblight_set_hsv_and_mode(HSV_YELLOW, RGBLIGHT_MODE_STATIC_LIGHT); break;
179 case _EUCALYN: rgblight_set_hsv_and_mode(HSV_PINK, RGBLIGHT_MODE_STATIC_LIGHT); break;
180 case _CARPLAX: rgblight_set_hsv_and_mode(HSV_BLUE, RGBLIGHT_MODE_STATIC_LIGHT); break;
181 default: rgblight_set_hsv_and_mode(HSV_CYAN, RGBLIGHT_MODE_STATIC_LIGHT); break;
228 } 182 }
229 } 183 }
230# endif // RGBLIGHT_ENABLE 184# endif // RGBLIGHT_ENABLE
231 185
232 return state; 186 return state;
233} 187}
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index b79051508..b9156f6a4 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -74,34 +74,35 @@ endif
74ifeq ($(strip $(PIMORONI_TRACKBALL_ENABLE)), yes) 74ifeq ($(strip $(PIMORONI_TRACKBALL_ENABLE)), yes)
75 POINTING_DEVICE_ENABLE := yes 75 POINTING_DEVICE_ENABLE := yes
76 OPT_DEFS += -DPIMORONI_TRACKBALL_ENABLE 76 OPT_DEFS += -DPIMORONI_TRACKBALL_ENABLE
77 SRC += pimoroni_trackball.c 77 SRC += drivers/sensors/pimoroni_trackball.c
78 QUANTUM_LIB_SRC += i2c_master.c 78 QUANTUM_LIB_SRC += i2c_master.c
79endif 79endif
80 80
81CUSTOM_SPLIT_TRANSPORT ?= yes 81CUSTOM_SPLIT_TRANSPORT ?= yes
82ifeq ($(strip $(SPLIT_KEYBOARD)), yes) 82ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
83 ifneq ($(strip $(SPLIT_TRANSPORT)), custom) 83 QUANTUM_LIB_SRC += transport_sync.c
84 ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT)), yes) 84 # ifneq ($(strip $(SPLIT_TRANSPORT)), custom)
85 SPLIT_TRANSPORT = custom 85 # ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT)), yes)
86 QUANTUM_LIB_SRC += drashna_transport.c 86 # SPLIT_TRANSPORT = custom
87 OPT_DEFS += -DDRASHNA_CUSTOM_TRANSPORT 87 # QUANTUM_LIB_SRC += drashna_transport.c
88 # Unused functions are pruned away, which is why we can add multiple drivers here without bloat. 88 # OPT_DEFS += -DDRASHNA_CUSTOM_TRANSPORT
89 ifeq ($(PLATFORM),AVR) 89 # # Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
90 ifneq ($(NO_I2C),yes) 90 # ifeq ($(PLATFORM),AVR)
91 QUANTUM_LIB_SRC += i2c_master.c \ 91 # ifneq ($(NO_I2C),yes)
92 i2c_slave.c 92 # QUANTUM_LIB_SRC += i2c_master.c \
93 endif 93 # i2c_slave.c
94 endif 94 # endif
95 # endif
95 96
96 SERIAL_DRIVER ?= bitbang 97 # SERIAL_DRIVER ?= bitbang
97 OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]')) 98 # OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]'))
98 ifeq ($(strip $(SERIAL_DRIVER)), bitbang) 99 # ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
99 QUANTUM_LIB_SRC += serial.c 100 # QUANTUM_LIB_SRC += serial.c
100 else 101 # else
101 QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c 102 # QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c
102 endif 103 # endif
103 endif 104 # endif
104 endif 105 # endif
105endif 106endif
106 107
107# DEBUG_MATRIX_SCAN_RATE_ENABLE = api 108# DEBUG_MATRIX_SCAN_RATE_ENABLE = api
diff --git a/users/drashna/tap_dances.c b/users/drashna/tap_dances.c
index 01873489d..6b27afc5a 100644
--- a/users/drashna/tap_dances.c
+++ b/users/drashna/tap_dances.c
@@ -26,7 +26,7 @@ uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30};
26 26
27// Cycle through the times for the macro, starting at 0, for disabled. 27// Cycle through the times for the macro, starting at 0, for disabled.
28void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) { 28void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) {
29 diable_keys_t *diablo_keys = (diable_keys_t *)user_data; 29 diable_keys_t *diablo_keys = (diable_keys_t *)user_data;
30 // Sets the keycode based on the index 30 // Sets the keycode based on the index
31 diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode; 31 diablo_timer[diablo_keys->index].keycode = diablo_keys->keycode;
32 32
@@ -34,7 +34,7 @@ void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) {
34 if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t))) { 34 if (state->count >= (sizeof(diablo_times) / sizeof(uint8_t))) {
35 diablo_timer[diablo_keys->index].key_interval = 0; 35 diablo_timer[diablo_keys->index].key_interval = 0;
36 reset_tap_dance(state); 36 reset_tap_dance(state);
37 } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one) 37 } else { // else set the interval (tapdance count starts at 1, array starts at 0, so offset by one)
38 diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1]; 38 diablo_timer[diablo_keys->index].key_interval = diablo_times[state->count - 1];
39 } 39 }
40} 40}
@@ -64,9 +64,7 @@ void run_diablo_macro_check(void) {
64 // reset the timer, since enough time has passed 64 // reset the timer, since enough time has passed
65 diablo_timer[index].timer = timer_read(); 65 diablo_timer[index].timer = timer_read();
66 // send keycode ONLY if we're on the diablo layer. 66 // send keycode ONLY if we're on the diablo layer.
67 if (IS_LAYER_ON(_DIABLO)) { 67 if (IS_LAYER_ON(_DIABLO)) { tap_code(diablo_timer[index].keycode); }
68 tap_code(diablo_timer[index].keycode);
69 }
70 } 68 }
71 } 69 }
72} 70}
diff --git a/users/drashna/tap_dances.h b/users/drashna/tap_dances.h
index 7f73f2803..182cc6756 100644
--- a/users/drashna/tap_dances.h
+++ b/users/drashna/tap_dances.h
@@ -43,4 +43,4 @@ enum {
43 TD_D3_4 43 TD_D3_4
44}; 44};
45// clang-format on 45// clang-format on
46#endif // TAP_DANCE_ENABLE 46#endif // TAP_DANCE_ENABLE
diff --git a/users/drashna/template.c b/users/drashna/template.c
index f98964ae4..636955c43 100644
--- a/users/drashna/template.c
+++ b/users/drashna/template.c
@@ -54,9 +54,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
54 break; 54 break;
55 55
56 case VRSN: 56 case VRSN:
57 if (record->event.pressed) { 57 if (record->event.pressed) { SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); }
58 SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
59 }
60 return false; 58 return false;
61 break; 59 break;
62 } 60 }
@@ -89,7 +87,7 @@ __attribute__((weak)) void startup_keymap(void) {}
89void startup_user(void) { 87void startup_user(void) {
90#ifdef RGBLIGHT_ENABLE 88#ifdef RGBLIGHT_ENABLE
91 matrix_init_rgb(); 89 matrix_init_rgb();
92#endif // RGBLIGHT_ENABLE 90#endif // RGBLIGHT_ENABLE
93 startup_keymap(); 91 startup_keymap();
94} 92}
95 93
diff --git a/users/drashna/template.h b/users/drashna/template.h
index cb1ad75d8..e00a0530e 100644
--- a/users/drashna/template.h
+++ b/users/drashna/template.h
@@ -24,8 +24,8 @@
24#define BASE 0 24#define BASE 0
25 25
26enum custom_keycodes { 26enum custom_keycodes {
27 VRSN = SAFE_RANGE, // can always be here 27 VRSN = SAFE_RANGE, // can always be here
28 KC_MAKE, 28 KC_MAKE,
29 KC_RESET, 29 KC_RESET,
30 NEWPLACEHOLDER // use "NEWPLACEHOLDER for keymap specific codes 30 NEWPLACEHOLDER // use "NEWPLACEHOLDER for keymap specific codes
31}; 31};
diff --git a/users/drashna/transport_sync.c b/users/drashna/transport_sync.c
new file mode 100644
index 000000000..baa1f7651
--- /dev/null
+++ b/users/drashna/transport_sync.c
@@ -0,0 +1,80 @@
1#ifdef SPLIT_TRANSACTION_IDS_USER
2#include "transport_sync.h"
3#include "transactions.h"
4#include <string.h>
5
6typedef struct {
7 bool oled_on;
8 uint16_t keymap_config;
9} user_runtime_config_t;
10
11user_runtime_config_t user_state;
12
13void user_sync(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
14 if (initiator2target_buffer_size == sizeof(user_state)) {
15 memcpy(&user_state, initiator2target_buffer, initiator2target_buffer_size);
16 }
17}
18
19void keyboard_post_init_transport_sync(void) {
20 // Register keyboard state sync split transaction
21 transaction_register_rpc(RPC_ID_USER_STATE_SYNC, user_sync);
22}
23
24void user_state_update(void) {
25 if (is_keyboard_master()) {
26
27#ifdef OLED_DRIVER_ENABLE
28 user_state.oled_on = is_oled_on();
29#endif
30
31 user_state.keymap_config = keymap_config.raw;
32 } else {
33#ifdef OLED_DRIVER_ENABLE
34 if (user_state.oled_on) {
35 oled_on();
36 } else {
37 oled_off();
38 }
39#endif
40 if (keymap_config.raw != user_state.keymap_config) {
41 keymap_config.raw = user_state.keymap_config;
42 }
43 }
44}
45
46void user_state_sync(void) {
47 if (is_keyboard_master()) {
48 // Keep track of the last state, so that we can tell if we need to propagate to slave
49 static user_runtime_config_t last_user_state;
50 static uint32_t last_sync;
51 bool needs_sync = false;
52
53 // Check if the state values are different
54 if (memcmp(&user_state, &last_user_state, sizeof(user_state))) {
55 needs_sync = true;
56 memcpy(&last_user_state, &user_state, sizeof(user_state));
57 }
58
59 // Send to slave every 500ms regardless of state change
60 if (timer_elapsed32(last_sync) > 250) {
61 needs_sync = true;
62 }
63
64 // Perform the sync if requested
65 if (needs_sync) {
66 if (transaction_rpc_send(RPC_ID_USER_STATE_SYNC, sizeof(user_state), &user_state)) {
67 last_sync = timer_read32();
68 }
69 }
70 }
71}
72
73void housekeeping_task_user(void) {
74 // Update kb_state so we can send to slave
75 user_state_update();
76
77 // Data sync from master to slave
78 user_state_sync();
79}
80#endif
diff --git a/users/drashna/pimoroni_trackball.h b/users/drashna/transport_sync.h
index a30fb0bb8..e2b3eae76 100644
--- a/users/drashna/pimoroni_trackball.h
+++ b/users/drashna/transport_sync.h
@@ -1,3 +1,4 @@
1
1/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> 2/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
2 * 3 *
3 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
@@ -16,20 +17,6 @@
16 17
17#pragma once 18#pragma once
18 19
19#include "quantum.h" 20#include "drashna.h"
20#include "pointing_device.h"
21
22#ifndef TRACKBALL_ADDRESS
23# define TRACKBALL_ADDRESS 0x0A
24#endif
25#define TRACKBALL_WRITE ((TRACKBALL_ADDRESS << 1) | I2C_WRITE)
26#define TRACKBALL_READ ((TRACKBALL_ADDRESS << 1) | I2C_READ)
27
28void trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
29void trackball_check_click(bool pressed, report_mouse_t *mouse);
30void trackball_register_button(bool pressed, enum mouse_buttons button);
31 21
32float trackball_get_precision(void); 22void keyboard_post_init_transport_sync(void);
33void trackball_set_precision(float precision);
34bool trackball_is_scrolling(void);
35void trackball_set_scrolling(bool scroll);
diff --git a/users/dshields/rules.mk b/users/dshields/rules.mk
index 462649289..00e18521b 100644
--- a/users/dshields/rules.mk
+++ b/users/dshields/rules.mk
@@ -5,7 +5,6 @@ COMMAND_ENABLE = no # Commands for debug and configuration
5CONSOLE_ENABLE = no # Console for debug(+400) 5CONSOLE_ENABLE = no # Console for debug(+400)
6EXTRAKEY_ENABLE = no 6EXTRAKEY_ENABLE = no
7SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 7SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
8API_SYSEX_ENABLE = no
9SPACE_CADET_ENABLE = no 8SPACE_CADET_ENABLE = no
10LEADER_ENABLE = no 9LEADER_ENABLE = no
11DYNAMIC_MACRO_ENABLE = yes 10DYNAMIC_MACRO_ENABLE = yes
diff --git a/users/edvorakjp/edvorakjp.c b/users/edvorakjp/edvorakjp.c
index d0cd106ff..c44d8bb44 100644
--- a/users/edvorakjp/edvorakjp.c
+++ b/users/edvorakjp/edvorakjp.c
@@ -7,7 +7,7 @@ void matrix_init_user(void) {
7 7
8__attribute__((weak)) void matrix_init_keymap() {} 8__attribute__((weak)) void matrix_init_keymap() {}
9 9
10uint32_t layer_state_set_user(uint32_t state) { 10layer_state_t layer_state_set_user(layer_state_t state) {
11 state = update_tri_layer_state(state, L_EDVORAKJP_LOWER, L_EDVORAKJP_RAISE, L_EDVORAKJP_ADJUST); 11 state = update_tri_layer_state(state, L_EDVORAKJP_LOWER, L_EDVORAKJP_RAISE, L_EDVORAKJP_ADJUST);
12 return layer_state_set_keymap(state); 12 return layer_state_set_keymap(state);
13} 13}
diff --git a/users/edvorakjp/edvorakjp.h b/users/edvorakjp/edvorakjp.h
index 5f20762c6..93cd9851b 100644
--- a/users/edvorakjp/edvorakjp.h
+++ b/users/edvorakjp/edvorakjp.h
@@ -67,7 +67,7 @@ enum tap_dance_code {
67// base 67// base
68void matrix_init_user(void); 68void matrix_init_user(void);
69void matrix_init_keymap(void); 69void matrix_init_keymap(void);
70uint32_t layer_state_set_user(uint32_t state); 70layer_state_t layer_state_set_user(layer_state_t state);
71uint32_t layer_state_set_keymap(uint32_t state); 71uint32_t layer_state_set_keymap(uint32_t state);
72bool process_record_user(uint16_t keycode, keyrecord_t *record); 72bool process_record_user(uint16_t keycode, keyrecord_t *record);
73bool process_record_keymap(uint16_t keycode, keyrecord_t *record); 73bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
diff --git a/users/ericgebhart/base_layers.h b/users/ericgebhart/base_layers.h
index caf081057..fd88a40ae 100644
--- a/users/ericgebhart/base_layers.h
+++ b/users/ericgebhart/base_layers.h
@@ -87,7 +87,7 @@
87 87
88// the bottom rows for keyboards on bepo. 88// the bottom rows for keyboards on bepo.
89// bepo on bepo - not enough space to go around.... 89// bepo on bepo - not enough space to go around....
90#define ___BOTTOM_LEFT_BP___ LCTL(BP_C), BP_ECRC, LCTL(BP_V), KC_LEFT, KC_RIGHT 90#define ___BOTTOM_LEFT_BP___ LCTL(BP_C), BP_ECIR, LCTL(BP_V), KC_LEFT, KC_RIGHT
91#define ___BOTTOM_RIGHT_BP___ KC_UP, KC_DOWN, DB_BACKSLASH, BP_CCED, BP_PERC 91#define ___BOTTOM_RIGHT_BP___ KC_UP, KC_DOWN, DB_BACKSLASH, BP_CCED, BP_PERC
92 92
93// for dvorak on bepo 93// for dvorak on bepo
diff --git a/users/ericgebhart/core_keys.h b/users/ericgebhart/core_keys.h
index 035f74001..a71d90574 100644
--- a/users/ericgebhart/core_keys.h
+++ b/users/ericgebhart/core_keys.h
@@ -231,7 +231,7 @@ enum {
231#define BP_SFT_T_E SFT_T(BP_E) 231#define BP_SFT_T_E SFT_T(BP_E)
232#define BP_SFT_T_M SFT_T(BP_M) 232#define BP_SFT_T_M SFT_T(BP_M)
233 233
234#define BP_SFT_T_ECRC SFT_T(BP_ECRC) 234#define BP_SFT_T_ECRC SFT_T(BP_ECIR)
235#define BP_SFT_T_CCED SFT_T(BP_CCED) 235#define BP_SFT_T_CCED SFT_T(BP_CCED)
236#define BP_LT_SYMB_COMM LT(SYMB,BP_COMM) 236#define BP_LT_SYMB_COMM LT(SYMB,BP_COMM)
237 237
diff --git a/users/ericgebhart/core_keysets.h b/users/ericgebhart/core_keysets.h
index ffe02192f..5baf02ccf 100644
--- a/users/ericgebhart/core_keysets.h
+++ b/users/ericgebhart/core_keysets.h
@@ -111,33 +111,33 @@
111 111
112// Bepo on fr-bepo software layer 112// Bepo on fr-bepo software layer
113// for bepo on bepo 113// for bepo on bepo
114/* BP_DLR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL, */ 114/* BP_DLR, BP_DQUO, BP_LDAQ, BP_RDAQ, BP_LPRN, BP_RPRN, KC_DEL, */
115#define ___SYMBOL_BEPO_L___ /* BP_DLR */ BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN 115#define ___SYMBOL_BEPO_L___ /* BP_DLR */ BP_DQUO, BP_LDAQ, BP_RDAQ, BP_LPRN, BP_RPRN
116/* KC_DEL, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, */ 116/* KC_DEL, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, */
117#define ___SYMBOL_BEPO_R___ BP_AT, BP_PLUS, BP_MINS, BP_SLASH, BP_ASTR /* BP_EQL, BP_PERC */ 117#define ___SYMBOL_BEPO_R___ BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR /* BP_EQL, BP_PERC */
118 118
119#define ___BEPO_FR_L1___ BP_B, BP_ECUT, BP_P, BP_O, BP_EGRV 119#define ___BEPO_FR_L1___ BP_B, BP_EACU, BP_P, BP_O, BP_EGRV
120#define ___BEPO_FR_L2___ BP_SFT_T_A, BP_LT_KP_U, BP_LT_SYMB_I, BP_LT_MDIA_E, BP_COMM 120#define ___BEPO_FR_L2___ BP_SFT_T_A, BP_LT_KP_U, BP_LT_SYMB_I, BP_LT_MDIA_E, BP_COMM
121#define ___BEPO_FR_L3___ /*BP_ECRC*/ BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K 121#define ___BEPO_FR_L3___ /*BP_ECIR*/ BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K
122 122
123#define ___BEPO_FR_R1___ /* BP_DCRC,*/ BP_V, BP_D, BP_L, BP_J, BP_Z 123#define ___BEPO_FR_R1___ /* BP_DCIR,*/ BP_V, BP_D, BP_L, BP_J, BP_Z
124#define ___BEPO_FR_R2___ /* BP_C, */ BP_T, BP_LT_SYMB_S, BP_LT_MDIA_R, BP_LT_KP_N, BP_SFT_T_M //BP_CCED 124#define ___BEPO_FR_R2___ /* BP_C, */ BP_T, BP_LT_SYMB_S, BP_LT_MDIA_R, BP_LT_KP_N, BP_SFT_T_M //BP_CCED
125#define ___BEPO_FR_R3___ BP_APOS, BP_Q, BP_G, BP_H, BP_F //BP_SFT_T_W 125#define ___BEPO_FR_R3___ BP_QUOT, BP_Q, BP_G, BP_H, BP_F //BP_SFT_T_W
126 126
127/* BP_DLR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL, */ 127/* BP_DLR, BP_DQUO, BP_LDAQ, BP_RDAQ, BP_LPRN, BP_RPRN, KC_DEL, */
128/* KC_TAB, BP_B, BP_ECUT, BP_P, BP_O, BP_EGRV, KC_BSPC, */ 128/* KC_TAB, BP_B, BP_EACU, BP_P, BP_O, BP_EGRV, KC_BSPC, */
129/* KC_LSFT, BP_A, BP_U, BP_I, BP_E, BP_COMM, */ 129/* KC_LSFT, BP_A, BP_U, BP_I, BP_E, BP_COMM, */
130/* KC_LCTRL, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, KC_ENT, */ 130/* KC_LCTRL, BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K, KC_ENT, */
131/* ESC_FN, BP_ECRC, KC_LGUI, KC_LALT, SPC_RALT, */ 131/* ESC_FN, BP_ECIR, KC_LGUI, KC_LALT, SPC_RALT, */
132/* TT(SWAP), KC_MNXT, */ 132/* TT(SWAP), KC_MNXT, */
133/* KC_MPLY, */ 133/* KC_MPLY, */
134/* TT(FN), TT(NUMS), KC_MPRV, */ 134/* TT(FN), TT(NUMS), KC_MPRV, */
135 135
136/* /\* right hand *\/ */ 136/* /\* right hand *\/ */
137/* KC_DEL, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, */ 137/* KC_DEL, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, */
138/* KC_BSPC, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, */ 138/* KC_BSPC, BP_DCIR, BP_V, BP_D, BP_L, BP_J, BP_Z, */
139/* BP_C, BP_T, BP_S, BP_R, BP_N, M_RSFT, */ 139/* BP_C, BP_T, BP_S, BP_R, BP_N, M_RSFT, */
140/* KC_ENT, BP_APOS, BP_Q, BP_G, BP_H, BP_F, W_RCTL, */ 140/* KC_ENT, BP_QUOT, BP_Q, BP_G, BP_H, BP_F, W_RCTL, */
141 141
142 142
143/*******************************************************************/ 143/*******************************************************************/
@@ -183,7 +183,7 @@
183#define ___KEYPAD_4_ALT___ KC_P0, KC_DOT, KC_PENT, KC_PENT 183#define ___KEYPAD_4_ALT___ KC_P0, KC_DOT, KC_PENT, KC_PENT
184 184
185// For Bepo 185// For Bepo
186#define ___KEYPAD_1_BP___ DB_7, DB_8, DB_9, BP_SLASH 186#define ___KEYPAD_1_BP___ DB_7, DB_8, DB_9, BP_SLSH
187#define ___KEYPAD_2_BP___ DB_4, DB_5, DB_6, BP_ASTR 187#define ___KEYPAD_2_BP___ DB_4, DB_5, DB_6, BP_ASTR
188#define ___KEYPAD_3_BP___ DB_1, DB_2, DB_3, DB_MINUS 188#define ___KEYPAD_3_BP___ DB_1, DB_2, DB_3, DB_MINUS
189#define ___KEYPAD_4_BP___ DB_0, DB_DOT, DB_EQL, BP_PLUS 189#define ___KEYPAD_4_BP___ DB_0, DB_DOT, DB_EQL, BP_PLUS
@@ -225,9 +225,9 @@
225 225
226// SYMBOLS FOR BEPO 226// SYMBOLS FOR BEPO
227// The top row. Bepo has symbols not numbers. Numbers are the shifted values. 227// The top row. Bepo has symbols not numbers. Numbers are the shifted values.
228#define ___SYMBOL_BEPO_L___ /* BP_DLR */ BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN 228#define ___SYMBOL_BEPO_L___ /* BP_DLR */ BP_DQUO, BP_LDAQ, BP_RDAQ, BP_LPRN, BP_RPRN
229/* KC_DEL, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, */ 229/* KC_DEL, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, BP_EQL, */
230#define ___SYMBOL_BEPO_R___ BP_AT, BP_PLUS, BP_MINS, BP_SLASH, BP_ASTR /* BP_EQL, BP_PERC */ 230#define ___SYMBOL_BEPO_R___ BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR /* BP_EQL, BP_PERC */
231 231
232// An arrangement for the left hand with a focus on the ()[]{}s. 232// An arrangement for the left hand with a focus on the ()[]{}s.
233#define ___SYMBOLS_1_BP___ KC_EXLM, BP_AT, DB_LCBR, DB_RCBR, DB_PIPE 233#define ___SYMBOLS_1_BP___ KC_EXLM, BP_AT, DB_LCBR, DB_RCBR, DB_PIPE
@@ -237,7 +237,7 @@
237// A larger 6 column arrangement for the left hand, A merge of dvorak and the above. 237// A larger 6 column arrangement for the left hand, A merge of dvorak and the above.
238#define ___SYMBOLS6_1_BP___ DB_GRV, DB_LESS, DB_GRTR, DB_LCBR, DB_RCBR, DB_HASH 238#define ___SYMBOLS6_1_BP___ DB_GRV, DB_LESS, DB_GRTR, DB_LCBR, DB_RCBR, DB_HASH
239#define ___SYMBOLS6_2_BP___ KC_AMPR, BP_AT, BP_ASTR, DB_LPRN, DB_RPRN, BP_PERC 239#define ___SYMBOLS6_2_BP___ KC_AMPR, BP_AT, BP_ASTR, DB_LPRN, DB_RPRN, BP_PERC
240#define ___SYMBOLS6_3_BP___ BP_DLR, BP_DQOT, DB_QUOT, DB_LBRC, DB_RBRC, KC_COLON 240#define ___SYMBOLS6_3_BP___ BP_DLR, BP_DQUO, DB_QUOT, DB_LBRC, DB_RBRC, KC_COLON
241#define ___SYMBOLS6_4_BP___ ___2___, DB_TILD, DB_DOT, KC_EXLM, DB_SCOLON 241#define ___SYMBOLS6_4_BP___ ___2___, DB_TILD, DB_DOT, KC_EXLM, DB_SCOLON
242 242
243#define ___SYMBOLS5_4_BP___ ___, DB_TILD, DB_DOT, KC_EXLM, DB_SCOLON 243#define ___SYMBOLS5_4_BP___ ___, DB_TILD, DB_DOT, KC_EXLM, DB_SCOLON
@@ -248,9 +248,9 @@
248#define ___SYMPAD_1_BP___ DB_GRV, BP_AMPR, BP_ASTR, DB_LCBR, BP_PLUS, DB_PIPE 248#define ___SYMPAD_1_BP___ DB_GRV, BP_AMPR, BP_ASTR, DB_LCBR, BP_PLUS, DB_PIPE
249#define ___SYMPAD_2_BP___ DB_TILD, BP_DLR, BP_PERC, DB_CIRC, BP_ASTR, DB_GRV 249#define ___SYMPAD_2_BP___ DB_TILD, BP_DLR, BP_PERC, DB_CIRC, BP_ASTR, DB_GRV
250#define ___SYMPAD_3_BP___ ___, BP_EXLM, BP_AT, DB_HASH, BP_MINS, BP_SLSH 250#define ___SYMPAD_3_BP___ ___, BP_EXLM, BP_AT, DB_HASH, BP_MINS, BP_SLSH
251#define ___SYMPAD_4_BP___ ___, DB_RCBR, DB_DOT, BP_EQL, BP_MINUS, DB_BACKSLASH 251#define ___SYMPAD_4_BP___ ___, DB_RCBR, DB_DOT, BP_EQL, BP_MINS, DB_BACKSLASH
252 252
253#define ___5_SYMPAD_4_BP___ DB_RCBR, DB_DOT, BP_EQL, BP_MINUS, DB_BACKSLASH 253#define ___5_SYMPAD_4_BP___ DB_RCBR, DB_DOT, BP_EQL, BP_MINS, DB_BACKSLASH
254 254
255// Parts are parts. 255// Parts are parts.
256// MOUSE, ARROW and MEDIA KEY SETS 256// MOUSE, ARROW and MEDIA KEY SETS
diff --git a/users/ericgebhart/ericgebhart.c b/users/ericgebhart/ericgebhart.c
index abb87899b..d34563865 100644
--- a/users/ericgebhart/ericgebhart.c
+++ b/users/ericgebhart/ericgebhart.c
@@ -86,25 +86,25 @@ static void switch_default_layer(uint8_t layer) {
86// reasnably sized array without difficulties. The macro is for the constant declarations 86// reasnably sized array without difficulties. The macro is for the constant declarations
87// the function is for when we use it. 87// the function is for when we use it.
88const uint8_t key_translations[][2][2] = { 88const uint8_t key_translations[][2][2] = {
89 [GR(DB_1)] = {{BP_DQOT, MOD_LSFT}, {BP_DCRC, MOD_LSFT}}, 89 [GR(DB_1)] = {{BP_DQUO, MOD_LSFT}, {BP_DCIR, MOD_LSFT}},
90 [GR(DB_2)] = {{BP_LGIL, MOD_LSFT}, {BP_AT, MOD_NONE}}, 90 [GR(DB_2)] = {{BP_LDAQ, MOD_LSFT}, {BP_AT, MOD_NONE}},
91 [GR(DB_3)] = {{BP_RGIL, MOD_LSFT}, {BP_DLR, MOD_LSFT}}, 91 [GR(DB_3)] = {{BP_RDAQ, MOD_LSFT}, {BP_DLR, MOD_LSFT}},
92 [GR(DB_4)] = {{BP_LPRN, MOD_LSFT}, {BP_DLR, MOD_NONE}}, 92 [GR(DB_4)] = {{BP_LPRN, MOD_LSFT}, {BP_DLR, MOD_NONE}},
93 [GR(DB_5)] = {{BP_RPRN, MOD_LSFT}, {BP_PERC, MOD_NONE}}, 93 [GR(DB_5)] = {{BP_RPRN, MOD_LSFT}, {BP_PERC, MOD_NONE}},
94 [GR(DB_6)] = {{BP_AT, MOD_LSFT}, {BP_AT, MOD_BIT(KC_RALT)}}, 94 [GR(DB_6)] = {{BP_AT, MOD_LSFT}, {BP_AT, MOD_BIT(KC_RALT)}},
95 [GR(DB_7)] = {{BP_PLUS, MOD_LSFT}, {BP_P, MOD_BIT(KC_RALT)}}, 95 [GR(DB_7)] = {{BP_PLUS, MOD_LSFT}, {BP_P, MOD_BIT(KC_RALT)}},
96 [GR(DB_8)] = {{BP_MINS, MOD_LSFT}, {BP_ASTR, MOD_NONE}}, 96 [GR(DB_8)] = {{BP_MINS, MOD_LSFT}, {BP_ASTR, MOD_NONE}},
97 [GR(DB_9)] = {{BP_SLASH, MOD_LSFT}, {BP_LPRN, MOD_NONE}}, 97 [GR(DB_9)] = {{BP_SLSH, MOD_LSFT}, {BP_LPRN, MOD_NONE}},
98 [GR(DB_0)] = {{BP_ASTR, MOD_LSFT}, {BP_RPRN, MOD_NONE}}, 98 [GR(DB_0)] = {{BP_ASTR, MOD_LSFT}, {BP_RPRN, MOD_NONE}},
99 [GR(DB_GRV)] = {{BP_PERC, MOD_LSFT}, {BP_K, MOD_BIT(KC_RALT)}}, 99 [GR(DB_GRV)] = {{BP_PERC, MOD_LSFT}, {BP_K, MOD_BIT(KC_RALT)}},
100 [GR(DB_SCOLON)] = {{BP_COMM, MOD_LSFT}, {BP_DOT, MOD_LSFT}}, 100 [GR(DB_SCOLON)] = {{BP_COMM, MOD_LSFT}, {BP_DOT, MOD_LSFT}},
101 [GR(DB_SLASH)] = {{BP_SLASH, MOD_NONE}, {BP_APOS, MOD_LSFT}}, 101 [GR(DB_SLASH)] = {{BP_SLSH, MOD_NONE}, {BP_QUOT, MOD_LSFT}},
102 [GR(DB_BACKSLASH)] = {{BP_AGRV, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}}, 102 [GR(DB_BACKSLASH)] = {{BP_AGRV, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}},
103 [GR(DB_EQL)] = {{BP_EQL, MOD_NONE}, {BP_PLUS, MOD_NONE}}, 103 [GR(DB_EQL)] = {{BP_EQL, MOD_NONE}, {BP_PLUS, MOD_NONE}},
104 [GR(DB_COMM)] = {{BP_COMMA, MOD_NONE}, {BP_LGIL, MOD_BIT(KC_RALT)}}, 104 [GR(DB_COMM)] = {{BP_COMM, MOD_NONE}, {BP_LDAQ, MOD_BIT(KC_RALT)}},
105 [GR(DB_DOT)] = {{BP_DOT, MOD_NONE}, {BP_RGIL, MOD_BIT(KC_RALT)}}, 105 [GR(DB_DOT)] = {{BP_DOT, MOD_NONE}, {BP_RDAQ, MOD_BIT(KC_RALT)}},
106 [GR(DB_QUOT)] = {{BP_APOS, MOD_NONE}, {BP_DQOT, MOD_NONE}}, 106 [GR(DB_QUOT)] = {{BP_QUOT, MOD_NONE}, {BP_DQUO, MOD_NONE}},
107 [GR(DB_MINUS)] = {{BP_MINUS, MOD_NONE}, {KC_SPC, MOD_BIT(KC_RALT)}}, 107 [GR(DB_MINUS)] = {{BP_MINS, MOD_NONE}, {KC_SPC, MOD_BIT(KC_RALT)}},
108 [GR(DB_LPRN)] = {{BP_LPRN, MOD_NONE}, {BP_LPRN, MOD_BIT(KC_RALT)}}, 108 [GR(DB_LPRN)] = {{BP_LPRN, MOD_NONE}, {BP_LPRN, MOD_BIT(KC_RALT)}},
109 [GR(DB_RPRN)] = {{BP_RPRN, MOD_NONE}, {BP_RPRN, MOD_BIT(KC_RALT)}}, 109 [GR(DB_RPRN)] = {{BP_RPRN, MOD_NONE}, {BP_RPRN, MOD_BIT(KC_RALT)}},
110 [GR(DB_LBRC)] = {{BP_Y, MOD_BIT(KC_RALT)}, {BP_LPRN, MOD_BIT(KC_RALT)}}, 110 [GR(DB_LBRC)] = {{BP_Y, MOD_BIT(KC_RALT)}, {BP_LPRN, MOD_BIT(KC_RALT)}},
@@ -116,8 +116,8 @@ const uint8_t key_translations[][2][2] = {
116 [GR(DB_PIPE)] = {{BP_B, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}}, 116 [GR(DB_PIPE)] = {{BP_B, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}},
117 [GR(DB_TILD)] = {{BP_K, MOD_BIT(KC_RALT)}, {BP_K, MOD_BIT(KC_RALT)}}, 117 [GR(DB_TILD)] = {{BP_K, MOD_BIT(KC_RALT)}, {BP_K, MOD_BIT(KC_RALT)}},
118 [GR(DB_CIRC)] = {{BP_AT, MOD_BIT(KC_RALT)}, {BP_AT, MOD_BIT(KC_RALT)}}, 118 [GR(DB_CIRC)] = {{BP_AT, MOD_BIT(KC_RALT)}, {BP_AT, MOD_BIT(KC_RALT)}},
119 [GR(DB_LESS)] = {{BP_LGIL, MOD_BIT(KC_RALT)}, {BP_LGIL, MOD_BIT(KC_RALT)}}, 119 [GR(DB_LESS)] = {{BP_LDAQ, MOD_BIT(KC_RALT)}, {BP_LDAQ, MOD_BIT(KC_RALT)}},
120 [GR(DB_GRTR)] = {{BP_RGIL, MOD_BIT(KC_RALT)}, {BP_RGIL, MOD_BIT(KC_RALT)}}, 120 [GR(DB_GRTR)] = {{BP_RDAQ, MOD_BIT(KC_RALT)}, {BP_RDAQ, MOD_BIT(KC_RALT)}},
121}; 121};
122 122
123 123
diff --git a/users/ericgebhart/rules.mk b/users/ericgebhart/rules.mk
index 70017a595..360abed94 100755
--- a/users/ericgebhart/rules.mk
+++ b/users/ericgebhart/rules.mk
@@ -12,4 +12,3 @@ CONSOLE_ENABLE = no # Console for debug
12BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration 12BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
13UNICODE_ENABLE = no 13UNICODE_ENABLE = no
14SLEEP_LED_ENABLE = no 14SLEEP_LED_ENABLE = no
15API_SYSEX_ENABLE = no
diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c
index 72aca9fb8..3fdf5a4ca 100644
--- a/users/konstantin/konstantin.c
+++ b/users/konstantin/konstantin.c
@@ -97,7 +97,7 @@ uint32_t layer_state_set_keymap(uint32_t state) {
97 return state; 97 return state;
98} 98}
99 99
100uint32_t layer_state_set_user(uint32_t state) { 100layer_state_t layer_state_set_user(layer_state_t state) {
101 state = layer_state_set_keymap(state); 101 state = layer_state_set_keymap(state);
102 102
103#ifdef LAYER_NUMPAD 103#ifdef LAYER_NUMPAD
diff --git a/users/kuchosauronad0/kuchosauronad0.c b/users/kuchosauronad0/kuchosauronad0.c
index 6c38d0f10..a8f17b08e 100644
--- a/users/kuchosauronad0/kuchosauronad0.c
+++ b/users/kuchosauronad0/kuchosauronad0.c
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2019 Andre Poley <andre.poley@mailbox.org> 2Copyright 2019 Andre Poley <andre.poley@mailbox.org>
3 3
4This program is free software: you can redistribute it and/or modify 4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
@@ -123,7 +123,7 @@ uint32_t layer_state_set_keymap (uint32_t state) {
123 123
124// on layer change, no matter where the change was initiated 124// on layer change, no matter where the change was initiated
125// Then runs keymap's layer change check 125// Then runs keymap's layer change check
126uint32_t layer_state_set_user(uint32_t state) { 126layer_state_t layer_state_set_user(layer_state_t state) {
127 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); 127 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
128#ifdef RGBLIGHT_ENABLE 128#ifdef RGBLIGHT_ENABLE
129 state = layer_state_set_rgb(state); 129 state = layer_state_set_rgb(state);
diff --git a/users/mtdjr/mtdjr.c b/users/mtdjr/mtdjr.c
index c31b077b4..9c6c26bc8 100644
--- a/users/mtdjr/mtdjr.c
+++ b/users/mtdjr/mtdjr.c
@@ -136,7 +136,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
136 return true; 136 return true;
137}; 137};
138 138
139uint32_t layer_state_set_user(uint32_t state) { 139layer_state_t layer_state_set_user(layer_state_t state) {
140 switch (biton32(state)) { 140 switch (biton32(state)) {
141 case _RAISE: 141 case _RAISE:
142 #ifdef RGBLIGHT_ENABLE 142 #ifdef RGBLIGHT_ENABLE
diff --git a/users/pvinis/pvinis.c b/users/pvinis/pvinis.c
index 31c3023e8..71f9210ae 100644
--- a/users/pvinis/pvinis.c
+++ b/users/pvinis/pvinis.c
@@ -10,7 +10,7 @@ float song_test[][2] = SONG(QWERTY_SOUND);
10#endif 10#endif
11 11
12// SYMBOL + SYSCTL = KBCTL 12// SYMBOL + SYSCTL = KBCTL
13uint32_t layer_state_set_user(uint32_t state) { 13layer_state_t layer_state_set_user(layer_state_t state) {
14 uint32_t intermediate_state = update_tri_layer_state(state, LR_SYMBOL, LR_SYSCTL, LR_KBCTL); 14 uint32_t intermediate_state = update_tri_layer_state(state, LR_SYMBOL, LR_SYSCTL, LR_KBCTL);
15 intermediate_state = layer_state_set_user_keymap(intermediate_state); 15 intermediate_state = layer_state_set_user_keymap(intermediate_state);
16 return intermediate_state; 16 return intermediate_state;
diff --git a/users/romus/romus.c b/users/romus/romus.c
index 35b524f94..f707bb884 100644
--- a/users/romus/romus.c
+++ b/users/romus/romus.c
@@ -72,7 +72,7 @@ __attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) { }
72// Set RGBLIGHT state depending on layer 72// Set RGBLIGHT state depending on layer
73void rgblight_change( uint8_t this_layer ) { 73void rgblight_change( uint8_t this_layer ) {
74 // Enable RGB light; will not work without this 74 // Enable RGB light; will not work without this
75 //rgblight_enable_noeeprom(); 75 //rgblight_enable_noeeprom();
76 // Change RGB light 76 // Change RGB light
77 switch ( this_layer ) { 77 switch ( this_layer ) {
78 case _DV: 78 case _DV:
@@ -83,21 +83,21 @@ void rgblight_change( uint8_t this_layer ) {
83 // Do yellow for alternate 83 // Do yellow for alternate
84 rgblight_enable_noeeprom(); 84 rgblight_enable_noeeprom();
85 rgblight_sethsv_noeeprom( 60,255,255); 85 rgblight_sethsv_noeeprom( 60,255,255);
86 86
87 87
88 break; 88 break;
89 case _GA: 89 case _GA:
90 // Do purple for game 90 // Do purple for game
91 rgblight_enable_noeeprom(); 91 rgblight_enable_noeeprom();
92 rgblight_sethsv_noeeprom(285,255,255); 92 rgblight_sethsv_noeeprom(285,255,255);
93 93
94 94
95 break; 95 break;
96 case _NU: 96 case _NU:
97 // Do azure for number 97 // Do azure for number
98 rgblight_enable_noeeprom(); 98 rgblight_enable_noeeprom();
99 rgblight_sethsv_noeeprom(186,200,255); 99 rgblight_sethsv_noeeprom(186,200,255);
100 100
101 101
102 break; 102 break;
103 case _SE: 103 case _SE:
@@ -105,27 +105,27 @@ void rgblight_change( uint8_t this_layer ) {
105 rgblight_enable_noeeprom(); 105 rgblight_enable_noeeprom();
106 106
107 rgblight_sethsv_noeeprom( 16,255,255); 107 rgblight_sethsv_noeeprom( 16,255,255);
108 108
109 break; 109 break;
110 case _MO: 110 case _MO:
111 // Do green for mouse 111 // Do green for mouse
112 rgblight_enable_noeeprom(); 112 rgblight_enable_noeeprom();
113 rgblight_sethsv_noeeprom(120,255,255); 113 rgblight_sethsv_noeeprom(120,255,255);
114 114
115 115
116 break; 116 break;
117 case _MU: 117 case _MU:
118 // Do orange for music 118 // Do orange for music
119 119
120 rgblight_enable_noeeprom(); 120 rgblight_enable_noeeprom();
121 rgblight_sethsv_noeeprom( 39,255,255); 121 rgblight_sethsv_noeeprom( 39,255,255);
122 122
123 break; 123 break;
124 default: 124 default:
125 // Something went wrong 125 // Something went wrong
126 rgblight_enable_noeeprom(); 126 rgblight_enable_noeeprom();
127 rgblight_sethsv_noeeprom( 0,255,255); 127 rgblight_sethsv_noeeprom( 0,255,255);
128 128
129 break; 129 break;
130 } 130 }
131} 131}
@@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
189 } 189 }
190 return false; 190 return false;
191 break; 191 break;
192#endif 192#endif
193 193
194 // Lock functionality: These layers are locked if the LOCKED buttons are 194 // Lock functionality: These layers are locked if the LOCKED buttons are
195 // pressed. Otherwise, they are momentary toggles 195 // pressed. Otherwise, they are momentary toggles
@@ -225,7 +225,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
225 } 225 }
226 return false; 226 return false;
227 break; 227 break;
228 228
229 // Layer switches with sound 229 // Layer switches with sound
230 case K_GAMES: 230 case K_GAMES:
231 if (record->event.pressed) { 231 if (record->event.pressed) {
@@ -546,7 +546,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
546|*-----LAYER CHANGE-----*| 546|*-----LAYER CHANGE-----*|
547\*----------------------*/ 547\*----------------------*/
548 548
549uint32_t layer_state_set_user(uint32_t state) { 549layer_state_t layer_state_set_user(layer_state_t state) {
550 550
551 state = layer_state_set_keymap (state); 551 state = layer_state_set_keymap (state);
552#ifdef RGBLIGHT_ENABLE 552#ifdef RGBLIGHT_ENABLE
@@ -554,4 +554,4 @@ uint32_t layer_state_set_user(uint32_t state) {
554 rgblight_change( biton32(state) ); 554 rgblight_change( biton32(state) );
555#endif 555#endif
556 return state; 556 return state;
557} \ No newline at end of file 557}
diff --git a/users/romus/rules.mk b/users/romus/rules.mk
index 12bbabb02..58f7ccf9c 100644
--- a/users/romus/rules.mk
+++ b/users/romus/rules.mk
@@ -16,8 +16,6 @@ SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested.
16NKRO_ENABLE = no # Default is 6KRO which is plenty 16NKRO_ENABLE = no # Default is 6KRO which is plenty
17MIDI_ENABLE = no # Untested feature 17MIDI_ENABLE = no # Untested feature
18KEY_LOCK_ENABLE = no # Allows locking any key. Not used 18KEY_LOCK_ENABLE = no # Allows locking any key. Not used
19API_SYSEX_ENABLE = no # Allows OS to send signals.
20
21 19
22# Disabling this makes it compile, i dont know why 20# Disabling this makes it compile, i dont know why
23# VARIABLE_TRACE = no # Allows debugging variables 21# VARIABLE_TRACE = no # Allows debugging variables
diff --git a/users/sigul/sigul.c b/users/sigul/sigul.c
index 0995ca736..16bcd411d 100644
--- a/users/sigul/sigul.c
+++ b/users/sigul/sigul.c
@@ -40,13 +40,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
40 case IT_APDQ: 40 case IT_APDQ:
41 if (record->event.pressed){ 41 if (record->event.pressed){
42 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ 42 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){
43 register_code16(IT_DQOT); 43 register_code16(IT_DQUO);
44 } else { 44 } else {
45 register_code16(IT_APOS); 45 register_code16(IT_QUOT);
46 } 46 }
47 } else { 47 } else {
48 unregister_code16(IT_DQOT); 48 unregister_code16(IT_DQUO);
49 unregister_code16(IT_APOS); 49 unregister_code16(IT_QUOT);
50 } 50 }
51 return false; 51 return false;
52 break; 52 break;
@@ -55,13 +55,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
55 if (record->event.pressed){ 55 if (record->event.pressed){
56 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ 56 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){
57 unregister_code16(KC_LSFT); 57 unregister_code16(KC_LSFT);
58 register_code16(IT_LESS); 58 register_code16(IT_LABK);
59 register_code16(KC_LSFT); 59 register_code16(KC_LSFT);
60 } else { 60 } else {
61 register_code16(IT_COMM); 61 register_code16(IT_COMM);
62 } 62 }
63 } else { 63 } else {
64 unregister_code16(IT_LESS); 64 unregister_code16(IT_LABK);
65 unregister_code16(IT_COMM); 65 unregister_code16(IT_COMM);
66 } 66 }
67 return false; 67 return false;
@@ -70,12 +70,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
70 case IT_DTMR: 70 case IT_DTMR:
71 if (record->event.pressed){ 71 if (record->event.pressed){
72 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ 72 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){
73 register_code16(IT_MORE); 73 register_code16(IT_RABK);
74 } else { 74 } else {
75 register_code16(IT_DOT); 75 register_code16(IT_DOT);
76 } 76 }
77 } else { 77 } else {
78 unregister_code16(IT_MORE); 78 unregister_code16(IT_RABK);
79 unregister_code16(IT_DOT); 79 unregister_code16(IT_DOT);
80 } 80 }
81 return false; 81 return false;
@@ -84,12 +84,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
84 case IT_SLQS: 84 case IT_SLQS:
85 if (record->event.pressed){ 85 if (record->event.pressed){
86 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){ 86 if (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)){
87 register_code16(IT_QST); 87 register_code16(IT_QUES);
88 } else { 88 } else {
89 register_code16(IT_SLSH); 89 register_code16(IT_SLSH);
90 } 90 }
91 } else { 91 } else {
92 unregister_code16(IT_QST); 92 unregister_code16(IT_QUES);
93 unregister_code16(IT_SLSH); 93 unregister_code16(IT_SLSH);
94 } 94 }
95 return false; 95 return false;
diff --git a/users/sigul/sigul.h b/users/sigul/sigul.h
index 6adc67063..8f806017c 100644
--- a/users/sigul/sigul.h
+++ b/users/sigul/sigul.h
@@ -15,10 +15,10 @@ enum userspace_layers {
15enum userspace_custom_keycodes { 15enum userspace_custom_keycodes {
16 QWERTY = SAFE_RANGE, 16 QWERTY = SAFE_RANGE,
17 // custom keycodes for an Italian ANSI layout with accented vowels 17 // custom keycodes for an Italian ANSI layout with accented vowels
18 IT_CMLS, // IT_COMM and IT_LESS when combined with shift 18 IT_CMLS, // IT_COMM and IT_LABK when combined with shift
19 IT_DTMR, // IT_DOT and IT_MORE when combined with shift 19 IT_DTMR, // IT_DOT and IT_RABK when combined with shift
20 IT_SLQS, // IT_SLSH and IT_QST when combined with shift 20 IT_SLQS, // IT_SLSH and IT_QUES when combined with shift
21 IT_APDQ, // IT_APO and IT_DQOT when combined with shift 21 IT_APDQ, // IT_APO and IT_DQUO when combined with shift
22 IT_SCCL, // IT_SMCL and IT_COLN when combined with shift 22 IT_SCCL, // IT_SMCL and IT_COLN when combined with shift
23 SECRET0, 23 SECRET0,
24 SECRET1, 24 SECRET1,
diff --git a/users/spacebarracecar/spacebarracecar.c b/users/spacebarracecar/spacebarracecar.c
index bbd864aa9..3141b8758 100644
--- a/users/spacebarracecar/spacebarracecar.c
+++ b/users/spacebarracecar/spacebarracecar.c
@@ -178,11 +178,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
178 } 178 }
179 return false; 179 return false;
180 case CU_AE: 180 case CU_AE:
181 UML(DE_AE) 181 UML(DE_ADIA)
182 case CU_OE: 182 case CU_OE:
183 UML(DE_OE) 183 UML(DE_ODIA)
184 case CU_UE: 184 case CU_UE:
185 UML(DE_UE) 185 UML(DE_UDIA)
186 case CU_SS: 186 case CU_SS:
187 if(record->event.pressed) { 187 if(record->event.pressed) {
188 timer_timeout(); 188 timer_timeout();
@@ -291,9 +291,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
291 } 291 }
292 return false; 292 return false;
293 case CU_COMM: 293 case CU_COMM:
294 SHIFT_NO(DE_COMM, DE_LESS) 294 SHIFT_NO(DE_COMM, DE_LABK)
295 case CU_DOT: 295 case CU_DOT:
296 SHIFT_NORM(DE_DOT, DE_LESS) 296 SHIFT_NORM(DE_DOT, DE_LABK)
297 case CU_SLSH: 297 case CU_SLSH:
298 SHIFT_ALL(DE_7, DE_SS) 298 SHIFT_ALL(DE_7, DE_SS)
299 case CU_SCLN: 299 case CU_SCLN:
@@ -315,7 +315,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
315 case CU_RBRC: 315 case CU_RBRC:
316 SHIFT_ALGR(DE_9, DE_0) 316 SHIFT_ALGR(DE_9, DE_0)
317 case CU_BSLS: 317 case CU_BSLS:
318 SHIFT_ALGR(DE_SS, DE_LESS) 318 SHIFT_ALGR(DE_SS, DE_LABK)
319 case CU_Z: 319 case CU_Z:
320 CTRL(DE_Z, KC_Z) 320 CTRL(DE_Z, KC_Z)
321 case CU_Y: 321 case CU_Y:
diff --git a/users/spidey3/config.h b/users/spidey3/config.h
index 7062fde03..f5f5e07f0 100644
--- a/users/spidey3/config.h
+++ b/users/spidey3/config.h
@@ -1,7 +1,7 @@
1#pragma once 1#pragma once
2 2
3#define LED_DISABLE_WHEN_USB_SUSPENDED true 3#define LED_DISABLE_WHEN_USB_SUSPENDED
4#define RGB_DISABLE_WHEN_USB_SUSPENDED true 4#define RGB_DISABLE_WHEN_USB_SUSPENDED
5#define RGBLIGHT_LAYERS 5#define RGBLIGHT_LAYERS
6#define RGBLIGHT_MAX_LAYERS 17 6#define RGBLIGHT_MAX_LAYERS 17
7#define RGBLIGHT_LAYER_BLINK 7#define RGBLIGHT_LAYER_BLINK
diff --git a/users/stanrc85/layer_rgb.c b/users/stanrc85/layer_rgb.c
index 58f17489a..6d57198f3 100644
--- a/users/stanrc85/layer_rgb.c
+++ b/users/stanrc85/layer_rgb.c
@@ -4,7 +4,7 @@ void matrix_init_user(void) {
4 rgblight_setrgb(0xFF, 0x00, 0x00); 4 rgblight_setrgb(0xFF, 0x00, 0x00);
5}; 5};
6 6
7uint32_t layer_state_set_user(uint32_t state) { 7layer_state_t layer_state_set_user(layer_state_t state) {
8 switch (biton32(state)) { 8 switch (biton32(state)) {
9 case 0: 9 case 0:
10 rgblight_setrgb (0xFF, 0x00, 0x00); 10 rgblight_setrgb (0xFF, 0x00, 0x00);
diff --git a/users/tominabox1/config.h b/users/tominabox1/config.h
index 2a8c1e943..004f58ab5 100644
--- a/users/tominabox1/config.h
+++ b/users/tominabox1/config.h
@@ -31,7 +31,7 @@
31// RGB_Matrix settings 31// RGB_Matrix settings
32#ifdef RGB_MATRIX_ENABLE 32#ifdef RGB_MATRIX_ENABLE
33 #define RGB_MATRIX_KEYPRESSES // reacts to keypresses 33 #define RGB_MATRIX_KEYPRESSES // reacts to keypresses
34 #define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended 34 #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
35 #define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) 35 #define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
36 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. 36 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
37 #define RGB_MATRIX_HUE_STEP 8 37 #define RGB_MATRIX_HUE_STEP 8
diff --git a/users/tominabox1/tominabox1.c b/users/tominabox1/tominabox1.c
index d2e9e1258..34fe3068a 100644
--- a/users/tominabox1/tominabox1.c
+++ b/users/tominabox1/tominabox1.c
@@ -126,7 +126,7 @@ layer_state_t layer_state_set_keymap (layer_state_t state) {
126 return state; 126 return state;
127} 127}
128 128
129uint32_t layer_state_set_user(uint32_t state) { 129layer_state_t layer_state_set_user(layer_state_t state) {
130 state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); 130 state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
131 switch (biton32(state)) { 131 switch (biton32(state)) {
132 case _LOWER: 132 case _LOWER:
diff --git a/users/turbomech/backupturbomech.c b/users/turbomech/backupturbomech.c
index 2815aa452..aaea05df9 100644
--- a/users/turbomech/backupturbomech.c
+++ b/users/turbomech/backupturbomech.c
@@ -296,7 +296,7 @@ case RGB_MODE_GRADIENT:
296 296
297} 297}
298 298
299uint32_t layer_state_set_user(uint32_t state) { 299layer_state_t layer_state_set_user(layer_state_t state) {
300#ifdef RGBLIGHT_ENABLE 300#ifdef RGBLIGHT_ENABLE
301 uint8_t default_layer = eeconfig_read_default_layer(); 301 uint8_t default_layer = eeconfig_read_default_layer();
302 if (rgb_layer_change) { 302 if (rgb_layer_change) {
diff --git a/users/xulkal/process_records.c b/users/xulkal/process_records.c
index b6a4e5cfa..47996110b 100644
--- a/users/xulkal/process_records.c
+++ b/users/xulkal/process_records.c
@@ -6,7 +6,7 @@
6#endif 6#endif
7 7
8#ifdef TRILAYER_ENABLED 8#ifdef TRILAYER_ENABLED
9uint32_t layer_state_set_user(uint32_t state) 9layer_state_t layer_state_set_user(layer_state_t state)
10{ 10{
11 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); 11 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
12} 12}