diff options
author | XScorpion2 <rcalt2vt@gmail.com> | 2019-05-07 18:22:46 -0500 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-07 16:22:46 -0700 |
commit | af89752bffbaf5dcea30ea16be66b4d682701bc4 (patch) | |
tree | c82f2bc25409159a44778379db8b3a35afc47b8a /keyboards/hs60/v1 | |
parent | c7f8548d9af2045996294602d2a4bd9a214ae23c (diff) |
rgb_led struct conversion (aka: Per led (key) type rgb matrix effects - part 2) (#5783)
* Initial conversion of the rgb_led struct
* Converting last keyboard & updating effects to take advantage of the new structure
* New struct should not be const
* Updated docs
* Changing define ___ for no led to NO_LED
* Missed converting some keymap usages of the old struct layout
Diffstat (limited to 'keyboards/hs60/v1')
-rw-r--r-- | keyboards/hs60/v1/v1.c | 218 |
1 files changed, 63 insertions, 155 deletions
diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c index bd6dd19b2a..5267c94576 100644 --- a/keyboards/hs60/v1/v1.c +++ b/keyboards/hs60/v1/v1.c @@ -165,83 +165,37 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, A15, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, ---, A14, -// D3, ---, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 4}, - {{0|(11<<4)}, {187, 0}, 4}, - {{0|(10<<4)}, {170, 0}, 4}, - {{0|(9<<4)}, {153, 0}, 4}, - {{0|(8<<4)}, {136, 0}, 4}, - {{0|(7<<4)}, {119, 0}, 4}, - {{1|(7<<4)}, {119, 16}, 4}, - {{1|(8<<4)}, {136, 16}, 4}, - {{1|(9<<4)}, {153, 16}, 4}, - {{1|(10<<4)}, {170, 16}, 4}, - {{1|(11<<4)}, {187, 16}, 4}, - {{1|(12<<4)}, {204, 16}, 4}, - {{2|(13<<4)}, {224, 32}, 1}, - {{2|(12<<4)}, {224, 16}, 4}, - {{2|(11<<4)}, {197, 32}, 4}, - - {{3|(10<<4)}, {170, 48}, 4}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 4}, - {{3|(8<<4)}, {136, 48}, 4}, - {{3|(7<<4)}, {119, 48}, 4}, - {{2|(7<<4)}, {119, 32}, 4}, - {{2|(8<<4)}, {136, 32}, 4}, - {{2|(9<<4)}, {153, 32}, 4}, - {{2|(10<<4)}, {170, 32}, 4}, - {{3|(11<<4)}, {187, 48}, 4}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 4}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 4}, - {{0|(4<<4)}, { 68, 0}, 4}, - {{0|(3<<4)}, { 51, 0}, 4}, - {{0|(2<<4)}, { 34, 0}, 4}, - {{0|(1<<4)}, { 17, 0}, 4}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 4}, - {{1|(2<<4)}, { 34, 16}, 4}, - {{1|(3<<4)}, { 51, 16}, 4}, - {{1|(4<<4)}, { 68, 16}, 4}, - {{1|(5<<4)}, { 85, 16}, 4}, - {{1|(6<<4)}, {102, 16}, 4}, - {{2|(6<<4)}, {102, 32}, 4}, - {{2|(5<<4)}, { 85, 32}, 4}, - - {{3|(2<<4)}, { 32, 48}, 4}, //D1-D16 - //D2 - {{3|(0<<4)}, { 10, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 4}, - {{2|(2<<4)}, { 34, 32}, 4}, - {{2|(3<<4)}, { 51, 32}, 4}, - {{2|(4<<4)}, { 68, 32}, 4}, - {{3|(3<<4)}, { 51, 48}, 4}, - {{3|(4<<4)}, { 68, 48}, 4}, - {{3|(5<<4)}, { 85, 48}, 4}, - {{3|(6<<4)}, {102, 48}, 4}, - {{4|(3<<4)}, {102, 64}, 4}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; +led_config_t g_led_config = { { + { 36, 35, 34, 33, 32, 31, 30, 6, 5, 4, 3, 2, 1, 0 }, + { 37, 38, 39, 40, 41, 42, 43, 7, 8, 9, 10, 11, 12, NO_LED }, + { 48, 49, 50, 51, 52, 45, 44, 20, 21, 22, 23, 15, 14, 13 }, + { 47, NO_LED, 46, 53, 54, 55, 56, 19, 18, 17, 16, 24, NO_LED, 25 }, + { 60, 59, 58, 57, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 29, 28, 27, 26 } +}, { + //A1-A16 + { 224, 0 }, { 204, 0 }, { 187, 0 }, { 170, 0 }, { 153, 0 }, { 136, 0 }, { 119, 0 }, { 119, 16 }, { 136, 16 }, { 153, 16 }, { 170, 16 }, { 187, 16 }, { 204, 16 }, { 224, 32 }, + { 224, 16 }, { 197, 32 }, + //B1-B14 + { 170, 48 }, { 153, 48 }, { 136, 48 }, { 119, 48 }, { 119, 32 }, { 136, 32 }, { 153, 32 }, { 170, 32 }, { 187, 48 }, { 214, 48 }, { 224, 64 }, { 204, 64 }, { 187, 64 }, { 170, 64 }, + //C1-C16 + { 102, 0 }, { 85, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, { 0, 16 }, { 17, 16 }, { 34, 16 }, { 51, 16 }, { 68, 16 }, { 85, 16 }, { 102, 16 }, + { 102, 32 }, { 85, 32 }, + //D1-D16 + { 32, 48 }, { 10, 48 }, { 0, 32 }, { 17, 32 }, { 34, 32 }, { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, { 34, 68 }, { 17, 68 }, + { 0, 68 } +}, { + //A1-A16 + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, + //B1-B14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, + //C1-C16 + 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, + 4, 4, + //D1-D16 + 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1 +} }; #else @@ -319,83 +273,37 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, ---, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, A15, A14, -// D3, D2, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 4}, - {{0|(11<<4)}, {187, 0}, 4}, - {{0|(10<<4)}, {170, 0}, 4}, - {{0|(9<<4)}, {153, 0}, 4}, - {{0|(8<<4)}, {136, 0}, 4}, - {{0|(7<<4)}, {119, 0}, 4}, - {{1|(7<<4)}, {119, 16}, 4}, - {{1|(8<<4)}, {136, 16}, 4}, - {{1|(9<<4)}, {153, 16}, 4}, - {{1|(10<<4)}, {170, 16}, 4}, - {{1|(11<<4)}, {187, 16}, 4}, - {{1|(12<<4)}, {204, 16}, 4}, - {{2|(13<<4)}, {224, 8}, 1}, - {{2|(12<<4)}, {204, 32}, 4}, - {{2|(11<<4)}, {187, 32}, 4}, - - {{3|(10<<4)}, {170, 48}, 4}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 4}, - {{3|(8<<4)}, {136, 48}, 4}, - {{3|(7<<4)}, {119, 48}, 4}, - {{2|(7<<4)}, {119, 32}, 4}, - {{2|(8<<4)}, {136, 32}, 4}, - {{2|(9<<4)}, {153, 32}, 4}, - {{2|(10<<4)}, {170, 32}, 4}, - {{3|(11<<4)}, {187, 48}, 4}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 4}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 4}, - {{0|(4<<4)}, { 68, 0}, 4}, - {{0|(3<<4)}, { 51, 0}, 4}, - {{0|(2<<4)}, { 34, 0}, 4}, - {{0|(1<<4)}, { 17, 0}, 4}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 4}, - {{1|(2<<4)}, { 34, 16}, 4}, - {{1|(3<<4)}, { 51, 16}, 4}, - {{1|(4<<4)}, { 68, 16}, 4}, - {{1|(5<<4)}, { 85, 16}, 4}, - {{1|(6<<4)}, {102, 16}, 4}, - {{2|(6<<4)}, {102, 32}, 4}, - {{2|(5<<4)}, { 85, 32}, 4}, - - {{3|(2<<4)}, { 32, 48}, 4}, //D1-D16 - {{3|(1<<4)}, { 17, 48}, 4}, - {{3|(0<<4)}, { 0, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 4}, - {{2|(2<<4)}, { 34, 32}, 4}, - {{2|(3<<4)}, { 51, 32}, 4}, - {{2|(4<<4)}, { 68, 32}, 4}, - {{3|(3<<4)}, { 51, 48}, 4}, - {{3|(4<<4)}, { 68, 48}, 4}, - {{3|(5<<4)}, { 85, 48}, 4}, - {{3|(6<<4)}, {102, 48}, 4}, - {{4|(3<<4)}, {102, 64}, 4}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; +led_config_t g_led_config = { { + { 36, 35, 34, 33, 32, 31, 30, 6, 5, 4, 3, 2, 1, 0 }, + { 37, 38, 39, 40, 41, 42, 43, 7, 8, 9, 10, 11, 12, NO_LED }, + { 49, 50, 51, 52, 53, 45, 44, 20, 21, 22, 23, 15, 14, 13 }, + { 48, 47, 46, 54, 55, 56, 57, 19, 18, 17, 16, 24, NO_LED, 25 }, + { 61, 60, 59, 58, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 29, 28, 27, 26 } +}, { + //A1-A16 + { 224, 0 }, { 204, 0 }, { 187, 0 }, { 170, 0 }, { 153, 0 }, { 136, 0 }, { 119, 0 }, { 119, 16 }, { 136, 16 }, { 153, 16 }, { 170, 16 }, { 187, 16 }, { 204, 16 }, { 224, 8 }, + { 204, 32 }, { 187, 32 }, + //B1-B14 + { 170, 48 }, { 153, 48 }, { 136, 48 }, { 119, 48 }, { 119, 32 }, { 136, 32 }, { 153, 32 }, { 170, 32 }, { 187, 48 }, { 214, 48 }, { 224, 64 }, { 204, 64 }, { 187, 64 }, { 170, 64 }, + //C1-C16 + { 102, 0 }, { 85, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, { 0, 16 }, { 17, 16 }, { 34, 16 }, { 51, 16 }, { 68, 16 }, { 85, 16 }, { 102, 16 }, + { 102, 32 }, { 85, 32 }, + //D1-D16 + { 32, 48 }, { 17, 48 }, { 0, 48 }, { 0, 32 }, { 17, 32 }, { 34, 32 }, { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, { 34, 68 }, + { 17, 68 }, { 0, 68 } +}, { + //A1-A16 + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, + //B1-B14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, + //C1-C16 + 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, + 4, 4, + //D1-D16 + 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1 +} }; #endif @@ -492,4 +400,4 @@ void suspend_power_down_kb(void) void suspend_wakeup_init_kb(void) { rgb_matrix_set_suspend_state(false); -}
\ No newline at end of file +} |