summaryrefslogtreecommitdiff
path: root/keyboards/prototypist/oceanographer/oceanographer.c
blob: ad9378b75cd3175583d541acab480059b05d124b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2023 Anjheos (@Anjheos)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "quantum.h"

#ifdef OLED_ENABLE 
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
    return OLED_ROTATION_90;  
}

bool oled_task_kb(void) {
    if (!oled_task_user()){
        return false;
    }
    
    oled_write_ln_P(PSTR("LAYER"), false);

    switch (get_highest_layer(layer_state)) {

        case 0:
            oled_write_ln_P(PSTR("L1"), false);
            break;

        case 1:
            oled_write_ln_P(PSTR("L2"), false);
            break;

        case 2:
            oled_write_ln_P(PSTR("L3"), false);
            break;

        case 3:
            oled_write_ln_P(PSTR("L4"), false);
            break;

        default:
            oled_write_ln_P(PSTR(" "), false);

    }

    oled_write_ln_P(PSTR("     "), false);

    oled_write_ln_P(PSTR("LOCK:"), false);
    
    led_t led_state = host_keyboard_led_state();
    
    oled_write_P(led_state.caps_lock ? PSTR ("CAPS ") : PSTR("     "), false);
    oled_write_P(led_state.scroll_lock ? PSTR ("SCROL") : PSTR("     "), false);
    oled_write_ln_P(led_state.num_lock ? PSTR ("NUM ") : PSTR("     "), false);

    return false;
}

#endif