Skip to content

Commit

Permalink
add tdcq rgb
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jun 14, 2021
1 parent c4ce4eb commit 2f8235c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 44 deletions.
4 changes: 2 additions & 2 deletions keyboards/yandrstudio/tdcq64_2s/f401/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 2
# define RGBLED_NUM 14
# define DRIVER_LED_TOTAL RGBLED_NUM

#define WS2812_PWM_DRIVER PWMD3 // default: PWMD2
Expand All @@ -45,7 +45,7 @@
#ifdef RGBLIGHT_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 2
# define RGBLED_NUM 14
# define DRIVER_LED_TOTAL RGBLED_NUM


Expand Down
1 change: 0 additions & 1 deletion keyboards/yandrstudio/tdcq64_2s/f401/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ BACKLIGHT_ENABLE = yes
WS2812_DRIVER = pwm
BACKLIGHT_DRIVER = pwm


EEPROM_DRIVER = custom
SRC += eep/eeprom_stm32.c
SRC += eep/flash_stm32.c
Expand Down
24 changes: 7 additions & 17 deletions keyboards/yandrstudio/tdcq64_2s/tdcq64_2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,23 @@
#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = {
{
{ 0, 1, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } \
},
{
// LED Index to Physical Position
{0, 0}, {16, 0}

{0,48}, {32,48}, {64,48}, {96,48}, {128,48}, {160,48}, {192,48},\
{192,0}, {160,0}, {128,0}, {96,0}, {64,0}, {32,0}, {0,0}
},
{
// LED Index to Flag
4, 4
2,2,2,2,2,2,2,2,2,2,2,2,2,2
}
};

// void rgb_matrix_indicators_kb(void) {
// if (rgb_matrix_is_enabled()) {
// if (biton32(layer_state) == 1) { // UPPER_LAYER = BLUE
// rgb_matrix_set_color(57, 100, 0, 0);
// rgb_matrix_set_color(58, 0, 100, 0);
// rgb_matrix_set_color(60, 100, 0, 0);
// rgb_matrix_set_color(61, 100, 0, 0);
// }
// }
// }

#endif

Expand Down
4 changes: 2 additions & 2 deletions keyboards/yandrstudio/tdcq68/f401/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 2
# define RGBLED_NUM 79
# define DRIVER_LED_TOTAL RGBLED_NUM

#define WS2812_PWM_DRIVER PWMD3 // default: PWMD2
Expand All @@ -45,7 +45,7 @@
#ifdef RGBLIGHT_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 2
# define RGBLED_NUM 79
# define DRIVER_LED_TOTAL RGBLED_NUM


Expand Down
1 change: 0 additions & 1 deletion keyboards/yandrstudio/tdcq68/f401/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
WS2812_DRIVER = pwm


EEPROM_DRIVER = custom
SRC += eep/eeprom_stm32.c
SRC += eep/flash_stm32.c
Expand Down
36 changes: 15 additions & 21 deletions keyboards/yandrstudio/tdcq68/tdcq68.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,33 @@
*/
#include "tdcq68.h"




#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = {
{
{ 0, 1, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, \
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } \
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, \
{ 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15 }, \
{ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, 43 }, \
{ 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, NO_LED, 46, 45, 44 }, \
{ 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, 62, 63, NO_LED, NO_LED, 64, 65, 66 } \
},
{
// LED Index to Physical Position
{0, 0}, {16, 0}

{0,0}, {16,0}, {32,0}, {48,0}, {64,0}, {80,0}, {96,0}, {112,0}, {128,0}, {144,0}, {160,0}, {176,0}, {192,0}, {208,0}, {224,0}, \
{224,16}, {208,16}, {192,16}, {176,16}, {160,16}, {144,16}, {128,16}, {112,16}, {96,16}, {80,16}, {64,16}, {48,16}, {32,16}, {16,16}, {0,16}, \
{0,32}, {16,32}, {32,32}, {48,32}, {64,32}, {80,32}, {96,32}, {112,32}, {128,32}, {144,32}, {160,32}, {176,32}, {208,32}, {224,32}, \
{224,48}, {208,48}, {192,48}, {160,48}, {144,48}, {128,48}, {112,48}, {96,48}, {80,48}, {64,48}, {48,48}, {32,48}, {16,48}, {0,48}, \
{0,64}, {16,64}, {32,64}, {96,64}, {128,64}, {144,64}, {192,64}, {208,64}, {224,64}, \

{208,48}, {160,48}, {128,48}, {96,48}, {64,48}, {16,48}, \
{32,0}, {64,0}, {112,0}, {144,0}, {176,0}, {192,0} \
},
{
// LED Index to Flag
4, 4
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\
2,2,2,2,2,2,2,2,2,2,2,2
}
};

// void rgb_matrix_indicators_kb(void) {
// if (rgb_matrix_is_enabled()) {
// if (biton32(layer_state) == 1) { // UPPER_LAYER = BLUE
// rgb_matrix_set_color(57, 100, 0, 0);
// rgb_matrix_set_color(58, 0, 100, 0);
// rgb_matrix_set_color(60, 100, 0, 0);
// rgb_matrix_set_color(61, 100, 0, 0);
// }
// }
// }

#endif

Expand Down

0 comments on commit 2f8235c

Please sign in to comment.