summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/drashna/config.h16
-rw-r--r--users/drashna/drashna.c28
-rw-r--r--users/drashna/drashna.h5
-rw-r--r--users/drashna/oled_stuff.c31
-rw-r--r--users/drashna/process_records.c7
-rw-r--r--users/drashna/process_records.h2
-rw-r--r--users/drashna/rgb_matrix_stuff.c6
-rw-r--r--users/drashna/rgb_matrix_stuff.h2
-rw-r--r--users/drashna/rgb_stuff.c6
-rw-r--r--users/drashna/wrappers.h9
10 files changed, 64 insertions, 48 deletions
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 9fc65e5c90..8837ca0a56 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -22,6 +22,10 @@
/* Set Polling rate to 1000Hz */
#define USB_POLLING_INTERVAL_MS 1
+#if defined(SPLIT_KEYBOAD)
+# define SPLIT_MODS_ENABLE
+#endif
+
#ifdef AUDIO_ENABLE
# define AUDIO_CLICKY
@@ -40,9 +44,9 @@
#endif // !AUDIO_ENABLE
#ifdef RGBLIGHT_ENABLE
-# undef RGBLIGHT_ANIMATIONS
+# define RGBLIGHT_SLEEP
# if defined(__AVR__) && !defined(__AVR_AT90USB1286__)
-# define RGBLIGHT_SLEEP
+# undef RGBLIGHT_ANIMATIONS
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
@@ -101,6 +105,14 @@
# endif // AVR
#endif // RGB_MATRIX_ENABLE
+#ifdef OLED_DRIVER_ENABLE
+# ifdef SPLIT_KEYBOARD
+# define OLED_UPDATE_INTERVAL 60
+# else
+# define OLED_UPDATE_INTERVAL 15
+# endif
+#endif
+
#ifndef ONESHOT_TAP_TOGGLE
# define ONESHOT_TAP_TOGGLE 2
#endif // !ONESHOT_TAP_TOGGLE
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index ec6484621d..95c9d2f625 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
return false;
}
-void bootmagic_lite(void) {
- matrix_scan();
-#if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0
- wait_ms(DEBOUNCING_DELAY * 2);
-#elif defined(DEBOUNCE) && DEBOUNCE > 0
- wait_ms(DEBOUNCE * 2);
-#else
- wait_ms(30);
-#endif
- matrix_scan();
- if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
- bootloader_jump();
- }
-}
-
__attribute__((weak)) void keyboard_pre_init_keymap(void) {}
void keyboard_pre_init_user(void) {
@@ -75,6 +60,7 @@ void keyboard_pre_init_user(void) {
// customization of the keymap. Use _keymap instead of _user
// functions in the keymaps
__attribute__((weak)) void matrix_init_keymap(void) {}
+__attribute__((weak)) void matrix_init_secret(void) {}
// Call user matrix init, set default RGB colors and then
// call the keymap's init function
@@ -86,6 +72,8 @@ void matrix_init_user(void) {
DDRB &= ~(1 << 0);
PORTB &= ~(1 << 0);
#endif
+
+ matrix_init_secret();
matrix_init_keymap();
}
@@ -103,7 +91,9 @@ void keyboard_post_init_user(void) {
__attribute__((weak)) void shutdown_keymap(void) {}
+#ifdef RGB_MATRIX_ENABLE
void rgb_matrix_update_pwm_buffers(void);
+#endif
void shutdown_user(void) {
#ifdef RGBLIGHT_ENABLE
@@ -129,6 +119,8 @@ void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); }
__attribute__((weak)) void matrix_scan_keymap(void) {}
+__attribute__((weak)) void matrix_scan_secret(void) {}
+
// No global matrix scan code, so just run keymap's matrix
// scan function
void matrix_scan_user(void) {
@@ -149,6 +141,8 @@ void matrix_scan_user(void) {
matrix_scan_rgb_matrix();
#endif
+ matrix_scan_secret();
+
matrix_scan_keymap();
}
@@ -157,6 +151,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state)
// on layer change, no matter where the change was initiated
// Then runs keymap's layer change check
layer_state_t layer_state_set_user(layer_state_t state) {
+ if (!is_keyboard_master()) { return state; }
+
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#if defined(RGBLIGHT_ENABLE)
state = layer_state_set_rgb_light(state);
@@ -168,6 +164,8 @@ __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t
// Runs state check and changes underglow color and animation
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(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h
index 772005a034..35d11101d6 100644
--- a/users/drashna/drashna.h
+++ b/users/drashna/drashna.h
@@ -17,7 +17,6 @@
#pragma once
#include QMK_KEYBOARD_H
-#include "version.h"
#include "eeprom.h"
#include "wrappers.h"
#include "process_records.h"
@@ -58,13 +57,17 @@ enum userspace_layers {
_ADJUST,
};
+#define _MOUSE _MACROS
+
bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
void matrix_init_keymap(void);
+void matrix_init_secret(void);
void shutdown_keymap(void);
void suspend_power_down_keymap(void);
void suspend_wakeup_init_keymap(void);
void matrix_scan_keymap(void);
+void matrix_scan_secret(void);
layer_state_t layer_state_set_keymap(layer_state_t state);
layer_state_t default_layer_state_set_keymap(layer_state_t state);
void led_set_keymap(uint8_t usb_led);
diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c
index 46288aad2f..30eb068f77 100644
--- a/users/drashna/oled_stuff.c
+++ b/users/drashna/oled_stuff.c
@@ -16,8 +16,6 @@
#include "drashna.h"
-extern uint8_t is_master;
-
#ifndef KEYLOGGER_LENGTH
// # ifdef OLED_DISPLAY_128X64
# define KEYLOGGER_LENGTH ((int)(OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH))
@@ -187,11 +185,11 @@ void render_bootmagic_status(void) {
};
bool is_bootmagic_on;
- #ifdef OLED_DISPLAY_128X64
+#ifdef OLED_DISPLAY_128X64
is_bootmagic_on = !keymap_config.swap_lctl_lgui;
- #else
+#else
is_bootmagic_on = keymap_config.swap_lctl_lgui;
- #endif
+#endif
oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NAME), false);
#ifdef OLED_DISPLAY_128X64
@@ -259,21 +257,20 @@ void render_status_secondary(void) {
#if !defined(SPLIT_TRANSPORT_MIRROR) || defined(OLED_DISPLAY_128X64)
oled_driver_render_logo();
#endif
-#ifdef SPLIT_TRANSPORT_MIRROR
/* Show Keyboard Layout */
render_default_layer_state();
render_layer_state();
render_mod_status(get_mods() | get_oneshot_mods());
render_keylogger_status();
-#endif
}
// clang-format on
void render_status_main(void) {
+ oled_driver_render_logo();
/* Show Keyboard Layout */
render_default_layer_state();
- render_keylock_status(host_keyboard_leds());
+ // render_keylock_status(host_keyboard_leds());
render_bootmagic_status();
render_user_status();
@@ -281,19 +278,15 @@ void render_status_main(void) {
}
void oled_task_user(void) {
- if (timer_elapsed32(oled_timer) > 30000) {
- oled_off();
- return;
- }
-#ifndef SPLIT_KEYBOARD
- else {
- oled_on();
- }
-#endif
-
update_log();
- if (is_master) {
+ if (is_keyboard_master()) {
+ if (timer_elapsed32(oled_timer) > 30000) {
+ oled_off();
+ return;
+ } else {
+ oled_on();
+ }
render_status_main(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
} else {
render_status_secondary();
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c
index 19bdef73f1..14fda92dea 100644
--- a/users/drashna/process_records.c
+++ b/users/drashna/process_records.c
@@ -15,6 +15,7 @@
*/
#include "drashna.h"
+#include "version.h"
uint16_t copy_paste_timer;
@@ -27,11 +28,7 @@ __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// If console is enabled, it will print the matrix position and status of each key pressed
#ifdef KEYLOGGER_ENABLE
-# if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_keebio_iris_rev2)
- xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.row, record->event.key.col, record->event.pressed);
-# else
- xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
-# endif
+ 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);
#endif // KEYLOGGER_ENABLE
#ifdef OLED_DRIVER_ENABLE
process_record_user_oled(keycode, record);
diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h
index d41be962df..e59e2242ef 100644
--- a/users/drashna/process_records.h
+++ b/users/drashna/process_records.h
@@ -17,7 +17,7 @@
#pragma once
#include "drashna.h"
-#if defined(KEYMAP_SAFE_RANGE)
+#if defined(KEYBOARD_handwired_dactyl_manuform_5x6_right_trackball)
# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
#else
# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
diff --git a/users/drashna/rgb_matrix_stuff.c b/users/drashna/rgb_matrix_stuff.c
index 52e2612340..573cc7bc9d 100644
--- a/users/drashna/rgb_matrix_stuff.c
+++ b/users/drashna/rgb_matrix_stuff.c
@@ -26,7 +26,7 @@ static uint32_t hypno_timer;
# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN
#endif
-void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) {
+void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max) {
HSV hsv = {hue, sat, val};
if (hsv.v > rgb_matrix_get_val()) {
hsv.v = rgb_matrix_get_val();
@@ -40,7 +40,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode
RGB rgb = hsv_to_rgb(hsv);
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
- rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
+ RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
}
}
break;
@@ -50,7 +50,7 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode
RGB rgb = hsv_to_rgb(hsv);
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
- rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
+ RGB_MATRIX_INDICATOR_SET_COLOR(i, rgb.r, rgb.g, rgb.b);
}
}
break;
diff --git a/users/drashna/rgb_matrix_stuff.h b/users/drashna/rgb_matrix_stuff.h
index 592f9c9e63..b86f2f6514 100644
--- a/users/drashna/rgb_matrix_stuff.h
+++ b/users/drashna/rgb_matrix_stuff.h
@@ -22,4 +22,4 @@ void keyboard_post_init_rgb_matrix(void);
void matrix_scan_rgb_matrix(void);
void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
-void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type);
+void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type, uint8_t led_min, uint8_t led_max);
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index d98f7cc2f8..b67f707b65 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -178,7 +178,11 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) {
uint8_t mode = layer_state_cmp(state,_MODS) ? RGBLIGHT_MODE_BREATHING : RGBLIGHT_MODE_STATIC_LIGHT;
switch (get_highest_layer(state|default_layer_state)) {
case _MACROS:
- rgblight_set_hsv_and_mode(HSV_ORANGE, userspace_config.is_overwatch ? RGBLIGHT_MODE_SNAKE + 2 : RGBLIGHT_MODE_SNAKE + 3);
+# ifdef RGBLIGHT_EFFECT_TWINKLE
+ rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5);
+# else
+ rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3);
+# endif
break;
case _MEDIA:
rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1);
diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h
index ed4022aaab..d135f44af3 100644
--- a/users/drashna/wrappers.h
+++ b/users/drashna/wrappers.h
@@ -162,6 +162,15 @@ NOTE: These are all the same length. If you do a search/replace
#define _________________WHITE_L3__________________ KC_X, KC_R, KC_F, KC_DOT, KC_Z
+#define _________________HALMAK_L1_________________ KC_W, KC_L, KC_R, KC_B, KC_Z
+#define _________________HALMAK_L2_________________ KC_S, KC_H, KC_N, KC_T, KC_COMM
+#define _________________HALMAK_L3_________________ KC_F, KC_M, KC_V, KC_V, KC_SLASH
+
+#define _________________HALMAK_R1_________________ KC_SCLN, KC_Q, KC_U, KC_D, KC_J
+#define _________________HALMAK_R2_________________ KC_DOT, KC_A, KC_E, KC_O, KC_I
+#define _________________HALMAK_R3_________________ KC_G, KC_P, KC_X, KC_K, KC_Y
+
+
#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5
#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0
#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5