aboutsummaryrefslogtreecommitdiff
path: root/users/drashna/drashna.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/drashna.c')
-rw-r--r--users/drashna/drashna.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index ec6484621..95c9d2f62 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -49,21 +49,6 @@ bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this
49 return false; 49 return false;
50} 50}
51 51
52void bootmagic_lite(void) {
53 matrix_scan();
54#if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0
55 wait_ms(DEBOUNCING_DELAY * 2);
56#elif defined(DEBOUNCE) && DEBOUNCE > 0
57 wait_ms(DEBOUNCE * 2);
58#else
59 wait_ms(30);
60#endif
61 matrix_scan();
62 if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
63 bootloader_jump();
64 }
65}
66
67__attribute__((weak)) void keyboard_pre_init_keymap(void) {} 52__attribute__((weak)) void keyboard_pre_init_keymap(void) {}
68 53
69void keyboard_pre_init_user(void) { 54void keyboard_pre_init_user(void) {
@@ -75,6 +60,7 @@ void keyboard_pre_init_user(void) {
75// customization of the keymap. Use _keymap instead of _user 60// customization of the keymap. Use _keymap instead of _user
76// functions in the keymaps 61// functions in the keymaps
77__attribute__((weak)) void matrix_init_keymap(void) {} 62__attribute__((weak)) void matrix_init_keymap(void) {}
63__attribute__((weak)) void matrix_init_secret(void) {}
78 64
79// Call user matrix init, set default RGB colors and then 65// Call user matrix init, set default RGB colors and then
80// call the keymap's init function 66// call the keymap's init function
@@ -86,6 +72,8 @@ void matrix_init_user(void) {
86 DDRB &= ~(1 << 0); 72 DDRB &= ~(1 << 0);
87 PORTB &= ~(1 << 0); 73 PORTB &= ~(1 << 0);
88#endif 74#endif
75
76 matrix_init_secret();
89 matrix_init_keymap(); 77 matrix_init_keymap();
90} 78}
91 79
@@ -103,7 +91,9 @@ void keyboard_post_init_user(void) {
103 91
104__attribute__((weak)) void shutdown_keymap(void) {} 92__attribute__((weak)) void shutdown_keymap(void) {}
105 93
94#ifdef RGB_MATRIX_ENABLE
106void rgb_matrix_update_pwm_buffers(void); 95void rgb_matrix_update_pwm_buffers(void);
96#endif
107 97
108void shutdown_user(void) { 98void shutdown_user(void) {
109#ifdef RGBLIGHT_ENABLE 99#ifdef RGBLIGHT_ENABLE
@@ -129,6 +119,8 @@ void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); }
129 119
130__attribute__((weak)) void matrix_scan_keymap(void) {} 120__attribute__((weak)) void matrix_scan_keymap(void) {}
131 121
122__attribute__((weak)) void matrix_scan_secret(void) {}
123
132// No global matrix scan code, so just run keymap's matrix 124// No global matrix scan code, so just run keymap's matrix
133// scan function 125// scan function
134void matrix_scan_user(void) { 126void matrix_scan_user(void) {
@@ -149,6 +141,8 @@ void matrix_scan_user(void) {
149 matrix_scan_rgb_matrix(); 141 matrix_scan_rgb_matrix();
150#endif 142#endif
151 143
144 matrix_scan_secret();
145
152 matrix_scan_keymap(); 146 matrix_scan_keymap();
153} 147}
154 148
@@ -157,6 +151,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state)
157// on layer change, no matter where the change was initiated 151// on layer change, no matter where the change was initiated
158// Then runs keymap's layer change check 152// Then runs keymap's layer change check
159layer_state_t layer_state_set_user(layer_state_t state) { 153layer_state_t layer_state_set_user(layer_state_t state) {
154 if (!is_keyboard_master()) { return state; }
155
160 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); 156 state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
161#if defined(RGBLIGHT_ENABLE) 157#if defined(RGBLIGHT_ENABLE)
162 state = layer_state_set_rgb_light(state); 158 state = layer_state_set_rgb_light(state);
@@ -168,6 +164,8 @@ __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t
168 164
169// Runs state check and changes underglow color and animation 165// Runs state check and changes underglow color and animation
170layer_state_t default_layer_state_set_user(layer_state_t state) { 166layer_state_t default_layer_state_set_user(layer_state_t state) {
167 if (!is_keyboard_master()) { return state; }
168
171 state = default_layer_state_set_keymap(state); 169 state = default_layer_state_set_keymap(state);
172#if 0 170#if 0
173# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) 171# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)