summaryrefslogtreecommitdiffstats
path: root/keyboards/crkbd/keymaps/kidbrazil/layer.c
blob: fbcebd66ffb1e3f0e037038edede4eb2816466d7 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include QMK_KEYBOARD_H
#include "enums.h"
#include "lufa.h"

// Render Blank Space
void render_space(void) {
    oled_write_ln_P(PSTR("     "), false);
}

// Render separator lines for oled display
void render_separator(void) {
    switch (get_highest_layer(layer_state)){
        case _GAME:
        case _WEAPON:
            oled_write_ln_P(PSTR("===================="), false);
            break;
        default:
            oled_write_ln_P(PSTR("++++++++++++++++++++"), false);
    }
}

// Render current layer state
void render_layer_state(void){
	// If you want to change the display of OLED, you need to change here
    switch (get_highest_layer(layer_state)){
        case _QWERTY:
            oled_write_ln_P(PSTR("| MODE | QWRTY     ]"), false);
            break;
        case _NUM:
            oled_write_ln_P(PSTR("| MODE | NUMBERS   ]"), false);
            break;
        case _SYM:
            oled_write_ln_P(PSTR("| MODE | SYMBOLS   ]"), false);
            break;
        case _GAME:
            oled_write_ln_P(PSTR("|    G  A  M  E    ]"), false);
            break;
        case _WEAPON:
            oled_write_ln_P(PSTR("| W  E  A  P  O  N ]"), false);
            break;
        default:
            oled_write_ln_P(PSTR("| MODE | UNDEF     ]"), false);
    }
}

// Render USB State
void render_usb_state(void) {
    switch (USB_DeviceState) {
      case DEVICE_STATE_Unattached:
			    oled_write_ln_P(PSTR("| USB  | FREE      ]"), false);
          break;
      case DEVICE_STATE_Suspended:
          oled_write_ln_P(PSTR("| USB  | SLEEP     ]"), false);
          break;
      case DEVICE_STATE_Configured:
          oled_write_ln_P(PSTR("| USB  | READY     ]"), false);
          break;
      case DEVICE_STATE_Powered:
          oled_write_ln_P(PSTR("| USB  | PWRD      ]"), false);
          break;
      case DEVICE_STATE_Default:
          oled_write_ln_P(PSTR("| USB  | DFLT      ]"), false);
          break;
      case DEVICE_STATE_Addressed:
          oled_write_ln_P(PSTR("| USB  | ADDRS     ]"), false);
          break;
      default:
          oled_write_ln_P(PSTR("| USB  | INVALID   ]"), false);
    }
}