Skip to content

Commit

Permalink
updated per comments #13457
Browse files Browse the repository at this point in the history
  • Loading branch information
ccullin committed Jul 8, 2021
1 parent 4e53c5b commit 40bfa81
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
35 changes: 34 additions & 1 deletion docs/feature_rgb_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Here is an example using 2 drivers.
```
!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
Currently only two drivers are supported, but it would be trivial to support all 4 combinations.
Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
Expand Down Expand Up @@ -709,6 +709,39 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
}
```
### Indicator Examples :id=indicator-examples
Caps Lock indicator on alphanumeric flagged keys:
```c
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (host_keyboard_led_state().caps_lock) {
for (uint8_t i = led_min; i <= led_max; i++) {
if (g_led_config.flags[i] & LED_FLAG_KEYLIGHT) {
rgb_matrix_set_color(i, RGB_RED);
}
}
}
}
```

Layer indicator on all flagged keys:
```c
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
for (uint8_t i = led_min; i <= led_max; i++) {
switch(get_highest_layer(layer_state|default_layer_state)) {
case RAISE:
rgb_matrix_set_color(i, RGB_BLUE);
break;
case LOWER:
rgb_matrix_set_color(i, RGB_YELLOW);
break;
default:
break;
}
}
}
```
### Suspended state :id=suspended-state
To use the suspend feature, make sure that `#define RGB_DISABLE_WHEN_USB_SUSPENDED true` is added to the `config.h` file.
Expand Down
7 changes: 2 additions & 5 deletions drivers/issi/is31fl3737.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "is31fl3737.h"
#include "i2c_master.h"
#include "wait.h"
#include "progmem.h"


// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
Expand Down Expand Up @@ -67,10 +67,7 @@ uint8_t g_twi_transfer_buffer[20];
// buffers and the transfers in IS31FL3737_write_pwm_buffer() but it's
// probably not worth the extra complexity.




uint8_t g_pwm_buffer[DRIVER_COUNT][(192)];
uint8_t g_pwm_buffer[DRIVER_COUNT][192];
bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false};

uint8_t g_led_control_registers[DRIVER_COUNT][24] = {0};
Expand Down

0 comments on commit 40bfa81

Please sign in to comment.