aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/community/split_3x6_3/drashna/keymap.c141
-rw-r--r--users/drashna/drashna.c11
-rw-r--r--users/drashna/oled_stuff.c20
-rw-r--r--users/drashna/rules.mk16
-rw-r--r--users/drashna/transport_sync.c33
-rw-r--r--users/drashna/transport_sync.h10
6 files changed, 180 insertions, 51 deletions
diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c
index 707dd3646..a3145a404 100644
--- a/layouts/community/split_3x6_3/drashna/keymap.c
+++ b/layouts/community/split_3x6_3/drashna/keymap.c
@@ -97,6 +97,143 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
97 97
98#ifdef OLED_ENABLE 98#ifdef OLED_ENABLE
99oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_270; } 99oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_270; }
100
101# ifdef CONVERT_TO_PROTON_C
102// WPM-responsive animation stuff here
103# define SLEEP_FRAMES 2
104# define SLEEP_SPEED 10 // below this wpm value your animation will idle
105
106# define WAKE_FRAMES 2 // uncomment if >1
107
108# define KAKI_FRAMES 3
109# define KAKI_SPEED 40 // above this wpm value typing animation to triggere
110
111# define RTOGI_FRAMES 2
112//#define LTOGI_FRAMES 2
113
114//#define ANIM_FRAME_DURATION 500 // how long each frame lasts in ms
115// #define SLEEP_TIMER 60000 // should sleep after this period of 0 wpm, needs fixing
116# define ANIM_SIZE 512 // number of bytes in array, minimize for adequate firmware size, max is 1024
117
118uint32_t anim_timer = 0;
119uint32_t anim_frame_duration = 500;
120uint8_t current_sleep_frame = 0;
121uint8_t current_wake_frame = 0; // uncomment if WAKE_FRAMES >1
122uint8_t current_kaki_frame = 0;
123uint8_t current_rtogi_frame = 0;
124// uint8_t current_ltogi_frame = 0;
125// clang-format off
126void render_kitty(void) {
127 // Images credit j-inc(/James Incandenza) and pixelbenny. Credit to obosob for initial animation approach.
128 static const char PROGMEM sleep[SLEEP_FRAMES][ANIM_SIZE] = {{
129 // 'sleep1', 32x32px
130 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xa8, 0x48, 0xa8, 0x18, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
131 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x80, 0x44, 0x84, 0x06, 0x05, 0x04, 0x80, 0x40, 0x20, 0x10, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
132 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x04, 0x04, 0x02, 0x7a, 0x86, 0x01, 0x80, 0x80, 0x01, 0x03, 0x05, 0x07, 0x01, 0x00, 0x00, 0x80, 0x83, 0x45, 0xfa, 0x3c, 0xe0, 0x00, 0x00,
133 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x29, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00,
134 },
135 {// 'sleep2', 32x32px
136 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
137 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x3a, 0x2a, 0x26, 0x22, 0x80, 0xc0, 0x80, 0x00, 0x24, 0x34, 0x2c, 0xe4, 0x60, 0x10, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
138 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x04, 0x02, 0x02, 0x01, 0x79, 0x87, 0x01, 0x80, 0x81, 0x83, 0x05, 0x05, 0x03, 0x01, 0x00, 0x00, 0x80, 0x43, 0x05, 0xfa, 0x3c, 0xe0, 0x00, 0x00,
139 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x33, 0x24, 0x28, 0x28, 0x28, 0x29, 0x29, 0x3a, 0x18, 0x1c, 0x39, 0x24, 0x24, 0x3a, 0x2d, 0x26, 0x31, 0x1f, 0x00
140 }};
141 static const char PROGMEM wake[WAKE_FRAMES][ANIM_SIZE] = {{
142 // 'mati2', 32x32px
143 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
144 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x40, 0x40, 0x5c, 0x00, 0x01, 0x41, 0x01, 0x00, 0x5c, 0x40, 0x40, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
146 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08
147 },
148 {// 'mati3', 32x32px
149 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x08, 0x10, 0x60, 0x80, 0x00, 0x80, 0x60, 0x10, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
150 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x90, 0x12, 0x0a, 0x02, 0xf4, 0x09, 0x0d, 0xf1, 0x04, 0x02, 0x0a, 0x12, 0x90, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
151 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x80, 0xe1, 0x12, 0x0a, 0x06, 0x01, 0x81, 0x00, 0x06, 0x0a, 0x12, 0xe1, 0x80, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
152 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x11, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1c, 0x14, 0x14, 0x14, 0x08
153 }};
154 static const char PROGMEM kaki[KAKI_FRAMES][ANIM_SIZE] = {{
155 // 'jare2', 32x32px
156 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x80, 0x80, 0x00, 0xfc, 0x84, 0x08, 0x08, 0x10, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
157 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1e, 0x60, 0x80, 0x00, 0x00, 0x91, 0xa1, 0x80, 0x00, 0x00, 0x22, 0x84, 0x40, 0x50, 0x48, 0xc1, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
158 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x41, 0x82, 0xe2, 0x12, 0x0a, 0x06, 0x00, 0x80, 0x88, 0x4f, 0x02, 0x22, 0xe2, 0x9f, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
159 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x14, 0x14, 0x1f, 0x1a, 0x0a, 0x0a, 0x04, 0x00
160 },
161 {
162 // 'kaki1', 32x32px
163 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
164 0x00, 0x00, 0x06, 0x1a, 0x22, 0xc2, 0x04, 0x04, 0x04, 0x07, 0x00, 0xc0, 0x20, 0x10, 0x80, 0x80, 0x01, 0x01, 0x02, 0xfc, 0xfe, 0x02, 0x3c, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
165 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x09, 0x08, 0x00, 0x80, 0x00, 0x06, 0x09, 0x1b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x81, 0xfe, 0x00, 0x00, 0x00, 0x00,
166 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x16, 0x15, 0x14, 0x14, 0x14, 0x14, 0x08
167 },
168 {// 'kaki2', 32x32px
169 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
170 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x02, 0x04, 0x04, 0x03, 0x80, 0x40, 0x40, 0x20, 0x00, 0x01, 0x02, 0x8c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
171 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0d, 0x8d, 0x55, 0x50, 0x94, 0xf0, 0x10, 0x0a, 0x0e, 0x1d, 0x95, 0x24, 0x24, 0x27, 0x13, 0xe1, 0x01, 0x01, 0x01, 0x01, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00,
172 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x14, 0x14, 0x10, 0x10, 0x11, 0x1f, 0x10, 0x10, 0x18, 0x0f, 0x18, 0x10, 0x10, 0x1f, 0x19, 0x18, 0x1c, 0x14, 0x14, 0x17, 0x14, 0x14, 0x14, 0x14, 0x08,
173 }};
174 static const char PROGMEM rtogi[KAKI_FRAMES][ANIM_SIZE] = {{
175 // 'rtogi1', 32x32px
176 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0f, 0x90, 0x10, 0x20, 0xf0, 0xf8, 0xf8,
177 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0xc7, 0xc4, 0x62, 0x23, 0x11, 0x3f,
178 0x80, 0x40, 0x20, 0x10, 0x88, 0xcc, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
179 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
180 },
181 {// 'rtogi2', 32x32px
182 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f, 0xa0, 0x20, 0x40, 0x80, 0x00, 0xf0,
183 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x48, 0x47, 0x88, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x28, 0x6b, 0x40, 0xa0, 0x99, 0x86, 0xff,
184 0x0f, 0x11, 0x22, 0x44, 0x48, 0x4c, 0x43, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x80, 0x80, 0xc0, 0xe1, 0xfe, 0xb8, 0x88, 0x0c, 0x04, 0x06, 0x06, 0x06, 0x0e, 0x0e, 0x06, 0x01,
185 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x07, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
186 }};
187
188 // assumes 1 frame prep stage
189 extern bool swap_hands;
190 void animation_phase(void) {
191 if (swap_hands) {
192 anim_frame_duration = 300;
193 current_rtogi_frame = (current_rtogi_frame + 1) % RTOGI_FRAMES;
194 oled_write_raw_P(rtogi[abs((RTOGI_FRAMES - 1) - current_rtogi_frame)], ANIM_SIZE);
195 } else {
196 if (get_current_wpm() <= SLEEP_SPEED) {
197 anim_frame_duration = 500;
198 current_sleep_frame = (current_sleep_frame + 1) % SLEEP_FRAMES;
199 oled_write_raw_P(sleep[abs((SLEEP_FRAMES - 1) - current_sleep_frame)], ANIM_SIZE);
200 }
201 // if(get_current_wpm() >IDLE_SPEED && get_current_wpm() <TAP_SPEED){
202 if (get_current_wpm() > SLEEP_SPEED) {
203 anim_frame_duration = 800;
204 current_wake_frame = (current_wake_frame + 1) % WAKE_FRAMES;
205 oled_write_raw_P(wake[abs((WAKE_FRAMES - 1) - current_wake_frame)], ANIM_SIZE);
206 // oled_write_raw_P(wake[0], ANIM_SIZE); // remove if IDLE_FRAMES >1
207 }
208 if (get_current_wpm() >= KAKI_SPEED) {
209 anim_frame_duration = 500;
210 current_kaki_frame = (current_kaki_frame + 1) % KAKI_FRAMES;
211 oled_write_raw_P(kaki[abs((KAKI_FRAMES - 1) - current_kaki_frame)], ANIM_SIZE);
212 }
213 }
214 }
215 if (get_current_wpm() != 000) {
216 // if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
217 if (timer_elapsed32(anim_timer) > anim_frame_duration) {
218 anim_timer = timer_read32();
219 animation_phase();
220 }
221 } else {
222 // if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
223 if (timer_elapsed32(anim_timer) > anim_frame_duration) {
224 anim_timer = timer_read32();
225 animation_phase();
226 }
227 }
228}
229
230void oled_driver_render_logo_right(void) {
231 render_kitty();
232
233 oled_set_cursor(0, 4);
234 render_default_layer_state();
235}
236# endif
100#endif 237#endif
101 238
102#ifdef TAPPING_TERM_PER_KEY 239#ifdef TAPPING_TERM_PER_KEY
@@ -111,10 +248,6 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
111#endif 248#endif
112 249
113#ifdef RGB_MATRIX_ENABLE 250#ifdef RGB_MATRIX_ENABLE
114void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); }
115
116void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); }
117
118void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t led_max) { 251void check_default_layer(uint8_t mode, uint8_t type, uint8_t led_min, uint8_t led_max) {
119 switch (get_highest_layer(default_layer_state)) { 252 switch (get_highest_layer(default_layer_state)) {
120 case _QWERTY: 253 case _QWERTY:
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 3423e379a..871136c13 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -73,11 +73,6 @@ void matrix_init_user(void) {
73 73
74 matrix_init_secret(); 74 matrix_init_secret();
75 matrix_init_keymap(); 75 matrix_init_keymap();
76#if defined(AUDIO_ENABLE) && defined(SPLIT_KEYBOARD)
77 if (!is_keyboard_master()) {
78 stop_all_notes();
79 }
80#endif
81} 76}
82 77
83__attribute__((weak)) void keyboard_post_init_keymap(void) {} 78__attribute__((weak)) void keyboard_post_init_keymap(void) {}
@@ -227,16 +222,15 @@ bool hasAllBitsInMask(uint8_t value, uint8_t mask) {
227} 222}
228 223
229#ifdef SPLIT_KEYBOARD 224#ifdef SPLIT_KEYBOARD
230# if defined(AUDIO_ENABLE)
231bool delayed_tasks_run = false;
232# endif
233__attribute__((weak)) void matrix_slave_scan_keymap(void) {} 225__attribute__((weak)) void matrix_slave_scan_keymap(void) {}
234void matrix_slave_scan_user(void) { 226void matrix_slave_scan_user(void) {
235# if defined(AUDIO_ENABLE) 227# if defined(AUDIO_ENABLE)
236# if !defined(NO_MUSIC_MODE) 228# if !defined(NO_MUSIC_MODE)
237 music_task(); 229 music_task();
238# endif 230# endif
231# ifdef AUDIO_INIT_DELAY
239 if (!is_keyboard_master()) { 232 if (!is_keyboard_master()) {
233 static bool delayed_tasks_run = false;
240 static uint16_t delayed_task_timer = 0; 234 static uint16_t delayed_task_timer = 0;
241 if (!delayed_tasks_run) { 235 if (!delayed_tasks_run) {
242 if (!delayed_task_timer) { 236 if (!delayed_task_timer) {
@@ -247,6 +241,7 @@ void matrix_slave_scan_user(void) {
247 } 241 }
248 } 242 }
249 } 243 }
244# endif
250# endif 245# endif
251# ifdef SEQUENCER_ENABLE 246# ifdef SEQUENCER_ENABLE
252 sequencer_task(); 247 sequencer_task();
diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c
index 0bdd0212b..7811cabc6 100644
--- a/users/drashna/oled_stuff.c
+++ b/users/drashna/oled_stuff.c
@@ -62,6 +62,9 @@ void add_keylog(uint16_t keycode, keyrecord_t *record) {
62 return; 62 return;
63 } 63 }
64 } 64 }
65 if (keycode > 0xFF) {
66 return;
67 }
65 68
66 for (uint8_t i = 1; i < KEYLOGGER_LENGTH; i++) { 69 for (uint8_t i = 1; i < KEYLOGGER_LENGTH; i++) {
67 keylog_str[i - 1] = keylog_str[i]; 70 keylog_str[i - 1] = keylog_str[i];
@@ -250,6 +253,17 @@ extern bool tap_toggling;
250#endif 253#endif
251 254
252void render_user_status(void) { 255void render_user_status(void) {
256#ifdef AUDIO_ENABLE
257 bool is_audio_on = false, is_clicky_on = false;
258# ifdef SPLIT_KEYBOARD
259
260 is_audio_on = user_state.audio_enable;
261 is_clicky_on = user_state.audio_clicky_enable;
262# else
263 is_audio_on = is_audio_on();
264 is_clicky_on = is_clicky_on();
265# endif
266#endif
253 oled_write_P(PSTR(OLED_RENDER_USER_NAME), false); 267 oled_write_P(PSTR(OLED_RENDER_USER_NAME), false);
254#if !defined(OLED_DISPLAY_128X64) 268#if !defined(OLED_DISPLAY_128X64)
255 oled_write_P(PSTR(" "), false); 269 oled_write_P(PSTR(" "), false);
@@ -265,11 +279,11 @@ void render_user_status(void) {
265#endif 279#endif
266#ifdef AUDIO_ENABLE 280#ifdef AUDIO_ENABLE
267 static const char PROGMEM audio_status[2][3] = {{0xE0, 0xE1, 0}, {0xE2, 0xE3, 0}}; 281 static const char PROGMEM audio_status[2][3] = {{0xE0, 0xE1, 0}, {0xE2, 0xE3, 0}};
268 oled_write_P(audio_status[is_audio_on()], false); 282 oled_write_P(audio_status[is_audio_on], false);
269 283
270# ifdef AUDIO_CLICKY 284# ifdef AUDIO_CLICKY
271 static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}}; 285 static const char PROGMEM audio_clicky_status[2][3] = {{0xF4, 0xF5, 0}, {0xF6, 0xF7, 0}};
272 oled_write_P(audio_clicky_status[is_clicky_on() && is_audio_on()], false); 286 oled_write_P(audio_clicky_status[is_clicky_on && is_audio_on], false);
273# if !defined(OLED_DISPLAY_128X64) 287# if !defined(OLED_DISPLAY_128X64)
274 oled_write_P(PSTR(" "), false); 288 oled_write_P(PSTR(" "), false);
275# endif 289# endif
@@ -370,7 +384,7 @@ void render_status_secondary(void) {
370 /* Show Keyboard Layout */ 384 /* Show Keyboard Layout */
371 render_layer_state(); 385 render_layer_state();
372 render_mod_status(get_mods() | get_oneshot_mods()); 386 render_mod_status(get_mods() | get_oneshot_mods());
373#if !defined(OLED_DISPLAY_128X64) && defined(WPM_ENABLE) 387#if !defined(OLED_DISPLAY_128X64) && defined(WPM_ENABLE) && !defined(CONVERT_TO_PROTON_C)
374 render_wpm(2); 388 render_wpm(2);
375#endif 389#endif
376 // render_keylock_status(host_keyboard_leds()); 390 // render_keylock_status(host_keyboard_leds());
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index dbacae1d5..e9911979c 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -1,5 +1,5 @@
1SRC += drashna.c \ 1SRC += $(USER_PATH)/drashna.c \
2 process_records.c 2 $(USER_PATH)/process_records.c
3 3
4ifneq ($(PLATFORM),CHIBIOS) 4ifneq ($(PLATFORM),CHIBIOS)
5 ifneq ($(strip $(LTO_SUPPORTED)), no) 5 ifneq ($(strip $(LTO_SUPPORTED)), no)
@@ -11,7 +11,7 @@ GRAVE_ESC_ENABLE = no
11 11
12ifneq ($(strip $(NO_SECRETS)), yes) 12ifneq ($(strip $(NO_SECRETS)), yes)
13 ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") 13 ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
14 SRC += secrets.c 14 SRC += $(USER_PATH)/secrets.c
15 endif 15 endif
16 ifeq ($(strip $(NO_SECRETS)), lite) 16 ifeq ($(strip $(NO_SECRETS)), lite)
17 OPT_DEFS += -DNO_SECRETS 17 OPT_DEFS += -DNO_SECRETS
@@ -21,14 +21,14 @@ endif
21CUSTOM_TAP_DANCE ?= yes 21CUSTOM_TAP_DANCE ?= yes
22ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 22ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
23 ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 23 ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
24 SRC += tap_dances.c 24 SRC += $(USER_PATH)/tap_dances.c
25 endif 25 endif
26endif 26endif
27 27
28CUSTOM_RGBLIGHT ?= yes 28CUSTOM_RGBLIGHT ?= yes
29ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) 29ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
30 ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes) 30 ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes)
31 SRC += rgb_stuff.c 31 SRC += $(USER_PATH)/rgb_stuff.c
32 ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes) 32 ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes)
33 OPT_DEFS += -DRGBLIGHT_NOEEPROM 33 OPT_DEFS += -DRGBLIGHT_NOEEPROM
34 endif 34 endif
@@ -41,7 +41,7 @@ endif
41CUSTOM_RGB_MATRIX ?= yes 41CUSTOM_RGB_MATRIX ?= yes
42ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) 42ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
43 ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes) 43 ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes)
44 SRC += rgb_matrix_stuff.c 44 SRC += $(USER_PATH)/rgb_matrix_stuff.c
45 endif 45 endif
46endif 46endif
47 47
@@ -66,7 +66,7 @@ endif
66CUSTOM_OLED_DRIVER ?= yes 66CUSTOM_OLED_DRIVER ?= yes
67ifeq ($(strip $(OLED_ENABLE)), yes) 67ifeq ($(strip $(OLED_ENABLE)), yes)
68 ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes) 68 ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes)
69 SRC += oled_stuff.c 69 SRC += $(USER_PATH)/oled_stuff.c
70 OPT_DEFS += -DCUSTOM_OLED_DRIVER_CODE 70 OPT_DEFS += -DCUSTOM_OLED_DRIVER_CODE
71 endif 71 endif
72endif 72endif
@@ -81,7 +81,7 @@ endif
81CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes 81CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes
82ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes) 82ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes)
83 ifeq ($(strip $(SPLIT_KEYBOARD)), yes) 83 ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
84 QUANTUM_LIB_SRC += transport_sync.c 84 QUANTUM_LIB_SRC += $(USER_PATH)/transport_sync.c
85 OPT_DEFS += -DCUSTOM_SPLIT_TRANSPORT_SYNC 85 OPT_DEFS += -DCUSTOM_SPLIT_TRANSPORT_SYNC
86 endif 86 endif
87endif 87endif
diff --git a/users/drashna/transport_sync.c b/users/drashna/transport_sync.c
index fdd596c04..39db64135 100644
--- a/users/drashna/transport_sync.c
+++ b/users/drashna/transport_sync.c
@@ -23,7 +23,8 @@ extern unicode_config_t unicode_config;
23#endif 23#endif
24#ifdef AUDIO_ENABLE 24#ifdef AUDIO_ENABLE
25# include "audio.h" 25# include "audio.h"
26extern bool delayed_tasks_run; 26extern audio_config_t audio_config;
27extern bool delayed_tasks_run;
27#endif 28#endif
28#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) 29#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
29extern bool tap_toggling; 30extern bool tap_toggling;
@@ -33,14 +34,6 @@ extern bool swap_hands;
33#endif 34#endif
34extern userspace_config_t userspace_config; 35extern userspace_config_t userspace_config;
35 36
36__attribute__((aligned(8))) typedef struct {
37 bool audio_enable;
38 bool audio_clicky_enable;
39 bool tap_toggling;
40 bool unicode_mode;
41 bool swap_hands;
42} user_runtime_config_t;
43
44uint16_t transport_keymap_config = 0; 37uint16_t transport_keymap_config = 0;
45uint32_t transport_userspace_config = 0; 38uint32_t transport_userspace_config = 0;
46 39
@@ -80,34 +73,18 @@ void user_transport_update(void) {
80#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) 73#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
81 user_state.tap_toggling = tap_toggling; 74 user_state.tap_toggling = tap_toggling;
82#endif 75#endif
76#ifdef UNICODE_ENABLE
77 user_state.unicode_mode = unicode_config.input_mode;
78#endif
83#ifdef SWAP_HANDS_ENABLE 79#ifdef SWAP_HANDS_ENABLE
84 user_state.swap_hands = swap_hands; 80 user_state.swap_hands = swap_hands;
85#endif 81#endif
86
87 } else { 82 } else {
88 keymap_config.raw = transport_keymap_config; 83 keymap_config.raw = transport_keymap_config;
89 userspace_config.raw = transport_userspace_config; 84 userspace_config.raw = transport_userspace_config;
90#ifdef UNICODE_ENABLE 85#ifdef UNICODE_ENABLE
91 unicode_config.input_mode = user_state.unicode_mode; 86 unicode_config.input_mode = user_state.unicode_mode;
92#endif 87#endif
93#ifdef AUDIO_ENABLE
94 if (delayed_tasks_run) {
95 if (user_state.audio_enable != is_audio_on()) {
96 if (user_state.audio_enable) {
97 audio_on();
98 } else {
99 audio_off();
100 }
101 }
102 if (user_state.audio_clicky_enable != is_clicky_on()) {
103 if (user_state.audio_clicky_enable) {
104 clicky_on();
105 } else {
106 clicky_off();
107 }
108 }
109 }
110#endif
111#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform) 88#if defined(POINTING_DEVICE_ENABLE) && defined(KEYBOARD_handwired_tractyl_manuform)
112 tap_toggling = user_state.tap_toggling; 89 tap_toggling = user_state.tap_toggling;
113#endif 90#endif
diff --git a/users/drashna/transport_sync.h b/users/drashna/transport_sync.h
index e2b3eae76..062df2bac 100644
--- a/users/drashna/transport_sync.h
+++ b/users/drashna/transport_sync.h
@@ -19,4 +19,14 @@
19 19
20#include "drashna.h" 20#include "drashna.h"
21 21
22__attribute__((aligned(8))) typedef struct {
23 bool audio_enable;
24 bool audio_clicky_enable;
25 bool tap_toggling;
26 bool unicode_mode;
27 bool swap_hands;
28} user_runtime_config_t;
29
30extern user_runtime_config_t user_state;
31
22void keyboard_post_init_transport_sync(void); 32void keyboard_post_init_transport_sync(void);