Skip to content

Commit

Permalink
Handle an array of indexes for Layer Indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
plodah committed Oct 31, 2024
1 parent 196a0c1 commit a70fe76
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions users/plodah/functions/indicators.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ bool plodah_indicator_handler(void) {
}
#endif // CAPS_LOCK_LED_INDEX

#ifdef PLODAH_LAYER_INDIC_INDEX1
#if defined(PLODAH_LAYER_INDIC_INDEX1) || defined(PLODAH_LAYER_INDIC_INDEXES)

#if defined(PLODAH_LAYER_INDIC_INDEXES)
uint8_t layer_ind[] = PLODAH_LAYER_INDIC_INDEXES;
#endif // PLODAH_LAYER_INDIC_INDEXES

HSV layrhsv = { PLODAH_LAYER_INDIC_HSV };
layrhsv = plodah_rgblimit(rgb_matrix_get_hsv(), layrhsv, PLODAH_INDICATOR_MINVAL);
RGB layrrgb = hsv_to_rgb(layrhsv);
Expand All @@ -52,7 +57,11 @@ bool plodah_indicator_handler(void) {

int highlayer = get_highest_layer(layer_state);
for (int lindex = 0; lindex < DYNAMIC_KEYMAP_LAYER_COUNT; lindex++) {
int thisindex = (lindex + PLODAH_LAYER_INDIC_INDEX1);
#if defined(PLODAH_LAYER_INDIC_INDEXES)
int thisindex = layer_ind[lindex];
#else
int thisindex = (lindex + PLODAH_LAYER_INDIC_INDEX1);
#endif // PLODAH_LAYER_INDIC_INDEXES
if (!rgb_matrix_get_flags()) {
rgb_matrix_set_color(thisindex, RGB_OFF);
}
Expand Down

0 comments on commit a70fe76

Please sign in to comment.