Made LED map definitions readable with a few macros

master
Mark 2022-06-14 09:40:34 -07:00
parent 651540a38a
commit ff8cea0036
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
10 changed files with 169 additions and 36 deletions

View File

@ -136,6 +136,43 @@ typedef union {
extern keyboard_config_t keyboard_config; extern keyboard_config_t keyboard_config;
// Turns {h, s, v} triples into a macro, so that
// the LEDS_ergodox macro can take them as inputs.
#define LC_HSV(h, s, v) {h, s, v}
// Rearrange a human-readable LED layout into the correct Ergodox order.
// LEDS_ergodox ONLY WORKS WITH MACROS.
// Don't input a standalone triple {h, s, v};
// Use LC_HSV if you need a single-instance color.
#define LEDS_ergodox( \
l01,l02,l03,l04,l05, \
l06,l07,l08,l09,l10, \
l11,l12,l13,l14,l15, \
l16,l17,l18,l19,l20, \
l21,l22,l23,l24, \
\
l25,l26,l27,l28,l29, \
l30,l31,l32,l33,l34, \
l35,l36,l37,l38,l39, \
l40,l41,l42,l43,l44, \
l45,l46,l47,l48 \
) \
{ \
l25,l26,l27,l28,l29, \
l30,l31,l32,l33,l34, \
l35,l36,l37,l38,l39, \
l40,l41,l42,l43,l44, \
l45,l46,l47,l48, \
\
l05,l04,l03,l02,l01, \
l10,l09,l08,l07,l06, \
l15,l14,l13,l12,l11, \
l20,l19,l18,l17,l16, \
l24,l23,l22,l21 \
}
/* /*
LEFT HAND: LINES 115-122 LEFT HAND: LINES 115-122
RIGHT HAND: LINES 124-131 RIGHT HAND: LINES 124-131

View File

@ -74,3 +74,31 @@ void set_lang_long(int lang, bool force);
* | |ace | End | | PgDn | | | * | |ace | End | | PgDn | | |
* `--------------------' `----------------------' * `--------------------' `----------------------'
*/ */
/* LED layout template
#define LAYER_COLEMAK_LEDS LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
*/
// LED colors, in HSV.
#define LC_OFF LC_HSV( 0, 0, 0)
#define LC_GREEN LC_HSV( 85, 203, 158)
#define LC_YELLOW LC_HSV( 32, 176, 255)
#define LC_PINK LC_HSV(243, 222, 234)
#define LC_CYAN LC_HSV(134, 255, 213)
#define LC_ORANGE LC_HSV( 14, 255, 255)
#define LC_RU_B LC_HSV( 0, 0, 165)
#define LC_RU_G LC_HSV(153, 255, 153)
#define LC_RU_K LC_HSV( 0, 255, 145)

View File

