From e7061ed797d0ec200d42fe9a70c6e66a977c8558 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Tue, 10 Jan 2023 17:53:33 +0800 Subject: [PATCH] lotus: Update matrix to use NO_LED Clearer than magic number. Signed-off-by: Daniel Schaefer --- keyboards/lotus/ansi/ansi.c | 16 ++++++++-------- keyboards/lotus/gridpad/keymaps/default/keymap.c | 8 ++++---- keyboards/lotus/led.py | 4 +++- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/keyboards/lotus/ansi/ansi.c b/keyboards/lotus/ansi/ansi.c index 89f58b2209..07d01e9933 100644 --- a/keyboards/lotus/ansi/ansi.c +++ b/keyboards/lotus/ansi/ansi.c @@ -295,14 +295,14 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { led_config_t g_led_config = { { // Key Matrix to LED Index - { 31, 72, 5, 84, 255, 29, 33, 77, 75, 80, 78, 255, 88, 79, 52, 255, }, - {255, 255, 255, 47, 94, 27, 35, 76, 81, 32, 255, 255, 34, 90, 53, 67, }, - {255, 255, 93, 255, 2, 19, 39, 40, 55, 255, 26, 255, 255, 63, 255, 91, }, - {255, 46, 1, 255, 20, 21, 7, 8, 59, 255, 24, 74, 255, 255, 255, 70, }, - {255, 255, 16, 255, 44, 41, 9, 14, 68, 255, 22, 255, 255, 61, 62, 255, }, - {255, 255, 15, 255, 12, 13, 11, 10, 69, 255, 17, 255, 255, 60, 64, 255, }, - {255, 255, 255, 255, 18, 3, 4, 6, 66, 255, 58, 89, 255, 57, 54, 255, }, - {255, 255, 36, 255, 255, 25, 43, 49, 51, 255, 50, 255, 255, 48, 37, 255, }, + { 31, 72, 5, 84, NO_LED, 29, 33, 77, 75, 80, 78, NO_LED, 88, 79, 52, NO_LED, }, + {NO_LED, NO_LED, NO_LED, 47, 94, 27, 35, 76, 81, 32, NO_LED, NO_LED, 34, 90, 53, 67, }, + {NO_LED, NO_LED, 93, NO_LED, 2, 19, 39, 40, 55, NO_LED, 26, NO_LED, NO_LED, 63, NO_LED, 91, }, + {NO_LED, 46, 1, NO_LED, 20, 21, 7, 8, 59, NO_LED, 24, 74, NO_LED, NO_LED, NO_LED, 70, }, + {NO_LED, NO_LED, 16, NO_LED, 44, 41, 9, 14, 68, NO_LED, 22, NO_LED, NO_LED, 61, 62, NO_LED, }, + {NO_LED, NO_LED, 15, NO_LED, 12, 13, 11, 10, 69, NO_LED, 17, NO_LED, NO_LED, 60, 64, NO_LED, }, + {NO_LED, NO_LED, NO_LED, NO_LED, 18, 3, 4, 6, 66, NO_LED, 58, 89, NO_LED, 57, 54, NO_LED, }, + {NO_LED, NO_LED, 36, NO_LED, NO_LED, 25, 43, 49, 51, NO_LED, 50, NO_LED, NO_LED, 48, 37, NO_LED, }, }, { // LED Index to Physical Position { 11, 23 }, // LED 1 diff --git a/keyboards/lotus/gridpad/keymaps/default/keymap.c b/keyboards/lotus/gridpad/keymaps/default/keymap.c index 806aaa59a1..412e9e80f9 100644 --- a/keyboards/lotus/gridpad/keymaps/default/keymap.c +++ b/keyboards/lotus/gridpad/keymaps/default/keymap.c @@ -44,10 +44,10 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { led_config_t g_led_config = { { // Key Matrix to LED Index - { 4, 7, 6, 9, 0, 1, 3, 11, }, - { 8, 20, 21, 23, 15, 16, 18, 19, }, - { 12, 5, 2, 255, 17, 255, 13, 10, }, - {255, 255, 255, 255, 22, 255, 255, 255, }, + { 4, 7, 6, 9, 0, 1, 3, 11, }, + { 8, 20, 21, 23, 15, 16, 18, 19, }, + { 12, 5, 2, NO_LED, 17, NO_LED, 13, 10, }, + {NO_LED, NO_LED, NO_LED, NO_LED, 22, NO_LED, NO_LED, NO_LED, }, }, { // LED Index to Physical Position { 73, 10 }, // LED 1 diff --git a/keyboards/lotus/led.py b/keyboards/lotus/led.py index a2600ed943..bc4c071201 100755 --- a/keyboards/lotus/led.py +++ b/keyboards/lotus/led.py @@ -237,7 +237,9 @@ def print_matrix(layout, led_to_el, normalized): for row in led_to_el: print(" {", end='') for col in row: - print(f"{col: >3}, ", end='') + if col == 255: + col = 'NO_LED' + print(f"{col: >6}, ", end='') print("},") print("}, {")