From 58a5030661b57f1dd05693053df2eddadc285f64 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 21 Aug 2021 13:34:44 -0700 Subject: [Keymap] Drashna's Improve OLEDs and custom Split code (#14063) * Fill the oleds with right mods * Enable double mods on x32 oleds * Disable forced NKRO * Make oleds fancy only on good MCUs * Overhaul oled display * Further enhance oled, with kitty! * Final oled form * Not working transport * Transport id of woring * Add acceleration * fix button placement for accel macro * Fix accelartion location and behavior * Remove OLED sync code * Fix alignment issue * Remove audio hack * Fix up zima keymap * Add matrix slave scan function and cleanup drashna.h * Clean up user space * Allow userspace sync to be disable-able * Fix weird issue with audio * Fix alignment issue with user split sync * Disable second rgb matrix task * Disable additional animations * Change dynamic keymap settings * Hacky fix for borked corne * Add Blackpill (F411) support to tractyl manuform * remove manual via eeprom reset * Remove all references to rgblight twinkle * Fix issues with config processing --- keyboards/splitkb/zima/keymaps/drashna/keymap.c | 36 +++++++++++++++++++------ 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'keyboards/splitkb/zima/keymaps/drashna/keymap.c') diff --git a/keyboards/splitkb/zima/keymaps/drashna/keymap.c b/keyboards/splitkb/zima/keymaps/drashna/keymap.c index 6e198e3ddd..29d03ec918 100644 --- a/keyboards/splitkb/zima/keymaps/drashna/keymap.c +++ b/keyboards/splitkb/zima/keymaps/drashna/keymap.c @@ -15,7 +15,6 @@ * along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include #ifdef HAPTIC_ENABLE # include "haptic.h" @@ -90,15 +89,35 @@ void oled_task_user(void) { oled_scroll_off(); oled_write_P(PSTR("SplitKB's Zima"), false); char layer[2] = {0}; - snprintf(layer, sizeof(layer), "%d", get_highest_layer(layer_state)); + uint8_t n = get_highest_layer(layer_state); + layer[1] = '\0'; + layer[0] = '0' + n % 10; oled_write_P(PSTR(" L:"), false); oled_write_ln(layer, false); oled_write_ln_P(PSTR("--------------"), false); if (rgblight_is_enabled()) { oled_write_P(PSTR("HSV: "), false); - char rgbs[14]; - snprintf(rgbs, sizeof(rgbs), "%3d, %3d, %3d", rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val()); - oled_write_ln(rgbs, false); + char hsv_char[4]; + n = rgblight_get_hue(); + hsv_char[3] = '\0'; + hsv_char[2] = '0' + n % 10; + hsv_char[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; + hsv_char[0] = n / 10 ? '0' + n / 10 : ' '; + oled_write(hsv_char, false); + oled_write_P(PSTR(", "), false); + n = rgblight_get_sat(); + hsv_char[3] = '\0'; + hsv_char[2] = '0' + n % 10; + hsv_char[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; + hsv_char[0] = n / 10 ? '0' + n / 10 : ' '; + oled_write(hsv_char, false); + oled_write_P(PSTR(", "), false); + n = rgblight_get_val(); + hsv_char[3] = '\0'; + hsv_char[2] = '0' + n % 10; + hsv_char[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' '; + hsv_char[0] = n / 10 ? '0' + n / 10 : ' '; + oled_write_ln(hsv_char, false); } else { oled_write_ln_P(PSTR("RGB LIGHT DISABLED"), false); } @@ -125,10 +144,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { } bool encoder_update_user(uint8_t index, bool clockwise) { + oled_timer = timer_read32(); if (clockwise) { - tap_code16(KC_VOLU); + tap_code_delay(KC_VOLU, 10); } else { - tap_code16(KC_VOLD); + tap_code_delay(KC_VOLD, 10); } - return true; + return false; } -- cgit v1.2.3