@ -24,6 +24,16 @@
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\
) )
#define LAYER_ARROWS_LEDS LEDS_ergodox(\
#define LAYER_ARROWS_LEDS \ LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{ {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {32,176,255}, {32,176,255}, {0,0,0}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0} } LC_YELLOW, LC_YELLOW, LC_GREEN, LC_OFF, LC_OFF, \
LC_OFF, LC_GREEN, LC_GREEN, LC_GREEN, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_PINK, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_GREEN, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_GREEN, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -24,6 +24,16 @@
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\
) )
#define LAYER_COLEMAK_LEDS LEDS_ergodox(\
#define LAYER_COLEMAK_LEDS \ LC_PINK, LC_PINK, LC_PINK, LC_PINK, LC_PINK, \
{ {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} } LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_PINK, LC_PINK, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -24,6 +24,16 @@
KC_AUDIO_VOL_DOWN, KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE\ KC_AUDIO_VOL_DOWN, KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE\
) )
#define LAYER_DESKTOP_LEDS LEDS_ergodox(\
#define LAYER_DESKTOP_LEDS \ LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{ {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {0,0,0}, {14,255,255}, {0,0,0}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {0,0,0}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {134,255,213}, {0,0,0}, {85,203,158}, {0,0,0}, {134,255,213}, {134,255,213}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} } LC_OFF, LC_OFF, LC_OFF, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_CYAN, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_GREEN, LC_OFF, LC_ORANGE, \
LC_OFF, LC_GREEN, LC_GREEN, LC_GREEN, LC_OFF, \
LC_OFF, LC_CYAN, LC_CYAN, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -24,6 +24,16 @@
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT \ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT \
) )
#define LAYER_FKEYS_LEDS LEDS_ergodox(\
#define LAYER_FKEYS_LEDS \ LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
{ {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} } LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -24,6 +24,16 @@
KC_NO, KC_LGUI, KC_TRANSPARENT\ KC_NO, KC_LGUI, KC_TRANSPARENT\
) )
#define LAYER_NAVIGATE_LEDS LEDS_ergodox(\
#define LAYER_NAVIGATE_LEDS \ LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{ {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {243,222,234}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0} } LC_OFF, LC_OFF, LC_PINK, LC_OFF, LC_OFF, \
LC_OFF, LC_PINK, LC_PINK, LC_PINK, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_PINK, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -24,6 +24,16 @@
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\
) )
#define LAYER_NUMPAD_LEDS LEDS_ergodox(\
#define LAYER_NUMPAD_LEDS \ LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{ {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {32,176,255}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {85,203,158}, {85,203,158}, {85,203,158}, {85,203,158}, {32,176,255}, {32,176,255}, {85,203,158}, {85,203,158}, {85,203,158}, {32,176,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} } LC_OFF, LC_GREEN, LC_GREEN, LC_GREEN, LC_YELLOW, \
LC_YELLOW, LC_GREEN, LC_GREEN, LC_GREEN, LC_GREEN, \
LC_YELLOW, LC_GREEN, LC_GREEN, LC_GREEN, LC_YELLOW, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -24,18 +24,16 @@
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\ KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\
) )
#define LAYER_RUSSIAN_LEDS LEDS_ergodox(\
#define LAYER_RUSSIAN_LEDS \ LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{\ LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, \
{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0},\ LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, \
{ 0, 0, 165}, { 0, 0, 165}, { 0, 0, 165}, { 0, 0, 165}, { 0, 0, 165},\ LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, \
{153, 255, 153}, {153, 255, 153}, {153, 255, 153}, {153, 255, 153}, {153, 255, 153},\ LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{ 0, 255, 145}, { 0, 255, 145}, { 0, 255, 145}, { 0, 255, 145}, { 0, 255, 145},\
{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0},\
\ \
{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0},\ LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{ 0, 0, 165}, { 0, 0, 165}, { 0, 0, 165}, { 0, 0, 165}, { 0, 0, 165},\ LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, \
{153, 255, 153}, {153, 255, 153}, {153, 255, 153}, {153, 255, 153}, {153, 255, 153},\ LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, \
{ 0, 255, 145}, { 0, 255, 145}, { 0, 255, 145}, { 0, 255, 145}, { 0, 255, 145},\ LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, \
{ 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0},\ LC_OFF, LC_OFF, LC_OFF, LC_OFF \
} )

View File

@ -24,6 +24,16 @@
KC_NO, KC_NO, KC_TRANSPARENT\ KC_NO, KC_NO, KC_TRANSPARENT\
) )
#define LAYER_SYMBOLS_LEDS LEDS_ergodox(\
#define LAYER_SYMBOLS_LEDS \ LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
{ {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {85,203,158}, {134,255,213}, {0,0,0}, {134,255,213}, {134,255,213}, {85,203,158}, {243,222,234}, {10,225,255}, {134,255,213}, {85,203,158}, {85,203,158}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {10,225,255}, {243,222,234}, {243,222,234}, {243,222,234}, {243,222,234}, {10,225,255}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} } LC_ORANGE, LC_CYAN, LC_CYAN, LC_PINK, LC_CYAN, \
LC_ORANGE, LC_PINK, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_CYAN, LC_CYAN, LC_PINK, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_GREEN, LC_GREEN, LC_CYAN, LC_OFF, LC_CYAN, \
LC_CYAN, LC_GREEN, LC_PINK, LC_ORANGE, LC_CYAN, \
LC_GREEN, LC_GREEN, LC_PINK, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)