Merge pull request #1974 from qmk/f/ez_shine_layer_leds
Shine layer indication
This commit is contained in:
		@@ -87,6 +87,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define USB_MAX_POWER_CONSUMPTION 500
 | 
					#define USB_MAX_POWER_CONSUMPTION 500
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF
 | 
				
			||||||
 | 
					#define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF
 | 
				
			||||||
 | 
					#define RGBLIGHT_COLOR_LAYER_2 0xFF, 0x00, 0x00
 | 
				
			||||||
 | 
					#define RGBLIGHT_COLOR_LAYER_3 0x00, 0xFF, 0x00
 | 
				
			||||||
 | 
					#define RGBLIGHT_COLOR_LAYER_4 0xFF, 0xFF, 0x00
 | 
				
			||||||
 | 
					#define RGBLIGHT_COLOR_LAYER_5 0x00, 0xFF, 0xFF
 | 
				
			||||||
 | 
					#define RGBLIGHT_COLOR_LAYER_6 0xFF, 0x00, 0xFF
 | 
				
			||||||
 | 
					#define RGBLIGHT_COLOR_LAYER_7 0xFF, 0xFF, 0xFF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Feature disable options
 | 
					 * Feature disable options
 | 
				
			||||||
 *  These options are also useful to firmware size reduction.
 | 
					 *  These options are also useful to firmware size reduction.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,30 +0,0 @@
 | 
				
			|||||||
/*
 | 
					 | 
				
			||||||
Copyright 2017 Jack Humbert <jack.humbgmail.com>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This program is free software: you can redistribute it and/or modify
 | 
					 | 
				
			||||||
it under the terms of the GNU General Public License as published by
 | 
					 | 
				
			||||||
the Free Software Foundation, either version 2 of the License, or
 | 
					 | 
				
			||||||
(at your option) any later version.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This program is distributed in the hope that it will be useful,
 | 
					 | 
				
			||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					 | 
				
			||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
					 | 
				
			||||||
GNU General Public License for more details.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
You should have received a copy of the GNU General Public License
 | 
					 | 
				
			||||||
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef ERGODOX_EZ_USER_CONFIG_H
 | 
					 | 
				
			||||||
#define ERGODOX_EZ_USRE_CONFIG_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "config_common.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF
 | 
					 | 
				
			||||||
#define RGBLIGHT_COLOR_LAYER_1 0xFF, 0x00, 0x00
 | 
					 | 
				
			||||||
#define RGBLIGHT_COLOR_LAYER_2 0x00, 0xFF, 0x00
 | 
					 | 
				
			||||||
#define RGBLIGHT_COLOR_LAYER_3 0xFF, 0xFF, 0x00
 | 
					 | 
				
			||||||
#define RGBLIGHT_COLOR_LAYER_4 0x00, 0xFF, 0xFF
 | 
					 | 
				
			||||||
#define RGBLIGHT_COLOR_LAYER_5 0xFF, 0x00, 0xFF
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@@ -211,39 +211,63 @@ uint32_t layer_state_set_user(uint32_t state) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  uint8_t layer = biton32(state);
 | 
					  uint8_t layer = biton32(state);
 | 
				
			||||||
  switch (layer) {
 | 
					  switch (layer) {
 | 
				
			||||||
    case 0:
 | 
					      case 0:
 | 
				
			||||||
      #ifdef RGBLIGHT_COLOR_LAYER_0
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_0
 | 
				
			||||||
        rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
 | 
				
			||||||
      #endif
 | 
					        #else
 | 
				
			||||||
      break;
 | 
					          rgblight_init();
 | 
				
			||||||
    case 1:
 | 
					        #endif
 | 
				
			||||||
      ergodox_right_led_1_on();
 | 
					        break;
 | 
				
			||||||
      #ifdef RGBLIGHT_COLOR_LAYER_1
 | 
					      case 1:
 | 
				
			||||||
        rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
 | 
					        ergodox_right_led_1_on();
 | 
				
			||||||
      #endif
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_1
 | 
				
			||||||
      break;
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
 | 
				
			||||||
    case 2:
 | 
					        #endif
 | 
				
			||||||
      ergodox_right_led_2_on();
 | 
					        break;
 | 
				
			||||||
      #ifdef RGBLIGHT_COLOR_LAYER_2
 | 
					      case 2:
 | 
				
			||||||
        rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
 | 
					        ergodox_right_led_2_on();
 | 
				
			||||||
      #endif
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_2
 | 
				
			||||||
      break;
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
 | 
				
			||||||
    case 3:
 | 
					        #endif
 | 
				
			||||||
      #ifdef RGBLIGHT_COLOR_LAYER_3
 | 
					        break;
 | 
				
			||||||
        rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
 | 
					      case 3:
 | 
				
			||||||
      #endif
 | 
					        ergodox_right_led_3_on();
 | 
				
			||||||
      break;
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_3
 | 
				
			||||||
    case 4:
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
 | 
				
			||||||
      #ifdef RGBLIGHT_COLOR_LAYER_4
 | 
					        #endif
 | 
				
			||||||
        rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
 | 
					        break;
 | 
				
			||||||
      #endif
 | 
					      case 4:
 | 
				
			||||||
      break;
 | 
					        ergodox_right_led_1_on();
 | 
				
			||||||
    case 5:
 | 
					        ergodox_right_led_2_on();
 | 
				
			||||||
      #ifdef RGBLIGHT_COLOR_LAYER_5
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_4
 | 
				
			||||||
        rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
 | 
				
			||||||
      #endif
 | 
					        #endif
 | 
				
			||||||
      break;
 | 
					        break;
 | 
				
			||||||
  }
 | 
					      case 5:
 | 
				
			||||||
 | 
					        ergodox_right_led_1_on();
 | 
				
			||||||
 | 
					        ergodox_right_led_3_on();
 | 
				
			||||||
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_5
 | 
				
			||||||
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
 | 
				
			||||||
 | 
					        #endif
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      case 6:
 | 
				
			||||||
 | 
					        ergodox_right_led_2_on();
 | 
				
			||||||
 | 
					        ergodox_right_led_3_on();
 | 
				
			||||||
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_6
 | 
				
			||||||
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
 | 
				
			||||||
 | 
					        #endif
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      case 7:
 | 
				
			||||||
 | 
					        ergodox_right_led_1_on();
 | 
				
			||||||
 | 
					        ergodox_right_led_2_on();
 | 
				
			||||||
 | 
					        ergodox_right_led_3_on();
 | 
				
			||||||
 | 
					        #ifdef RGBLIGHT_COLOR_LAYER_7
 | 
				
			||||||
 | 
					          rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
 | 
				
			||||||
 | 
					        #endif
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      default:
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return state;
 | 
					  return state;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user