Skip to content

Commit

Permalink
adds indication up to layer 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Erez Zukerman authored and Gareth RSS Pye committed May 1, 2018
1 parent fabfb5e commit b469c0c
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 66 deletions.
9 changes: 9 additions & 0 deletions keyboards/ergodox_ez/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#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
* These options are also useful to firmware size reduction.
Expand Down
30 changes: 0 additions & 30 deletions keyboards/ergodox_ez/keymaps/default/config.h

This file was deleted.

94 changes: 58 additions & 36 deletions keyboards/ergodox_ez/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,41 +211,63 @@ uint32_t layer_state_set_user(uint32_t state) {

uint8_t layer = biton32(state);
switch (layer) {
case 0:
#ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#else
rgblight_init();
#endif
break;
case 1:
ergodox_right_led_1_on();
#ifdef RGBLIGHT_COLOR_LAYER_1
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
#endif
break;
case 2:
ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_2
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
#endif
break;
case 3:
#ifdef RGBLIGHT_COLOR_LAYER_3
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
#endif
break;
case 4:
#ifdef RGBLIGHT_COLOR_LAYER_4
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
#endif
break;
case 5:
#ifdef RGBLIGHT_COLOR_LAYER_5
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
#endif
break;
}
case 0:
#ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#else
rgblight_init();
#endif
break;
case 1:
ergodox_right_led_1_on();
#ifdef RGBLIGHT_COLOR_LAYER_1
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
#endif
break;
case 2:
ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_2
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
#endif
break;
case 3:
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_3
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
#endif
break;
case 4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_4
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
#endif
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;
};
};

0 comments on commit b469c0c

Please sign in to comment.