Change DRIVER_LED_COUNT
to {LED,RGB}_MATRIX_LED_COUNT
(#18399)
This commit is contained in:
@@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* LED matrix driver */
|
||||
#define LED_DRIVER_ADDR_1 0x74
|
||||
#define LED_DRIVER_COUNT 1
|
||||
#define DRIVER_LED_TOTAL 76
|
||||
#define LED_MATRIX_LED_COUNT 76
|
||||
#define LED_MATRIX_SPLIT { 38, 38 }
|
||||
#define LED_DISABLE_WHEN_USB_SUSPENDED
|
||||
|
||||
|
@@ -174,7 +174,7 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
#endif
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
|
||||
// The numbers in the comments are the led numbers DXX on the PCB
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
|
@@ -170,5 +170,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define DRIVER_COUNT 2
|
||||
# define DRIVER_1_LED_TOTAL 64
|
||||
# define DRIVER_2_LED_TOTAL 55
|
||||
# define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
# define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
#endif
|
||||
|
@@ -160,7 +160,7 @@ void IS31FL3733_init(uint8_t bus, uint8_t addr, uint8_t sync) {
|
||||
}
|
||||
|
||||
void IS31FL3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
||||
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
|
||||
is31_led led = g_is31_leds[index];
|
||||
|
||||
g_pwm_buffer[led.driver][led.r] = red;
|
||||
@@ -171,7 +171,7 @@ void IS31FL3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||
}
|
||||
|
||||
void IS31FL3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) {
|
||||
IS31FL3733_set_color(i, red, green, blue);
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ typedef struct is31_led {
|
||||
uint8_t b;
|
||||
} __attribute__((packed)) is31_led;
|
||||
|
||||
extern const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL];
|
||||
extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT];
|
||||
|
||||
void IS31FL3733_init(uint8_t bus, uint8_t addr, uint8_t sync);
|
||||
bool IS31FL3733_write_register(uint8_t index, uint8_t addr, uint8_t reg, uint8_t data);
|
||||
|
@@ -29,7 +29,7 @@ static void init(void) {
|
||||
i2c_init(&I2CD2, I2C2_SCL_PIN, I2C2_SDA_PIN);
|
||||
IS31FL3733_init(1, DRIVER_ADDR_2, 0);
|
||||
# endif
|
||||
for (int index = 0; index < DRIVER_LED_TOTAL; index++) {
|
||||
for (int index = 0; index < RGB_MATRIX_LED_COUNT; index++) {
|
||||
bool enabled = true;
|
||||
// This only caches it for later
|
||||
IS31FL3733_set_led_control_register(index, enabled, enabled, enabled);
|
||||
|
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "is31fl3733-dual.h"
|
||||
|
||||
|
||||
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||
const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
|
||||
{ 0, B_1, A_1, C_1 },
|
||||
{ 0, B_2, A_2, C_2 },
|
||||
{ 0, B_3, A_3, C_3 },
|
||||
|
@@ -48,5 +48,5 @@
|
||||
# define DRIVER_COUNT 2
|
||||
# define DRIVER_1_LED_TOTAL 64
|
||||
# define DRIVER_2_LED_TOTAL 55
|
||||
# define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
# define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
#endif
|
||||
|
@@ -57,7 +57,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* LED matrix driver */
|
||||
#define LED_DRIVER_ADDR_1 0x74
|
||||
#define LED_DRIVER_COUNT 1
|
||||
#define DRIVER_LED_TOTAL 71
|
||||
#define LED_MATRIX_LED_COUNT 71
|
||||
#define LED_DISABLE_WHEN_USB_SUSPENDED
|
||||
|
||||
/* i2c (for LED matrix) */
|
||||
|
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "whitefox.h"
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||
const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT] = {
|
||||
// The numbers in the comments are the led numbers DXX on the PCB
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
|
Reference in New Issue
Block a user