qmk

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.z3bra.org/qmk.git
Log | Files | Refs | Submodules | LICENSE

layer_rgb.c (644B)


      1 #include "stanrc85.h"
      2 
      3 void matrix_init_user(void) {
      4   rgblight_setrgb(0xFF, 0x00, 0x00);
      5 };
      6 
      7 uint32_t layer_state_set_user(uint32_t state) {
      8   switch (biton32(state)) {
      9     case 0:
     10       rgblight_setrgb (0xFF, 0x00, 0x00);
     11       break;
     12     case 1:
     13       rgblight_setrgb (0x00, 0xFF, 0x00);
     14       break;
     15     case 2:
     16       rgblight_setrgb (0x00, 0x00, 0xFF);
     17       break;
     18     case 3:
     19       rgblight_setrgb (0xFF, 0xFF, 0xFF);
     20       break;
     21     case 4:
     22       rgblight_setrgb (0xFF, 0x00, 0xFF);
     23       break;
     24     default: //  for any other layers, or the default layer
     25       rgblight_setrgb (0xFF, 0x00, 0x00);
     26       break;
     27     }
     28   return state;
     29 }