summaryrefslogtreecommitdiffstats
path: root/users/drashna/callbacks.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-07-02 19:55:46 -0700
committerGitHub <noreply@github.com>2022-07-02 19:55:46 -0700
commit1c43410e266429c97786c9f9217ab9708bb2754d (patch)
tree1b75461c4ac738bf455d0b6a1e6fe4bd88628f35 /users/drashna/callbacks.c
parenta3119385a41fb7662d46e7e7062cd2a76dfc1870 (diff)
[Keymap] Updates to drashna Keymaps and Userspace (#17543)
Diffstat (limited to 'users/drashna/callbacks.c')
-rw-r--r--users/drashna/callbacks.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/users/drashna/callbacks.c b/users/drashna/callbacks.c
index 0ceb1aebe5..f9a3f598d3 100644
--- a/users/drashna/callbacks.c
+++ b/users/drashna/callbacks.c
@@ -55,11 +55,11 @@ void shutdown_user(void) {
rgblight_enable_noeeprom();
rgblight_mode_noeeprom(1);
rgblight_setrgb_red();
-#endif // RGBLIGHT_ENABLE
+#endif // RGBLIGHT_ENABLE
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_set_color_all(0xFF, 0x00, 0x00);
rgb_matrix_update_pwm_buffers();
-#endif // RGB_MATRIX_ENABLE
+#endif // RGB_MATRIX_ENABLE
#ifdef OLED_ENABLE
oled_off();
#endif
@@ -88,7 +88,7 @@ void suspend_power_down_user(void) {
__attribute__((weak)) void suspend_wakeup_init_keymap(void) {}
void suspend_wakeup_init_user(void) {
#ifdef OLED_ENABLE
- oled_timer_reset();
+ oled_timer_reset();
#endif
suspend_wakeup_init_keymap();
}
@@ -104,9 +104,9 @@ void matrix_scan_user(void) {
startup_user();
}
-#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
+#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
run_diablo_macro_check();
-#endif // TAP_DANCE_ENABLE
+#endif // TAP_DANCE_ENABLE
#ifdef CAPS_WORD_ENABLE
caps_word_task();
#endif
@@ -124,8 +124,10 @@ float doom_song[][2] = SONG(E1M1_DOOM);
// on layer change, no matter where the change was initiated
// Then runs keymap's layer change check
-__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; }
-layer_state_t layer_state_set_user(layer_state_t state) {
+__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) {
+ return state;
+}
+layer_state_t layer_state_set_user(layer_state_t state) {
if (!is_keyboard_master()) {
return state;
}
@@ -136,7 +138,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
#endif
#if defined(CUSTOM_RGBLIGHT)
state = layer_state_set_rgb_light(state);
-#endif // CUSTOM_RGBLIGHT
+#endif // CUSTOM_RGBLIGHT
#if defined(AUDIO_ENABLE) && !defined(__arm__)
static bool is_gamepad_on = false;
if (layer_state_cmp(state, _GAMEPAD) != is_gamepad_on) {
@@ -153,28 +155,31 @@ layer_state_t layer_state_set_user(layer_state_t state) {
}
// Runs state check and changes underglow color and animation
-__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; }
-layer_state_t default_layer_state_set_user(layer_state_t state) {
+__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) {
+ return state;
+}
+layer_state_t default_layer_state_set_user(layer_state_t state) {
if (!is_keyboard_master()) {
return state;
}
state = default_layer_state_set_keymap(state);
-#if 0
-# if defined(CUSTOM_RGBLIGHT) || defined(RGB_MATRIX_ENABLE)
- state = default_layer_state_set_rgb(state);
-# endif
+#if defined(CUSTOM_RGBLIGHT)
+ state = default_layer_state_set_rgb_light(state);
#endif
return state;
}
__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {}
-void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); }
+void led_set_user(uint8_t usb_led) {
+ led_set_keymap(usb_led);
+}
__attribute__((weak)) void eeconfig_init_keymap(void) {}
void eeconfig_init_user(void) {
userspace_config.raw = 0;
userspace_config.rgb_layer_change = true;
+ userspace_config.autocorrection = true;
eeconfig_update_user(userspace_config.raw);
eeconfig_init_keymap();
}
@@ -187,8 +192,8 @@ void matrix_slave_scan_user(void) {
music_task();
# endif
# ifdef AUDIO_INIT_DELAY
- if (!is_keyboard_master()) {
- static bool delayed_tasks_run = false;
+ if (!is_keyboard_master()) {
+ static bool delayed_tasks_run = false;
static uint16_t delayed_task_timer = 0;
if (!delayed_tasks_run) {
if (!delayed_task_timer) {
@@ -214,3 +219,11 @@ void matrix_slave_scan_user(void) {
matrix_slave_scan_keymap();
}
#endif
+
+__attribute__((weak)) void housekeeping_task_keymap(void) {}
+void housekeeping_task_user(void) {
+#if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER)
+ housekeeping_task_transport_sync();
+#endif
+ housekeeping_task_keymap();
+}