Created
February 22, 2018 09:19
-
-
Save burakcan/077dab8f6df5fda729d11217d8a33805 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static uint8_t old_layer = 255; | |
void matrix_scan_user(void) { | |
#ifdef RGBLIGHT_ENABLE | |
uint8_t new_layer = biton32(layer_state); | |
if (old_layer != new_layer) { | |
switch (new_layer) { | |
case _QWERTY: | |
rgblight_mode(13); | |
break; | |
case _LOWER: | |
rgblight_mode(1); | |
rgblight_setrgb(0x00, 0xA0, 0xFF); | |
break; | |
case _RAISE: | |
rgblight_mode(1); | |
rgblight_setrgb(0xFF, 0x20, 0x00); | |
break; | |
case _ADJUST: | |
rgblight_mode(22); | |
rgblight_sethsv(0, 255, 255); | |
break; | |
} | |
old_layer = new_layer; | |
} | |
#endif //RGBLIGHT_ENABLE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment