-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_init.c
43 lines (35 loc) · 1.01 KB
/
user_init.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
#pragma once
#include "eeconfig.h"
#include "user_eeprom.h"
#include "user_overrides.h"
#include "user_layers.h"
void user_reload_user_eeprom(void) {
user_config.raw = eeconfig_read_user();
reload_overrides();
if (user_config.hrmod) {
// activate the layer
default_layer_or((layer_state_t)1 << _HRMOD);
} else {
// deactivate the layer
default_layer_or((layer_state_t)1 << _HRMOD);
default_layer_xor((layer_state_t)1 << _HRMOD);
}
if (user_config.spc_tap) {
default_layer_or((layer_state_t)1 << _SPC_TAP);
} else {
default_layer_or((layer_state_t)1 << _SPC_TAP);
default_layer_xor((layer_state_t)1 << _SPC_TAP);
}
if (user_config.ergolft) {
default_layer_or((layer_state_t)1 << _ERGOLFT);
} else {
default_layer_or((layer_state_t)1 << _ERGOLFT);
default_layer_xor((layer_state_t)1 << _ERGOLFT);
}
if (user_config.ergorit) {
default_layer_or((layer_state_t)1 << _ERGORIT);
} else {
default_layer_or((layer_state_t)1 << _ERGORIT);
default_layer_xor((layer_state_t)1 << _ERGORIT);
}
};