summaryrefslogtreecommitdiffstats
path: root/keyboards/splitkb/zima/keymaps/drashna
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/splitkb/zima/keymaps/drashna')
-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;
}