aboutsummaryrefslogtreecommitdiff
path: root/keyboards/splitkb/zima/keymaps/drashna/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/splitkb/zima/keymaps/drashna/keymap.c')
-rw-r--r--keyboards/splitkb/zima/keymaps/drashna/keymap.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/keyboards/splitkb/zima/keymaps/drashna/keymap.c b/keyboards/splitkb/zima/keymaps/drashna/keymap.c
index d9e1f44e2..6e198e3dd 100644
--- a/keyboards/splitkb/zima/keymaps/drashna/keymap.c
+++ b/keyboards/splitkb/zima/keymaps/drashna/keymap.c
@@ -22,6 +22,7 @@
22extern haptic_config_t haptic_config; 22extern haptic_config_t haptic_config;
23#endif 23#endif
24 24
25// clang-format off
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26 [0] = LAYOUT_ortho_4x3( /* Base */ 27 [0] = LAYOUT_ortho_4x3( /* Base */
27 KC_MUTE, TG(1), TG(2), 28 KC_MUTE, TG(1), TG(2),
@@ -43,12 +44,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
43 ) 44 )
44}; 45};
45 46
47#ifdef ENCODER_MAP_ENABLE
48const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
49 [0] = { { KC_DOWN, KC_UP } },
50 [1] = { { KC_VOLD, KC_VOLU } },
51 [2] = { { RGB_MOD, RGB_RMOD} },
52};
53#endif
54// clang-format on
46 55
47static bool is_asleep = false; 56static bool is_asleep = false;
48static uint32_t oled_timer; 57static uint32_t oled_timer;
49 58
50void render_oled_logo(void) { 59void render_oled_logo(void) {
51 // clang-format off 60 // clang-format off
52 static const char PROGMEM qmk_logo[] = { 61 static const char PROGMEM qmk_logo[] = {
53 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, 62 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
54 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, 63 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
@@ -68,9 +77,7 @@ void render_user_status(void) {
68 oled_write_P(nukem_good[0], haptic_config.enable); 77 oled_write_P(nukem_good[0], haptic_config.enable);
69} 78}
70 79
71void keyboard_post_init_user(void) { 80void keyboard_post_init_user(void) { oled_scroll_set_speed(0); }
72 oled_scroll_set_speed(0);
73}
74 81
75void oled_task_user(void) { 82void oled_task_user(void) {
76 if (is_asleep) { 83 if (is_asleep) {
@@ -107,13 +114,9 @@ void oled_task_user(void) {
107 } 114 }
108} 115}
109 116
110void suspend_power_down_user(void) { 117void suspend_power_down_user(void) { is_asleep = true; }
111 is_asleep = true;
112}
113 118
114void suspend_wakeup_init_user(void) { 119void suspend_wakeup_init_user(void) { is_asleep = false; }
115 is_asleep = false;
116}
117 120
118bool process_record_user(uint16_t keycode, keyrecord_t* record) { 121bool process_record_user(uint16_t keycode, keyrecord_t* record) {
119 oled_timer = timer_read32(); 122 oled_timer = timer_read32();
@@ -121,7 +124,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
121 return true; 124 return true;
122} 125}
123 126
124
125bool encoder_update_user(uint8_t index, bool clockwise) { 127bool encoder_update_user(uint8_t index, bool clockwise) {
126 if (clockwise) { 128 if (clockwise) {
127 tap_code16(KC_VOLU); 129 tap_code16(KC_VOLU);