forked from 0chroma/CrkbdBongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
brain.c
85 lines (72 loc) · 1.75 KB
/
brain.c
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// ObliviousGmn // Dokuu // October 2020 // Big Brain
#include <stdio.h>
#include "bongo.c"
extern keymap_config_t keymap_config;
// Has RGB?
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
#endif
int RGB_current_mode;
uint16_t oled_timer;
bool key_pressed;
layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
// RGB
void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_config.mode;
#endif
}
// Oled Rotations
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_left()) {
return OLED_ROTATION_270;
}
else {
return OLED_ROTATION_180;
}
}
// Master Oled
void render_status_main(void) {
render_space();
render_layer_state();
render_space();
render_mod_status_gui_alt(get_mods()|get_oneshot_mods());
render_mod_status_ctrl_shift(get_mods()|get_oneshot_mods());
render_space();
render_logo();
render_space();
}
// Slave Oled
void render_status_secondary(void) {
switch (get_highest_layer(layer_state)){
case _GAME:
//render_game_r();
testing_game();
break;
case _WEAPON:
//render_weapon_r();
break;
default:
render_anim();
}
}
// Oled Sleeps
bool oled_task_user(void) {
// Establishing Sides
if (is_keyboard_master()) {
render_status_main();
} else {
render_status_secondary();
}
return false;
}
#endif
// // Keypressed
// bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// if (record->event.pressed) {
// set_keylog(keycode, record);
// return true;
// }