Esempio n. 1
0
uint32_t layer_state_set_rgb(uint32_t state) {
#ifdef RGBLIGHT_ENABLE
  if (userspace_config.rgb_layer_change) {
    switch (biton32(state)) {
    case _MACROS:
      rgblight_sethsv_noeeprom_orange();
      userspace_config.is_overwatch ? rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 2) : rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 3);
      break;
    case _MEDIA:
      rgblight_sethsv_noeeprom_chartreuse();
      rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1);
      break;
    case _GAMEPAD:
      rgblight_sethsv_noeeprom_orange();
      rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2);
      break;
    case _DIABLO:
      rgblight_sethsv_noeeprom_red();
      rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
      break;
    case _RAISE:
      rgblight_sethsv_noeeprom_yellow();
      rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
      break;
    case _LOWER:
      rgblight_sethsv_noeeprom_green();
      rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
      break;
    case _ADJUST:
      rgblight_sethsv_noeeprom_red();
      rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2);
      break;
    default: //  for any other layers, or the default layer
      switch (biton32(default_layer_state)) {
        case _COLEMAK:
          rgblight_sethsv_noeeprom_magenta(); break;
        case _DVORAK:
          rgblight_sethsv_noeeprom_springgreen(); break;
        case _WORKMAN:
          rgblight_sethsv_noeeprom_goldenrod(); break;
        case _NORMAN:
          rgblight_sethsv_noeeprom_coral(); break;
        case _MALTRON:
          rgblight_sethsv_noeeprom_yellow(); break;
        case _EUCALYN:
          rgblight_sethsv_noeeprom_pink(); break;
        case _CARPLAX:
          rgblight_sethsv_noeeprom_blue(); break;
        default:
          rgblight_sethsv_noeeprom_cyan(); break;
      }
      biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
      break;
    }
//    layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow
  }
#endif // RGBLIGHT_ENABLE

  return state;
}
Esempio n. 2
0
void keyboard_post_init_rgb(void) {

#ifdef RGBLIGHT_ENABLE
  if (userspace_config.rgb_layer_change) {
    rgblight_enable_noeeprom();
    switch (biton32(eeconfig_read_default_layer())) {
      case _COLEMAK:
        rgblight_sethsv_noeeprom_magenta(); break;
      case _DVORAK:
        rgblight_sethsv_noeeprom_springgreen(); break;
      case _WORKMAN:
        rgblight_sethsv_noeeprom_goldenrod(); break;
      default:
        rgblight_sethsv_noeeprom_cyan(); break;
    }
    rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
  }
#endif
}
Esempio n. 3
0
void matrix_init_rgb(void) {
#ifdef INDICATOR_LIGHTS
  current_mod = last_mod = get_mods();
  current_led = last_led = host_keyboard_leds();
  current_osm = last_osm = get_oneshot_mods();
#endif

  if (userspace_config.rgb_layer_change) {
    rgblight_enable_noeeprom();
    switch (biton32(eeconfig_read_default_layer())) {
      case _COLEMAK:
        rgblight_sethsv_noeeprom_magenta(); break;
      case _DVORAK:
        rgblight_sethsv_noeeprom_springgreen(); break;
      case _WORKMAN:
        rgblight_sethsv_noeeprom_goldenrod(); break;
      default:
        rgblight_sethsv_noeeprom_cyan(); break;
    }
    rgblight_mode_noeeprom(1);
  }
}