2020-04-09 04:56:55 +06:00
|
|
|
#include "stanrc85.h"
|
|
|
|
|
2020-08-17 14:33:57 +06:00
|
|
|
static uint8_t middle = 0;
|
|
|
|
static uint8_t bottom = 0;
|
|
|
|
|
2020-04-09 04:56:55 +06:00
|
|
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
2020-08-17 14:33:57 +06:00
|
|
|
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;
|
|
|
|
}
|
2020-04-09 04:56:55 +06:00
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool led_update_user(led_t led_state) {
|
2020-08-17 14:33:57 +06:00
|
|
|
writePin(INDICATOR_PIN_0, !led_state.caps_lock);
|
|
|
|
writePin(INDICATOR_PIN_1, !middle);
|
|
|
|
writePin(INDICATOR_PIN_2, !bottom);
|
|
|
|
return false;
|
2020-04-09 04:56:55 +06:00
|
|
|
}
|