From d99dbe4d56a5d414b8d131bf703257172af91b70 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 4 Oct 2023 20:12:50 +1100 Subject: Update ISSI LED types (#22099) --- drivers/led/issi/is31fl3731-simple.c | 8 ++++---- drivers/led/issi/is31fl3731-simple.h | 9 ++++++--- drivers/led/issi/is31fl3731.c | 8 ++++---- drivers/led/issi/is31fl3731.h | 9 ++++++--- drivers/led/issi/is31fl3733-simple.c | 8 ++++---- drivers/led/issi/is31fl3733-simple.h | 9 ++++++--- drivers/led/issi/is31fl3733.c | 8 ++++---- drivers/led/issi/is31fl3733.h | 9 ++++++--- drivers/led/issi/is31fl3736-simple.c | 8 ++++---- drivers/led/issi/is31fl3736-simple.h | 9 ++++++--- drivers/led/issi/is31fl3736.c | 8 ++++---- drivers/led/issi/is31fl3736.h | 9 ++++++--- drivers/led/issi/is31fl3737-simple.c | 8 ++++---- drivers/led/issi/is31fl3737-simple.h | 6 +++--- drivers/led/issi/is31fl3737.c | 8 ++++---- drivers/led/issi/is31fl3737.h | 9 ++++++--- drivers/led/issi/is31fl3741-simple.c | 12 ++++++------ drivers/led/issi/is31fl3741-simple.h | 10 +++++----- drivers/led/issi/is31fl3741.c | 12 ++++++------ drivers/led/issi/is31fl3741.h | 13 ++++++++----- 20 files changed, 102 insertions(+), 78 deletions(-) (limited to 'drivers') diff --git a/drivers/led/issi/is31fl3731-simple.c b/drivers/led/issi/is31fl3731-simple.c index 5ea4613845..f9ad703ced 100644 --- a/drivers/led/issi/is31fl3731-simple.c +++ b/drivers/led/issi/is31fl3731-simple.c @@ -160,9 +160,9 @@ void is31fl3731_init(uint8_t addr) { } void is31fl3731_set_value(int index, uint8_t value) { - is31_led led; + is31fl3731_led_t led; if (index >= 0 && index < LED_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); // Subtract 0x24 to get the second index of g_pwm_buffer @@ -181,8 +181,8 @@ void is31fl3731_set_value_all(uint8_t value) { } void is31fl3731_set_led_control_register(uint8_t index, bool value) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3731_led_t led; + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); uint8_t control_register = (led.v - 0x24) / 8; uint8_t bit_value = (led.v - 0x24) % 8; diff --git a/drivers/led/issi/is31fl3731-simple.h b/drivers/led/issi/is31fl3731-simple.h index e6c9ce37c5..940ad413d8 100644 --- a/drivers/led/issi/is31fl3731-simple.h +++ b/drivers/led/issi/is31fl3731-simple.h @@ -35,6 +35,9 @@ #ifdef ISSI_3731_DEGHOST # define IS31FL3731_DEGHOST ISSI_3731_DEGHOST #endif + +#define is31_led is31fl3731_led_t +#define g_is31_leds g_is31fl3731_leds // ======== #define IS31FL3731_I2C_ADDRESS_GND 0x74 @@ -42,12 +45,12 @@ #define IS31FL3731_I2C_ADDRESS_SDA 0x76 #define IS31FL3731_I2C_ADDRESS_VCC 0x77 -typedef struct is31_led { +typedef struct is31fl3731_led_t { uint8_t driver : 2; uint8_t v; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3731_led_t; -extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT]; +extern const is31fl3731_led_t PROGMEM g_is31fl3731_leds[LED_MATRIX_LED_COUNT]; void is31fl3731_init(uint8_t addr); void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3731.c b/drivers/led/issi/is31fl3731.c index d6ee5cdd94..a30e8fcbc2 100644 --- a/drivers/led/issi/is31fl3731.c +++ b/drivers/led/issi/is31fl3731.c @@ -157,9 +157,9 @@ void is31fl3731_init(uint8_t addr) { } void is31fl3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; + is31fl3731_led_t led; if (index >= 0 && index < RGB_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); // Subtract 0x24 to get the second index of g_pwm_buffer if (g_pwm_buffer[led.driver][led.r - 0x24] == red && g_pwm_buffer[led.driver][led.g - 0x24] == green && g_pwm_buffer[led.driver][led.b - 0x24] == blue) { @@ -179,8 +179,8 @@ void is31fl3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { } void is31fl3731_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3731_led_t led; + memcpy_P(&led, (&g_is31fl3731_leds[index]), sizeof(led)); uint8_t control_register_r = (led.r - 0x24) / 8; uint8_t control_register_g = (led.g - 0x24) / 8; diff --git a/drivers/led/issi/is31fl3731.h b/drivers/led/issi/is31fl3731.h index ccd972a03e..1e70eb276f 100644 --- a/drivers/led/issi/is31fl3731.h +++ b/drivers/led/issi/is31fl3731.h @@ -34,6 +34,9 @@ #ifdef ISSI_3731_DEGHOST # define IS31FL3731_DEGHOST ISSI_3731_DEGHOST #endif + +#define is31_led is31fl3731_led_t +#define g_is31_leds g_is31fl3731_leds // ======== #define IS31FL3731_I2C_ADDRESS_GND 0x74 @@ -41,14 +44,14 @@ #define IS31FL3731_I2C_ADDRESS_SDA 0x76 #define IS31FL3731_I2C_ADDRESS_VCC 0x77 -typedef struct is31_led { +typedef struct is31fl3731_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3731_led_t; -extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT]; +extern const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT]; void is31fl3731_init(uint8_t addr); void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3733-simple.c b/drivers/led/issi/is31fl3733-simple.c index 6f7a8af79c..e94b4c7d78 100644 --- a/drivers/led/issi/is31fl3733-simple.c +++ b/drivers/led/issi/is31fl3733-simple.c @@ -173,9 +173,9 @@ void is31fl3733_init(uint8_t addr, uint8_t sync) { } void is31fl3733_set_value(int index, uint8_t value) { - is31_led led; + is31fl3733_led_t led; if (index >= 0 && index < LED_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.v] == value) { return; @@ -192,8 +192,8 @@ void is31fl3733_set_value_all(uint8_t value) { } void is31fl3733_set_led_control_register(uint8_t index, bool value) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3733_led_t led; + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); uint8_t control_register = led.v / 8; uint8_t bit_value = led.v % 8; diff --git a/drivers/led/issi/is31fl3733-simple.h b/drivers/led/issi/is31fl3733-simple.h index b870c5c58c..8041a7f0f3 100644 --- a/drivers/led/issi/is31fl3733-simple.h +++ b/drivers/led/issi/is31fl3733-simple.h @@ -47,6 +47,9 @@ # define IS31FL3733_GLOBALCURRENT ISSI_GLOBALCURRENT #endif +#define is31_led is31fl3733_led_t +#define g_is31_leds g_is31fl3733_leds + #define PUR_0R IS31FL3733_PUR_0R #define PUR_05KR IS31FL3733_PUR_05KR #define PUR_3KR IS31FL3733_PUR_3KR @@ -73,12 +76,12 @@ #define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E #define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F -typedef struct is31_led { +typedef struct is31fl3733_led_t { uint8_t driver : 2; uint8_t v; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3733_led_t; -extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT]; +extern const is31fl3733_led_t PROGMEM g_is31fl3733_leds[LED_MATRIX_LED_COUNT]; void is31fl3733_init(uint8_t addr, uint8_t sync); bool is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index e501175a11..efc5929587 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c @@ -172,9 +172,9 @@ void is31fl3733_init(uint8_t addr, uint8_t sync) { } void is31fl3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; + is31fl3733_led_t led; if (index >= 0 && index < RGB_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) { return; @@ -193,8 +193,8 @@ void is31fl3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { } void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3733_led_t led; + memcpy_P(&led, (&g_is31fl3733_leds[index]), sizeof(led)); uint8_t control_register_r = led.r / 8; uint8_t control_register_g = led.g / 8; diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index e16560807f..be80e9e32c 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -46,6 +46,9 @@ # define IS31FL3733_GLOBALCURRENT ISSI_GLOBALCURRENT #endif +#define is31_led is31fl3733_led_t +#define g_is31_leds g_is31fl3733_leds + #define PUR_0R IS31FL3733_PUR_0R #define PUR_05KR IS31FL3733_PUR_05KR #define PUR_3KR IS31FL3733_PUR_3KR @@ -72,14 +75,14 @@ #define IS31FL3733_I2C_ADDRESS_VCC_SDA 0x5E #define IS31FL3733_I2C_ADDRESS_VCC_VCC 0x5F -typedef struct is31_led { +typedef struct is31fl3733_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3733_led_t; -extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT]; +extern const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT]; void is31fl3733_init(uint8_t addr, uint8_t sync); bool is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3736-simple.c b/drivers/led/issi/is31fl3736-simple.c index cd4038ac2c..f3f202efb2 100644 --- a/drivers/led/issi/is31fl3736-simple.c +++ b/drivers/led/issi/is31fl3736-simple.c @@ -158,9 +158,9 @@ void is31fl3736_init(uint8_t addr) { } void is31fl3736_set_value(int index, uint8_t value) { - is31_led led; + is31fl3736_led_t led; if (index >= 0 && index < LED_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.v] == value) { return; @@ -177,8 +177,8 @@ void is31fl3736_set_value_all(uint8_t value) { } void is31fl3736_set_led_control_register(uint8_t index, bool value) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3736_led_t led; + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); // The PWM register for a matrix position (0x00 to 0xBF) is interleaved, so: // A1=0x00 A2=0x02 A3=0x04 A4=0x06 A5=0x08 A6=0x0A A7=0x0C A8=0x0E diff --git a/drivers/led/issi/is31fl3736-simple.h b/drivers/led/issi/is31fl3736-simple.h index 9f8056af5b..d5525e460d 100644 --- a/drivers/led/issi/is31fl3736-simple.h +++ b/drivers/led/issi/is31fl3736-simple.h @@ -41,6 +41,9 @@ # define IS31FL3736_GLOBALCURRENT ISSI_GLOBALCURRENT #endif +#define is31_led is31fl3736_led_t +#define g_is31_leds g_is31fl3736_leds + #define PUR_0R IS31FL3736_PUR_0R #define PUR_05KR IS31FL3736_PUR_05KR #define PUR_1KR IS31FL3736_PUR_1KR @@ -68,12 +71,12 @@ #define IS31FL3736_I2C_ADDRESS_VCC_SDA 0x5E #define IS31FL3736_I2C_ADDRESS_VCC_VCC 0x5F -typedef struct is31_led { +typedef struct is31fl3736_led_t { uint8_t driver : 2; uint8_t v; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3736_led_t; -extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT]; +extern const is31fl3736_led_t PROGMEM g_is31fl3736_leds[LED_MATRIX_LED_COUNT]; void is31fl3736_init(uint8_t addr); void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3736.c b/drivers/led/issi/is31fl3736.c index 23ff0637a6..03f50873df 100644 --- a/drivers/led/issi/is31fl3736.c +++ b/drivers/led/issi/is31fl3736.c @@ -158,9 +158,9 @@ void is31fl3736_init(uint8_t addr) { } void is31fl3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; + is31fl3736_led_t led; if (index >= 0 && index < RGB_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) { return; @@ -179,8 +179,8 @@ void is31fl3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { } void is31fl3736_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3736_led_t led; + memcpy_P(&led, (&g_is31fl3736_leds[index]), sizeof(led)); // The PWM register for a matrix position (0x00 to 0xBF) is interleaved, so: // A1=0x00 A2=0x02 A3=0x04 A4=0x06 A5=0x08 A6=0x0A A7=0x0C A8=0x0E diff --git a/drivers/led/issi/is31fl3736.h b/drivers/led/issi/is31fl3736.h index f263b131fd..37031134e9 100644 --- a/drivers/led/issi/is31fl3736.h +++ b/drivers/led/issi/is31fl3736.h @@ -41,6 +41,9 @@ # define IS31FL3736_GLOBALCURRENT ISSI_GLOBALCURRENT #endif +#define is31_led is31fl3736_led_t +#define g_is31_leds g_is31fl3736_leds + #define PUR_0R IS31FL3736_PUR_0R #define PUR_05KR IS31FL3736_PUR_05KR #define PUR_1KR IS31FL3736_PUR_1KR @@ -68,14 +71,14 @@ #define IS31FL3736_I2C_ADDRESS_VCC_SDA 0x5E #define IS31FL3736_I2C_ADDRESS_VCC_VCC 0x5F -typedef struct is31_led { +typedef struct is31fl3736_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3736_led_t; -extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT]; +extern const is31fl3736_led_t PROGMEM g_is31fl3736_leds[RGB_MATRIX_LED_COUNT]; void is31fl3736_init(uint8_t addr); void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3737-simple.c b/drivers/led/issi/is31fl3737-simple.c index b25fbb5a56..3db7b7ed33 100644 --- a/drivers/led/issi/is31fl3737-simple.c +++ b/drivers/led/issi/is31fl3737-simple.c @@ -161,9 +161,9 @@ void is31fl3737_init(uint8_t addr) { } void is31fl3737_set_value(int index, uint8_t value) { - is31_led led; + is31fl3737_led_t led; if (index >= 0 && index < LED_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.v] == value) { return; @@ -180,8 +180,8 @@ void is31fl3737_set_value_all(uint8_t value) { } void is31fl3737_set_led_control_register(uint8_t index, bool value) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3737_led_t led; + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); uint8_t control_register = led.v / 8; uint8_t bit_value = led.v % 8; diff --git a/drivers/led/issi/is31fl3737-simple.h b/drivers/led/issi/is31fl3737-simple.h index d242daa1d0..0f4e0d014b 100644 --- a/drivers/led/issi/is31fl3737-simple.h +++ b/drivers/led/issi/is31fl3737-simple.h @@ -61,12 +61,12 @@ #define IS31FL3737_I2C_ADDRESS_SDA 0x5A #define IS31FL3737_I2C_ADDRESS_VCC 0x5F -typedef struct is31_led { +typedef struct is31fl3737_led_t { uint8_t driver : 2; uint8_t v; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3737_led_t; -extern const is31_led PROGMEM g_is31_leds[LED_MATRIX_LED_COUNT]; +extern const is31fl3737_led_t PROGMEM g_is31fl3737_leds[LED_MATRIX_LED_COUNT]; void is31fl3737_init(uint8_t addr); void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3737.c b/drivers/led/issi/is31fl3737.c index 3d93548a46..c2af75bbb8 100644 --- a/drivers/led/issi/is31fl3737.c +++ b/drivers/led/issi/is31fl3737.c @@ -161,9 +161,9 @@ void is31fl3737_init(uint8_t addr) { } void is31fl3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; + is31fl3737_led_t led; if (index >= 0 && index < RGB_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) { return; @@ -182,8 +182,8 @@ void is31fl3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { } void is31fl3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3737_led_t led; + memcpy_P(&led, (&g_is31fl3737_leds[index]), sizeof(led)); uint8_t control_register_r = led.r / 8; uint8_t control_register_g = led.g / 8; diff --git a/drivers/led/issi/is31fl3737.h b/drivers/led/issi/is31fl3737.h index 2d6612b704..84ed95f793 100644 --- a/drivers/led/issi/is31fl3737.h +++ b/drivers/led/issi/is31fl3737.h @@ -46,6 +46,9 @@ # define IS31FL3737_GLOBALCURRENT ISSI_GLOBALCURRENT #endif +#define is31_led is31fl3737_led_t +#define g_is31_leds g_is31fl3737_leds + #define PUR_0R IS31FL3737_PUR_0R #define PUR_05KR IS31FL3737_PUR_05KR #define PUR_1KR IS31FL3737_PUR_1KR @@ -61,14 +64,14 @@ #define IS31FL3737_I2C_ADDRESS_SDA 0x5A #define IS31FL3737_I2C_ADDRESS_VCC 0x5F -typedef struct is31_led { +typedef struct is31fl3737_led_t { uint8_t driver : 2; uint8_t r; uint8_t g; uint8_t b; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3737_led_t; -extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT]; +extern const is31fl3737_led_t PROGMEM g_is31fl3737_leds[RGB_MATRIX_LED_COUNT]; void is31fl3737_init(uint8_t addr); void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data); diff --git a/drivers/led/issi/is31fl3741-simple.c b/drivers/led/issi/is31fl3741-simple.c index 7df3030131..93c02fbc26 100644 --- a/drivers/led/issi/is31fl3741-simple.c +++ b/drivers/led/issi/is31fl3741-simple.c @@ -173,9 +173,9 @@ void is31fl3741_init(uint8_t addr) { } void is31fl3741_set_value(int index, uint8_t value) { - is31_led led; + is31fl3741_led_t led; if (index >= 0 && index < LED_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.v] == value) { return; @@ -192,8 +192,8 @@ void is31fl3741_set_value_all(uint8_t value) { } void is31fl3741_set_led_control_register(uint8_t index, bool value) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3741_led_t led; + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); if (value) { g_scaling_registers[led.driver][led.v] = 0xFF; @@ -216,7 +216,7 @@ void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index) { g_pwm_buffer_update_required[index] = false; } -void is31fl3741_set_pwm_buffer(const is31_led *pled, uint8_t value) { +void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t value) { g_pwm_buffer[pled->driver][pled->v] = value; g_pwm_buffer_update_required[pled->driver] = true; @@ -246,7 +246,7 @@ void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index) { } } -void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t value) { +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t value) { g_scaling_registers[pled->driver][pled->v] = value; g_scaling_registers_update_required[pled->driver] = true; diff --git a/drivers/led/issi/is31fl3741-simple.h b/drivers/led/issi/is31fl3741-simple.h index 8bca066ad3..46c058c644 100644 --- a/drivers/led/issi/is31fl3741-simple.h +++ b/drivers/led/issi/is31fl3741-simple.h @@ -61,12 +61,12 @@ #define IS31FL3741_I2C_ADDRESS_SDA 0x32 #define IS31FL3741_I2C_ADDRESS_VCC 0x33 -typedef struct is31_led { +typedef struct is31fl3741_led_t { uint32_t driver : 2; uint32_t v : 10; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3741_led_t; -extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT]; +extern const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT]; void is31fl3741_init(uint8_t addr); void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data); @@ -83,9 +83,9 @@ void is31fl3741_set_led_control_register(uint8_t index, bool value); // If the buffer is dirty, it will update the driver with the buffer. void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index); -void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t value); +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t value); -void is31fl3741_set_pwm_buffer(const is31_led *pled, uint8_t value); +void is31fl3741_set_pwm_buffer(const is31fl3741_led *pled, uint8_t value); #define IS31FL3741_PUR_0R 0x00 // No PUR resistor #define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor diff --git a/drivers/led/issi/is31fl3741.c b/drivers/led/issi/is31fl3741.c index f34e0b87a1..47c15a11ca 100644 --- a/drivers/led/issi/is31fl3741.c +++ b/drivers/led/issi/is31fl3741.c @@ -173,9 +173,9 @@ void is31fl3741_init(uint8_t addr) { } void is31fl3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31_led led; + is31fl3741_led_t led; if (index >= 0 && index < RGB_MATRIX_LED_COUNT) { - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) { return; @@ -194,8 +194,8 @@ void is31fl3741_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { } void is31fl3741_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { - is31_led led; - memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + is31fl3741_led_t led; + memcpy_P(&led, (&g_is31fl3741_leds[index]), sizeof(led)); if (red) { g_scaling_registers[led.driver][led.r] = 0xFF; @@ -230,7 +230,7 @@ void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index) { g_pwm_buffer_update_required[index] = false; } -void is31fl3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue) { +void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue) { g_pwm_buffer[pled->driver][pled->r] = red; g_pwm_buffer[pled->driver][pled->g] = green; g_pwm_buffer[pled->driver][pled->b] = blue; @@ -262,7 +262,7 @@ void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index) { } } -void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue) { +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue) { g_scaling_registers[pled->driver][pled->r] = red; g_scaling_registers[pled->driver][pled->g] = green; g_scaling_registers[pled->driver][pled->b] = blue; diff --git a/drivers/led/issi/is31fl3741.h b/drivers/led/issi/is31fl3741.h index 65f8af98c8..ff16624009 100644 --- a/drivers/led/issi/is31fl3741.h +++ b/drivers/led/issi/is31fl3741.h @@ -46,6 +46,9 @@ # define IS31FL3741_GLOBALCURRENT ISSI_GLOBALCURRENT #endif +#define is31_led is31fl3741_led_t +#define g_is31_leds g_is31fl3741_leds + #define PUR_0R IS31FL3741_PUR_0R #define PUR_05KR IS31FL3741_PUR_05KR #define PUR_1KR IS31FL3741_PUR_1KR @@ -61,14 +64,14 @@ #define IS31FL3741_I2C_ADDRESS_SDA 0x32 #define IS31FL3741_I2C_ADDRESS_VCC 0x33 -typedef struct is31_led { +typedef struct is31fl3741_led_t { uint32_t driver : 2; uint32_t r : 10; uint32_t g : 10; uint32_t b : 10; -} __attribute__((packed)) is31_led; +} __attribute__((packed)) is31fl3741_led_t; -extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT]; +extern const is31fl3741_led_t PROGMEM g_is31fl3741_leds[RGB_MATRIX_LED_COUNT]; void is31fl3741_init(uint8_t addr); void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data); @@ -85,9 +88,9 @@ void is31fl3741_set_led_control_register(uint8_t index, bool red, bool green, bo // If the buffer is dirty, it will update the driver with the buffer. void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3741_update_led_control_registers(uint8_t addr, uint8_t index); -void is31fl3741_set_scaling_registers(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue); -void is31fl3741_set_pwm_buffer(const is31_led *pled, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue); #define IS31FL3741_PUR_0R 0x00 // No PUR resistor #define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor -- cgit v1.2.3