diff options
Diffstat (limited to 'keyboards/adpenrose/kintsugi/kintsugi.c')
-rw-r--r-- | keyboards/adpenrose/kintsugi/kintsugi.c | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/keyboards/adpenrose/kintsugi/kintsugi.c b/keyboards/adpenrose/kintsugi/kintsugi.c index c697793172..ff62858377 100644 --- a/keyboards/adpenrose/kintsugi/kintsugi.c +++ b/keyboards/adpenrose/kintsugi/kintsugi.c @@ -21,39 +21,36 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; - } + } else { /* The switch case allows for different encoder mappings on different layers, "default" map gets applied for all unspecified layers */ - switch(get_highest_layer(layer_state)){ - case 1: - if (clockwise) { - tap_code(KC_MNXT); - } else { - tap_code(KC_MPRV); - } - break; - default: - if (clockwise){ - tap_code(KC_VOLU); - } else{ - tap_code(KC_VOLD); - } - break; + switch(get_highest_layer(layer_state)){ + case 1: + if (clockwise) { + tap_code(KC_MNXT); + } else { + tap_code(KC_MPRV); + } + break; + default: + if (clockwise){ + tap_code(KC_VOLU); + } else{ + tap_code(KC_VOLD); + } + break; } + } return true; } #endif -/* Rotation of the OLED: */ #ifdef OLED_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_270; } -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } - /* Kintsugi logo render: */ +static void render_logo(void) { +/* Kintsugi logo render: */ static const char PROGMEM logo_1[] = { 0x83, 0x84, 0x85, 0x86, 0x87, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0x00 }; @@ -63,12 +60,22 @@ bool oled_task_kb(void) { static const char PROGMEM logo_3[] = { 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0x00 }; - oled_set_cursor(1,3); + oled_set_cursor(0,3); oled_write_P(logo_1, false); - oled_set_cursor(1,7); + oled_set_cursor(0,7); oled_write_P(logo_2, false); - oled_set_cursor(1,11); + oled_set_cursor(0,11); oled_write_P(logo_3, false); +} + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + else { + render_logo(); + } + return true; } #endif |