summaryrefslogtreecommitdiff
path: root/users/stanrc85/rgblight_layers.c
blob: 1fbd5414987a947fa710b7b670da96e1c275ed4d (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
#include "stanrc85.h"

static uint8_t middle = 0;
static uint8_t bottom = 0;

layer_state_t layer_state_set_user(layer_state_t state) {
    middle = bottom = 0;
    switch (get_highest_layer(state)) {
    case _FN1_60:
        middle = 1;
        break;
    case _FN2_60:
        bottom = 1;
        break;
    case _DEFAULT:
        middle = 1;
        bottom = 1;
        break;
    default: //  for any other layers, or the default layer
        break;
    }
    return state;
}

bool led_update_user(led_t led_state) {
    writePin(INDICATOR_PIN_0, !led_state.caps_lock);
    writePin(INDICATOR_PIN_1, !middle);
    writePin(INDICATOR_PIN_2, !bottom);
    return false;
}