summaryrefslogtreecommitdiff
path: root/keyboards/splitkb/zima/keymaps
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-08-21 13:34:44 -0700
committerGitHub <noreply@github.com>2021-08-21 13:34:44 -0700
commit58a5030661b57f1dd05693053df2eddadc285f64 (patch)
tree025a7a2d0dc6643ce806b72798c92139eafb4ca6 /keyboards/splitkb/zima/keymaps
parentda1c011afc67dab0049b30a4c021dc38a36cb9aa (diff)
[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
Diffstat (limited to 'keyboards/splitkb/zima/keymaps')
-rw-r--r--keyboards/splitkb/zima/keymaps/drashna/config.h2
-rw-r--r--keyboards/splitkb/zima/keymaps/drashna/keymap.c36
2 files changed, 30 insertions, 8 deletions
diff --git a/keyboards/splitkb/zima/keymaps/drashna/config.h b/keyboards/splitkb/zima/keymaps/drashna/config.h
index 91d657eda1..133ab6a914 100644
--- a/keyboards/splitkb/zima/keymaps/drashna/config.h
+++ b/keyboards/splitkb/zima/keymaps/drashna/config.h
@@ -30,3 +30,5 @@
// # define OLED_LOGO_CORNE
// # define OLED_LOGO_GOTHAM
#define OLED_LOGO_SCIFI
+
+#define ENCODER_RESOLUTION 2
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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
-#include <stdio.h>
#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;
}