From 81d8e6ef3e4d69dba8e9ba40db525ab4181ab3e3 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 21 Apr 2019 19:59:39 -0700 Subject: [Keyboard] Doro67 RGB PCB (#5677) * initial commit * get rid of some of the vanilla code * set up matrix and pins * Create LAYOUT macro and an appropriate keymap * support for caps lock LED * add some documentation to the doro67 parent readme * align the language used in the several readme files * initial commit * get rid of some of the vanilla code * set up matrix and pins * Create LAYOUT macro and an appropriate keymap * support for caps lock LED * add some documentation to the doro67 parent readme * align the language used in the several readme files * Use RGB Matrix and fix enter key bug * fix formatting * remove merge conflict artifacts * make a more useful default keymap * add configurator support for the RGB pcb * fix rgb matrix based on new info. Multipler should be reversed * forgot to actually set the pin output for caps lock led * fix offset keys in layer 1 keymap * code cleanup * use macros for the rgb_led calculations struct * set RGB led num to 67 as I mistakenly counted the caps lock led * cleanup config.h file * add RGB note in readme * get consistent naming in config file * fix some inconsistencies * readjust matrix and get rid of macros based on drashna's suggestions --- keyboards/doro67/rgb/config.h | 71 ++++++++++++++ keyboards/doro67/rgb/info.json | 82 ++++++++++++++++ keyboards/doro67/rgb/keymaps/default/config.h | 19 ++++ keyboards/doro67/rgb/keymaps/default/keymap.c | 62 ++++++++++++ keyboards/doro67/rgb/keymaps/default/readme.md | 1 + keyboards/doro67/rgb/readme.md | 17 ++++ keyboards/doro67/rgb/rgb.c | 127 +++++++++++++++++++++++++ keyboards/doro67/rgb/rgb.h | 41 ++++++++ keyboards/doro67/rgb/rules.mk | 83 ++++++++++++++++ 9 files changed, 503 insertions(+) create mode 100644 keyboards/doro67/rgb/config.h create mode 100644 keyboards/doro67/rgb/info.json create mode 100644 keyboards/doro67/rgb/keymaps/default/config.h create mode 100644 keyboards/doro67/rgb/keymaps/default/keymap.c create mode 100644 keyboards/doro67/rgb/keymaps/default/readme.md create mode 100644 keyboards/doro67/rgb/readme.md create mode 100644 keyboards/doro67/rgb/rgb.c create mode 100644 keyboards/doro67/rgb/rgb.h create mode 100644 keyboards/doro67/rgb/rules.mk (limited to 'keyboards/doro67/rgb') diff --git a/keyboards/doro67/rgb/config.h b/keyboards/doro67/rgb/config.h new file mode 100644 index 000000000..87a30e084 --- /dev/null +++ b/keyboards/doro67/rgb/config.h @@ -0,0 +1,71 @@ +/* +Copyright 2019 MechMerlin + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Backprop Studio +#define PRODUCT Doro67 RGB PCB +#define DESCRIPTION 65% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +// The pin connected to the data pin of the LEDs +#define RGB_DI_PIN B7 +// The number of LEDs connected +#define DRIVER_LED_TOTAL 67 + +#define RGB_MATRIX_KEYPRESSES + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +#define RGBLED_NUM 67 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/doro67/rgb/info.json b/keyboards/doro67/rgb/info.json new file mode 100644 index 000000000..2d9b79a23 --- /dev/null +++ b/keyboards/doro67/rgb/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Doro 67 RGB", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 67, + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K04", "x":4, "y":0}, + {"label":"K05", "x":5, "y":0}, + {"label":"K06", "x":6, "y":0}, + {"label":"K07", "x":7, "y":0}, + {"label":"K08", "x":8, "y":0}, + {"label":"K09", "x":9, "y":0}, + {"label":"K0A", "x":10, "y":0}, + {"label":"K0B", "x":11, "y":0}, + {"label":"K0C", "x":12, "y":0}, + {"label":"K0D", "x":13, "y":0, "w":2}, + {"label":"K0E", "x":15, "y":0}, + {"label":"K10", "x":0, "y":1, "w":1.5}, + {"label":"K11", "x":1.5, "y":1}, + {"label":"K12", "x":2.5, "y":1}, + {"label":"K13", "x":3.5, "y":1}, + {"label":"K14", "x":4.5, "y":1}, + {"label":"K15", "x":5.5, "y":1}, + {"label":"K16", "x":6.5, "y":1}, + {"label":"K17", "x":7.5, "y":1}, + {"label":"K18", "x":8.5, "y":1}, + {"label":"K19", "x":9.5, "y":1}, + {"label":"K1A", "x":10.5, "y":1}, + {"label":"K1B", "x":11.5, "y":1}, + {"label":"K1C", "x":12.5, "y":1}, + {"label":"K1D", "x":13.5, "y":1, "w":1.5}, + {"label":"K1E", "x":15, "y":1}, + {"label":"K20", "x":0, "y":2, "w":1.75}, + {"label":"K21", "x":1.75, "y":2}, + {"label":"K22", "x":2.75, "y":2}, + {"label":"K23", "x":3.75, "y":2}, + {"label":"K24", "x":4.75, "y":2}, + {"label":"K25", "x":5.75, "y":2}, + {"label":"K26", "x":6.75, "y":2}, + {"label":"K27", "x":7.75, "y":2}, + {"label":"K28", "x":8.75, "y":2}, + {"label":"K29", "x":9.75, "y":2}, + {"label":"K2A", "x":10.75, "y":2}, + {"label":"K2B", "x":11.75, "y":2}, + {"label":"K2D", "x":12.75, "y":2, "w":2.25}, + {"label":"K2E", "x":15, "y":2}, + {"label":"K30", "x":0, "y":3, "w":2.25}, + {"label":"K32", "x":2.25, "y":3}, + {"label":"K33", "x":3.25, "y":3}, + {"label":"K34", "x":4.25, "y":3}, + {"label":"K35", "x":5.25, "y":3}, + {"label":"K36", "x":6.25, "y":3}, + {"label":"K37", "x":7.25, "y":3}, + {"label":"K38", "x":8.25, "y":3}, + {"label":"K39", "x":9.25, "y":3}, + {"label":"K3A", "x":10.25, "y":3}, + {"label":"K3B", "x":11.25, "y":3}, + {"label":"K3C", "x":12.25, "y":3, "w":1.75}, + {"label":"K3D", "x":14, "y":3}, + {"label":"K3E", "x":15, "y":3}, + {"label":"K40", "x":0, "y":4, "w":1.25}, + {"label":"K41", "x":1.25, "y":4, "w":1.25}, + {"label":"K42", "x":2.5, "y":4, "w":1.25}, + {"label":"K43", "x":3.75, "y":4, "w":6.25}, + {"label":"K49", "x":10, "y":4, "w":1.25}, + {"label":"K4A", "x":11.25, "y":4, "w":1.25}, + {"label":"K4C", "x":13, "y":4}, + {"label":"K4D", "x":14, "y":4}, + {"label":"K4E", "x":15, "y":4} + ] + } + } + } + \ No newline at end of file diff --git a/keyboards/doro67/rgb/keymaps/default/config.h b/keyboards/doro67/rgb/keymaps/default/config.h new file mode 100644 index 000000000..26c6d6ade --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// place overrides here diff --git a/keyboards/doro67/rgb/keymaps/default/keymap.c b/keyboards/doro67/rgb/keymaps/default/keymap.c new file mode 100644 index 000000000..d02665ae7 --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/keymap.c @@ -0,0 +1,62 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + [1] = LAYOUT( \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \ + QMKBEST, QMKURL, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/doro67/rgb/keymaps/default/readme.md b/keyboards/doro67/rgb/keymaps/default/readme.md new file mode 100644 index 000000000..4ba5eb30f --- /dev/null +++ b/keyboards/doro67/rgb/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for rgb diff --git a/keyboards/doro67/rgb/readme.md b/keyboards/doro67/rgb/readme.md new file mode 100644 index 000000000..3a527c933 --- /dev/null +++ b/keyboards/doro67/rgb/readme.md @@ -0,0 +1,17 @@ +# Doro67 RGB PCB + +65% custom keyboard made by 80ultraman/Alf/Backprop Studios with in switch RGB featuring the same switch matrix and layout as the regular PCB. + +Flashing the regular PCB firmware on this board will work, but will disable RGB lighting. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Doro 67 RGB PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) + +Make example for this keyboard (after setting up your build environment): + + make doro67/rgb:default + +**RGB Note:** The WS2812 string of LEDs starts from the `K00` key connected to pin `B7` and is connected from left to right, top to bottom, following the physical layout of the board. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c new file mode 100644 index 000000000..6f39e00c6 --- /dev/null +++ b/keyboards/doro67/rgb/rgb.c @@ -0,0 +1,127 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rgb.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + setPinOutput(E6); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + led_set_user(usb_led); +} + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0|(0<<4)}, {15*0, 0}, 0}, // Esc + {{0|(1<<4)}, {15*1, 0}, 0}, // 1 + {{0|(2<<4)}, {15*2, 0}, 0}, // 2 + {{0|(3<<4)}, {15*3, 0}, 0}, // 3 + {{0|(4<<4)}, {15*4, 0}, 0}, // 4 + {{0|(5<<4)}, {15*5, 0}, 0}, // 5 + {{0|(6<<4)}, {15*6, 0}, 0}, // 6 + {{0|(7<<4)}, {15*7, 0}, 0}, // 7 + {{0|(8<<4)}, {15*8, 0}, 0}, // 8 + {{0|(9<<4)}, {15*9, 0}, 0}, // 9 + {{0|(10<<4)}, {15*10, 0}, 0}, // 0 + {{0|(11<<4)}, {15*11, 0}, 0}, // - + {{0|(12<<4)}, {15*12, 0}, 0}, // = + {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace + {{0|(14<<4)}, {15*15, 0}, 1}, // Ins + + {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab + {{1|(1<<4)}, {15*1.5, 16}, 0}, // Q + {{1|(2<<4)}, {15*2.5, 16}, 0}, // W + {{1|(3<<4)}, {15*3.5, 16}, 0}, // E + {{1|(4<<4)}, {15*4.5, 16}, 0}, // R + {{1|(5<<4)}, {15*5.5, 16}, 0}, // T + {{1|(6<<4)}, {15*6.5, 16}, 0}, // Y + {{1|(7<<4)}, {15*7.5, 16}, 0}, // U + {{1|(8<<4)}, {15*8.5, 16}, 0}, // I + {{1|(9<<4)}, {15*9.5, 16}, 0}, // O + {{1|(10<<4)}, {15*10.5, 16}, 0}, // P + {{1|(11<<4)}, {15*11.5, 16}, 0}, // [ + {{1|(12<<4)}, {15*12.5, 16}, 0}, // ] + {{1|(13<<4)}, {15*13.75, 16}, 1}, // + {{1|(14<<4)}, {15*15, 16}, 1}, // Del + + {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock + {{2|(1<<4)}, {15*1.75, 32}, 0}, // A + {{2|(2<<4)}, {15*2.75, 32}, 0}, // S + {{2|(3<<4)}, {15*3.75, 32}, 0}, // D + {{2|(4<<4)}, {15*4.75, 32}, 0}, // F + {{2|(5<<4)}, {15*5.75, 32}, 0}, // G + {{2|(6<<4)}, {15*6.75, 32}, 0}, // H + {{2|(7<<4)}, {15*7.75, 32}, 0}, // J + {{2|(8<<4)}, {15*8.75, 32}, 0}, // K + {{2|(9<<4)}, {15*9.75, 32}, 0}, // L + {{2|(10<<4)}, {15*10.75, 32}, 0}, // ; + {{2|(11<<4)}, {15*11.75, 32}, 0}, // ' + {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter + {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup + + {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift + {{3|(2<<4)}, {15*2, 48}, 0}, // Z + {{3|(3<<4)}, {15*3, 48}, 0}, // X + {{3|(4<<4)}, {15*4, 48}, 0}, // C + {{3|(5<<4)}, {15*5, 48}, 0}, // V + {{3|(6<<4)}, {15*6, 48}, 0}, // B + {{3|(7<<4)}, {15*7, 48}, 0}, // N + {{3|(8<<4)}, {15*8, 48}, 0}, // M + {{3|(9<<4)}, {15*9, 48}, 0}, // , + {{3|(10<<4)}, {15*10, 48}, 0}, // . + {{3|(11<<4)}, {15*11, 48}, 0}, // / + {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift + {{3|(13<<4)}, {15*14, 48}, 1}, // Up + {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn + + {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl + {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI + {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt + {{4|(3<<4)}, {15*6.75, 64}, 0}, // Space + {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt + {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN + {{4|(12<<4)}, {15*13, 64}, 1}, // Left + {{4|(13<<4)}, {15*14, 64}, 1}, // Down + {{4|(14<<4)}, {15*15, 64}, 1}, // Right +}; diff --git a/keyboards/doro67/rgb/rgb.h b/keyboards/doro67/rgb/rgb.h new file mode 100644 index 000000000..aafba11d0 --- /dev/null +++ b/keyboards/doro67/rgb/rgb.h @@ -0,0 +1,41 @@ +/* Copyright 2019 MechMerlin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2E, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \ + k40, k41, k42, k43, k49, k4A, k4C, k4D, k4E \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, k2E }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \ + { k40, k41, k42, k43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4A, KC_NO, k4C, k4D, k4E }, \ +} diff --git a/keyboards/doro67/rgb/rules.mk b/keyboards/doro67/rgb/rules.mk new file mode 100644 index 000000000..6438868dc --- /dev/null +++ b/keyboards/doro67/rgb/rules.mk @@ -0,0 +1,83 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +RGB_MATRIX_ENABLE = WS2812 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) -- cgit v1.2.3-70-g09d2 From a7113c8ed090d0ac647f30ee9b8ef41252e568ed Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 30 Apr 2019 00:18:50 +0200 Subject: Updated rgb_led struct field modifier to flags (#5619) Updated effects to test led flags Updated massdrop to use new flags field for led toggle --- docs/feature_rgb_matrix.md | 20 +- keyboards/boston_meetup/2019/2019.c | 14 +- keyboards/crkbd/rev1/rev1.c | 88 ++--- keyboards/doro67/rgb/rgb.c | 100 +++--- keyboards/dztech/dz40rgb/dz40rgb.c | 84 ++--- keyboards/dztech/dz40rgb/keymaps/default/keymap.c | 6 +- .../dztech/dz40rgb/keymaps/split_space/keymap.c | 6 +- keyboards/dztech/dz60rgb/dz60rgb.c | 361 +++++++++++---------- keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c | 6 +- keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c | 6 +- keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c | 6 +- keyboards/dztech/dz60rgb/keymaps/iso/keymap.c | 6 +- keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c | 8 +- keyboards/ergodox_ez/ergodox_ez.c | 96 +++--- keyboards/exclusive/e6_rgb/e6_rgb.c | 100 +++--- keyboards/hadron/ver3/ver3.c | 22 +- keyboards/hs60/v1/v1.c | 206 ++++++------ keyboards/massdrop/alt/config.h | 1 - keyboards/massdrop/alt/config_led.c | 210 ++++++------ keyboards/massdrop/alt/keymaps/abishalom/keymap.c | 26 ++ keyboards/massdrop/alt/keymaps/default/keymap.c | 26 ++ keyboards/massdrop/alt/keymaps/mac/keymap.c | 26 ++ keyboards/massdrop/ctrl/config.h | 1 - keyboards/massdrop/ctrl/config_led.c | 236 +++++++------- keyboards/massdrop/ctrl/keymaps/default/keymap.c | 26 ++ keyboards/massdrop/ctrl/keymaps/mac/keymap.c | 26 ++ keyboards/model01/leds.c | 110 +++---- keyboards/planck/ez/ez.c | 66 ++-- keyboards/planck/keymaps/tom/keymap.c | 4 +- keyboards/planck/light/light.c | 70 ++-- keyboards/sol/rev1/rev1.c | 82 ++--- layouts/community/ergodox/drashna/keymap.c | 6 +- layouts/community/ortho_4x12/drashna/keymap.c | 6 +- quantum/rgb_matrix.c | 45 ++- quantum/rgb_matrix.h | 6 +- quantum/rgb_matrix_animations/alpha_mods_anim.h | 5 +- quantum/rgb_matrix_animations/breathing_anim.h | 1 + quantum/rgb_matrix_animations/cycle_all_anim.h | 6 +- .../rgb_matrix_animations/cycle_left_right_anim.h | 3 +- quantum/rgb_matrix_animations/cycle_up_down_anim.h | 3 +- quantum/rgb_matrix_animations/dual_beacon_anim.h | 3 +- .../rgb_matrix_animations/gradient_up_down_anim.h | 3 +- .../jellybean_raindrops_anim.h | 9 +- .../rgb_matrix_animations/rainbow_beacon_anim.h | 3 +- .../rainbow_moving_chevron_anim.h | 3 +- .../rgb_matrix_animations/rainbow_pinwheels_anim.h | 3 +- quantum/rgb_matrix_animations/raindrops_anim.h | 7 +- quantum/rgb_matrix_animations/solid_color_anim.h | 1 + .../rgb_matrix_animations/solid_reactive_anim.h | 1 + .../rgb_matrix_animations/solid_reactive_cross.h | 3 +- .../rgb_matrix_animations/solid_reactive_nexus.h | 3 +- .../solid_reactive_simple_anim.h | 1 + .../rgb_matrix_animations/solid_reactive_wide.h | 3 +- quantum/rgb_matrix_animations/solid_splash_anim.h | 3 +- quantum/rgb_matrix_animations/splash_anim.h | 3 +- quantum/rgb_matrix_types.h | 22 +- tmk_core/protocol/arm_atsam/led_matrix.c | 4 +- 57 files changed, 1173 insertions(+), 1028 deletions(-) (limited to 'keyboards/doro67/rgb') diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 4ce9d15f0..91ec77ace 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -127,13 +127,13 @@ Configure the hardware via your `config.h`: From this point forward the configuration is the same for all the drivers. The struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example: ```C -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 1}, + {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, .... } ``` @@ -147,7 +147,19 @@ y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. -`modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects). +`flags` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. + +## Flags + +|Define |Description | +|------------------------------------|-------------------------------------------| +|`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.| +|`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.| +|`#define LED_FLAG_NONE 0x00` |If thes LED has no flags. | +|`#define LED_FLAG_ALL 0xFF` |If thes LED has all flags. | +|`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. | +|`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. | +|`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. | ## Keycodes diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c index 9baed223b..45c185549 100644 --- a/keyboards/boston_meetup/2019/2019.c +++ b/keyboards/boston_meetup/2019/2019.c @@ -21,17 +21,17 @@ #ifdef RGB_MATRIX_ENABLE #include "rgblight.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} | | modifier | | | */ - {{1|(3<<4)}, {188, 16}, 0}, - {{3|(3<<4)}, {187, 48}, 0}, - {{4|(2<<4)}, {149, 64}, 0}, - {{4|(1<<4)}, {112, 64}, 0}, - {{3|(0<<4)}, {37, 48}, 0}, - {{1|(0<<4)}, {38, 16}, 0} + {{1|(3<<4)}, {188, 16}, 4}, + {{3|(3<<4)}, {187, 48}, 4}, + {{4|(2<<4)}, {149, 64}, 4}, + {{4|(1<<4)}, {112, 64}, 4}, + {{3|(0<<4)}, {37, 48}, 4}, + {{1|(0<<4)}, {38, 16}, 4} }; #endif diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c index 0104adf15..2345028d2 100644 --- a/keyboards/crkbd/rev1/rev1.c +++ b/keyboards/crkbd/rev1/rev1.c @@ -56,70 +56,70 @@ void led_set_kb(uint8_t usb_led) { * | | | modifier * | | | */ #define RGB_MATRIX_LEFT_LEDS \ - { { 0xFF }, { 85, 16 }, 0 }, /* 1 */ \ - { { 0xFF }, { 50, 13 }, 0 }, /* 2 */ \ - { { 0xFF }, { 16, 20 }, 0 }, /* 3 */ \ - { { 0xFF }, { 16, 38 }, 0 }, /* 4 */ \ - { { 0xFF }, { 50, 48 }, 0 }, /* 5 */ \ - { { 0xFF }, { 85, 52 }, 0 }, /* 6 */ \ + { { 0xFF }, { 85, 16 }, 2 }, /* 1 */ \ + { { 0xFF }, { 50, 13 }, 2 }, /* 2 */ \ + { { 0xFF }, { 16, 20 }, 2 }, /* 3 */ \ + { { 0xFF }, { 16, 38 }, 2 }, /* 4 */ \ + { { 0xFF }, { 50, 48 }, 2 }, /* 5 */ \ + { { 0xFF }, { 85, 52 }, 2 }, /* 6 */ \ { { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, /* 7 */ \ - { { 2 | ( 5 << 4 ) }, { 85, 39 }, 0 }, /* 8 */ \ - { { 1 | ( 5 << 4 ) }, { 85, 21 }, 0 }, /* 9 */ \ - { { 0 | ( 5 << 4 ) }, { 85, 4 }, 0 }, /* 10 */ \ - { { 0 | ( 4 << 4 ) }, { 68, 02 }, 0 }, /* 11 */ \ - { { 1 | ( 4 << 4 ) }, { 68, 19 }, 0 }, /* 12 */ \ - { { 2 | ( 4 << 4 ) }, { 68, 37 }, 0 }, /* 13 */ \ + { { 2 | ( 5 << 4 ) }, { 85, 39 }, 4 }, /* 8 */ \ + { { 1 | ( 5 << 4 ) }, { 85, 21 }, 4 }, /* 9 */ \ + { { 0 | ( 5 << 4 ) }, { 85, 4 }, 4 }, /* 10 */ \ + { { 0 | ( 4 << 4 ) }, { 68, 02 }, 4 }, /* 11 */ \ + { { 1 | ( 4 << 4 ) }, { 68, 19 }, 4 }, /* 12 */ \ + { { 2 | ( 4 << 4 ) }, { 68, 37 }, 4 }, /* 13 */ \ { { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, /* 14 */ \ { { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, /* 15 */ \ - { { 2 | ( 3 << 4 ) }, { 50, 35 }, 0 }, /* 16 */ \ - { { 1 | ( 3 << 4 ) }, { 50, 13 }, 0 }, /* 17 */ \ - { { 0 | ( 3 << 4 ) }, { 50, 0 }, 0 }, /* 18 */ \ - { { 0 | ( 2 << 4 ) }, { 33, 3 }, 0 }, /* 19 */ \ - { { 1 | ( 2 << 4 ) }, { 33, 20 }, 0 }, /* 20 */ \ - { { 2 | ( 2 << 4 ) }, { 33, 37 }, 0 }, /* 21 */ \ - { { 2 | ( 1 << 4 ) }, { 16, 42 }, 0 }, /* 22 */ \ - { { 1 | ( 1 << 4 ) }, { 16, 24 }, 0 }, /* 23 */ \ - { { 0 | ( 1 << 4 ) }, { 16, 7 }, 0 }, /* 24 */ \ + { { 2 | ( 3 << 4 ) }, { 50, 35 }, 4 }, /* 16 */ \ + { { 1 | ( 3 << 4 ) }, { 50, 13 }, 4 }, /* 17 */ \ + { { 0 | ( 3 << 4 ) }, { 50, 0 }, 4 }, /* 18 */ \ + { { 0 | ( 2 << 4 ) }, { 33, 3 }, 4 }, /* 19 */ \ + { { 1 | ( 2 << 4 ) }, { 33, 20 }, 4 }, /* 20 */ \ + { { 2 | ( 2 << 4 ) }, { 33, 37 }, 4 }, /* 21 */ \ + { { 2 | ( 1 << 4 ) }, { 16, 42 }, 4 }, /* 22 */ \ + { { 1 | ( 1 << 4 ) }, { 16, 24 }, 4 }, /* 23 */ \ + { { 0 | ( 1 << 4 ) }, { 16, 7 }, 4 }, /* 24 */ \ { { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, /* 25 */ \ { { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, /* 26 */ \ { { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, /* 27 */ #define RGB_MATRIX_RIGHT_LEDS \ - { { 0xFF }, { 139, 16 }, 0 }, /* 1 */ \ - { { 0xFF }, { 174, 13 }, 0 }, /* 2 */ \ - { { 0xFF }, { 208, 20 }, 0 }, /* 3 */ \ - { { 0xFF }, { 208, 38 }, 0 }, /* 4 */ \ - { { 0xFF }, { 174, 48 }, 0 }, /* 5 */ \ - { { 0xFF }, { 139, 52 }, 0 }, /* 6 */ \ + { { 0xFF }, { 139, 16 }, 2 }, /* 1 */ \ + { { 0xFF }, { 174, 13 }, 2 }, /* 2 */ \ + { { 0xFF }, { 208, 20 }, 2 }, /* 3 */ \ + { { 0xFF }, { 208, 38 }, 2 }, /* 4 */ \ + { { 0xFF }, { 174, 48 }, 2 }, /* 5 */ \ + { { 0xFF }, { 139, 52 }, 2 }, /* 6 */ \ { { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, /* 7 */ \ - { { 6 | ( 5 << 4 ) }, { 139, 39 }, 0 }, /* 8 */ \ - { { 5 | ( 5 << 4 ) }, { 139, 21 }, 0 }, /* 9 */ \ - { { 4 | ( 5 << 4 ) }, { 139, 4 }, 0 }, /* 10 */ \ - { { 4 | ( 4 << 4 ) }, { 156, 02 }, 0 }, /* 11 */ \ - { { 5 | ( 4 << 4 ) }, { 156, 19 }, 0 }, /* 12 */ \ - { { 6 | ( 4 << 4 ) }, { 156, 37 }, 0 }, /* 13 */ \ + { { 6 | ( 5 << 4 ) }, { 139, 39 }, 4 }, /* 8 */ \ + { { 5 | ( 5 << 4 ) }, { 139, 21 }, 4 }, /* 9 */ \ + { { 4 | ( 5 << 4 ) }, { 139, 4 }, 4 }, /* 10 */ \ + { { 4 | ( 4 << 4 ) }, { 156, 02 }, 4 }, /* 11 */ \ + { { 5 | ( 4 << 4 ) }, { 156, 19 }, 4 }, /* 12 */ \ + { { 6 | ( 4 << 4 ) }, { 156, 37 }, 4 }, /* 13 */ \ { { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, /* 14 */ \ { { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, /* 15 */ \ - { { 6 | ( 3 << 4 ) }, { 174, 35 }, 0 }, /* 16 */ \ - { { 5 | ( 3 << 4 ) }, { 174, 13 }, 0 }, /* 17 */ \ - { { 4 | ( 3 << 4 ) }, { 174, 0 }, 0 }, /* 18 */ \ - { { 4 | ( 2 << 4 ) }, { 191, 3 }, 0 }, /* 19 */ \ - { { 5 | ( 2 << 4 ) }, { 191, 20 }, 0 }, /* 20 */ \ - { { 6 | ( 2 << 4 ) }, { 191, 37 }, 0 }, /* 21 */ \ - { { 6 | ( 1 << 4 ) }, { 208, 42 }, 0 }, /* 22 */ \ - { { 5 | ( 1 << 4 ) }, { 208, 24 }, 0 }, /* 23 */ \ - { { 4 | ( 1 << 4 ) }, { 208, 7 }, 0 }, /* 24 */ \ + { { 6 | ( 3 << 4 ) }, { 174, 35 }, 4 }, /* 16 */ \ + { { 5 | ( 3 << 4 ) }, { 174, 13 }, 4 }, /* 17 */ \ + { { 4 | ( 3 << 4 ) }, { 174, 0 }, 4 }, /* 18 */ \ + { { 4 | ( 2 << 4 ) }, { 191, 3 }, 4 }, /* 19 */ \ + { { 5 | ( 2 << 4 ) }, { 191, 20 }, 4 }, /* 20 */ \ + { { 6 | ( 2 << 4 ) }, { 191, 37 }, 4 }, /* 21 */ \ + { { 6 | ( 1 << 4 ) }, { 208, 42 }, 4 }, /* 22 */ \ + { { 5 | ( 1 << 4 ) }, { 208, 24 }, 4 }, /* 23 */ \ + { { 4 | ( 1 << 4 ) }, { 208, 7 }, 4 }, /* 24 */ \ { { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, /* 25 */ \ { { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, /* 26 */ \ { { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, /* 27 */ #ifdef RGB_MATRIX_SPLIT_RIGHT -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { RGB_MATRIX_RIGHT_LEDS RGB_MATRIX_LEFT_LEDS }; #else -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { RGB_MATRIX_LEFT_LEDS RGB_MATRIX_RIGHT_LEDS }; diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c index 6f39e00c6..8aaf6ef4a 100644 --- a/keyboards/doro67/rgb/rgb.c +++ b/keyboards/doro67/rgb/rgb.c @@ -52,73 +52,73 @@ void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(0<<4)}, {15*0, 0}, 0}, // Esc - {{0|(1<<4)}, {15*1, 0}, 0}, // 1 - {{0|(2<<4)}, {15*2, 0}, 0}, // 2 - {{0|(3<<4)}, {15*3, 0}, 0}, // 3 - {{0|(4<<4)}, {15*4, 0}, 0}, // 4 - {{0|(5<<4)}, {15*5, 0}, 0}, // 5 - {{0|(6<<4)}, {15*6, 0}, 0}, // 6 - {{0|(7<<4)}, {15*7, 0}, 0}, // 7 - {{0|(8<<4)}, {15*8, 0}, 0}, // 8 - {{0|(9<<4)}, {15*9, 0}, 0}, // 9 - {{0|(10<<4)}, {15*10, 0}, 0}, // 0 - {{0|(11<<4)}, {15*11, 0}, 0}, // - - {{0|(12<<4)}, {15*12, 0}, 0}, // = +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0|(0<<4)}, {15*0, 0}, 4}, // Esc + {{0|(1<<4)}, {15*1, 0}, 4}, // 1 + {{0|(2<<4)}, {15*2, 0}, 4}, // 2 + {{0|(3<<4)}, {15*3, 0}, 4}, // 3 + {{0|(4<<4)}, {15*4, 0}, 4}, // 4 + {{0|(5<<4)}, {15*5, 0}, 4}, // 5 + {{0|(6<<4)}, {15*6, 0}, 4}, // 6 + {{0|(7<<4)}, {15*7, 0}, 4}, // 7 + {{0|(8<<4)}, {15*8, 0}, 4}, // 8 + {{0|(9<<4)}, {15*9, 0}, 4}, // 9 + {{0|(10<<4)}, {15*10, 0}, 4}, // 0 + {{0|(11<<4)}, {15*11, 0}, 4}, // - + {{0|(12<<4)}, {15*12, 0}, 4}, // = {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace {{0|(14<<4)}, {15*15, 0}, 1}, // Ins {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab - {{1|(1<<4)}, {15*1.5, 16}, 0}, // Q - {{1|(2<<4)}, {15*2.5, 16}, 0}, // W - {{1|(3<<4)}, {15*3.5, 16}, 0}, // E - {{1|(4<<4)}, {15*4.5, 16}, 0}, // R - {{1|(5<<4)}, {15*5.5, 16}, 0}, // T - {{1|(6<<4)}, {15*6.5, 16}, 0}, // Y - {{1|(7<<4)}, {15*7.5, 16}, 0}, // U - {{1|(8<<4)}, {15*8.5, 16}, 0}, // I - {{1|(9<<4)}, {15*9.5, 16}, 0}, // O - {{1|(10<<4)}, {15*10.5, 16}, 0}, // P - {{1|(11<<4)}, {15*11.5, 16}, 0}, // [ - {{1|(12<<4)}, {15*12.5, 16}, 0}, // ] - {{1|(13<<4)}, {15*13.75, 16}, 1}, // + {{1|(1<<4)}, {15*1.5, 16}, 4}, // Q + {{1|(2<<4)}, {15*2.5, 16}, 4}, // W + {{1|(3<<4)}, {15*3.5, 16}, 4}, // E + {{1|(4<<4)}, {15*4.5, 16}, 4}, // R + {{1|(5<<4)}, {15*5.5, 16}, 4}, // T + {{1|(6<<4)}, {15*6.5, 16}, 4}, // Y + {{1|(7<<4)}, {15*7.5, 16}, 4}, // U + {{1|(8<<4)}, {15*8.5, 16}, 4}, // I + {{1|(9<<4)}, {15*9.5, 16}, 4}, // O + {{1|(10<<4)}, {15*10.5, 16}, 4}, // P + {{1|(11<<4)}, {15*11.5, 16}, 4}, // [ + {{1|(12<<4)}, {15*12.5, 16}, 4}, // ] + {{1|(13<<4)}, {15*13.75, 16}, 1}, // {{1|(14<<4)}, {15*15, 16}, 1}, // Del {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock - {{2|(1<<4)}, {15*1.75, 32}, 0}, // A - {{2|(2<<4)}, {15*2.75, 32}, 0}, // S - {{2|(3<<4)}, {15*3.75, 32}, 0}, // D - {{2|(4<<4)}, {15*4.75, 32}, 0}, // F - {{2|(5<<4)}, {15*5.75, 32}, 0}, // G - {{2|(6<<4)}, {15*6.75, 32}, 0}, // H - {{2|(7<<4)}, {15*7.75, 32}, 0}, // J - {{2|(8<<4)}, {15*8.75, 32}, 0}, // K - {{2|(9<<4)}, {15*9.75, 32}, 0}, // L - {{2|(10<<4)}, {15*10.75, 32}, 0}, // ; - {{2|(11<<4)}, {15*11.75, 32}, 0}, // ' + {{2|(1<<4)}, {15*1.75, 32}, 4}, // A + {{2|(2<<4)}, {15*2.75, 32}, 4}, // S + {{2|(3<<4)}, {15*3.75, 32}, 4}, // D + {{2|(4<<4)}, {15*4.75, 32}, 4}, // F + {{2|(5<<4)}, {15*5.75, 32}, 4}, // G + {{2|(6<<4)}, {15*6.75, 32}, 4}, // H + {{2|(7<<4)}, {15*7.75, 32}, 4}, // J + {{2|(8<<4)}, {15*8.75, 32}, 4}, // K + {{2|(9<<4)}, {15*9.75, 32}, 4}, // L + {{2|(10<<4)}, {15*10.75, 32}, 4}, // ; + {{2|(11<<4)}, {15*11.75, 32}, 4}, // ' {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift - {{3|(2<<4)}, {15*2, 48}, 0}, // Z - {{3|(3<<4)}, {15*3, 48}, 0}, // X - {{3|(4<<4)}, {15*4, 48}, 0}, // C - {{3|(5<<4)}, {15*5, 48}, 0}, // V - {{3|(6<<4)}, {15*6, 48}, 0}, // B - {{3|(7<<4)}, {15*7, 48}, 0}, // N - {{3|(8<<4)}, {15*8, 48}, 0}, // M - {{3|(9<<4)}, {15*9, 48}, 0}, // , - {{3|(10<<4)}, {15*10, 48}, 0}, // . - {{3|(11<<4)}, {15*11, 48}, 0}, // / + {{3|(2<<4)}, {15*2, 48}, 4}, // Z + {{3|(3<<4)}, {15*3, 48}, 4}, // X + {{3|(4<<4)}, {15*4, 48}, 4}, // C + {{3|(5<<4)}, {15*5, 48}, 4}, // V + {{3|(6<<4)}, {15*6, 48}, 4}, // B + {{3|(7<<4)}, {15*7, 48}, 4}, // N + {{3|(8<<4)}, {15*8, 48}, 4}, // M + {{3|(9<<4)}, {15*9, 48}, 4}, // , + {{3|(10<<4)}, {15*10, 48}, 4}, // . + {{3|(11<<4)}, {15*11, 48}, 4}, // / {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift {{3|(13<<4)}, {15*14, 48}, 1}, // Up {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn - + {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt - {{4|(3<<4)}, {15*6.75, 64}, 0}, // Space + {{4|(3<<4)}, {15*6.75, 64}, 4}, // Space {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN {{4|(12<<4)}, {15*13, 64}, 1}, // Left diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c index b1a03760f..34bfc4366 100644 --- a/keyboards/dztech/dz40rgb/dz40rgb.c +++ b/keyboards/dztech/dz40rgb/dz40rgb.c @@ -71,7 +71,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(11<<4)}, {20.36*11, 0}, 1}, {{0|(10<<4)}, {20.36*10, 0}, 1}, @@ -90,32 +90,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33}, 0}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 0}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 0}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 0}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 0}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 0}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 0}, + {{1|(10<<4)}, {20.36*10, 21.33}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33}, 4}, + {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, + {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, + {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, + {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, + {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, + {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0}, + {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, + {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, + {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, + {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, + {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, + {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, @@ -205,7 +205,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(11<<4)}, {20.36*11, 0}, 1}, {{0|(10<<4)}, {20.36*10, 0}, 1}, @@ -224,32 +224,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33}, 0}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 0}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 0}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 0}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 0}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 0}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 0}, + {{1|(10<<4)}, {20.36*10, 21.33}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33}, 4}, + {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, + {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, + {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, + {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, + {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, + {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0}, + {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, + {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, + {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, + {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, + {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, + {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c index 6ea7421c9..59b917121 100644 --- a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c @@ -35,10 +35,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c index bbbe5a8f0..5613e3500 100644 --- a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c @@ -58,10 +58,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/dz60rgb.c b/keyboards/dztech/dz60rgb/dz60rgb.c index a6825e750..10b2ea7a8 100644 --- a/keyboards/dztech/dz60rgb/dz60rgb.c +++ b/keyboards/dztech/dz60rgb/dz60rgb.c @@ -64,7 +64,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {16*13.5, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, {{0|(11<<4)}, {16*11, 0}, 1}, @@ -80,49 +81,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.875, 64}, 1}, {{4|(11<<4)}, {16*12.625, 64}, 1}, {{4|(10<<4)}, {16*11.375, 64}, 1}, {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 0}, + {{4|(5<<4)}, { 16*6.375, 64}, 4}, {{4|(2<<4)}, { 16*2.625, 64}, 1}, {{4|(1<<4)}, { 16*1.375, 64}, 1}, {{4|(0<<4)}, { 16*0.125, 64}, 1}, @@ -192,7 +193,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(12<<4)}, {16*14, 0}, 1}, {{0|(13<<4)}, {16*13, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, @@ -209,49 +211,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{2|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 0}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(11<<4)}, {16*12.625, 48}, 4}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.625, 64}, 1}, {{4|(11<<4)}, {16*12.375, 64}, 1}, {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 0}, + {{4|(5<<4)}, { 16*7, 64}, 4}, {{4|(2<<4)}, { 16*2.875, 64}, 1}, {{4|(1<<4)}, { 16*1.625, 64}, 1}, {{4|(0<<4)}, { 16*0.375, 64}, 1}, @@ -321,7 +323,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{2|(12<<4)}, {16*14, 0}, 1}, {{0|(13<<4)}, {16*13, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, @@ -338,49 +341,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 0}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(11<<4)}, {16*12.625, 48}, 4}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.625, 64}, 1}, {{4|(11<<4)}, {16*12.375, 64}, 1}, {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 0}, + {{4|(5<<4)}, { 16*7, 64}, 4}, {{4|(2<<4)}, { 16*2.875, 64}, 1}, {{4|(1<<4)}, { 16*1.625, 64}, 1}, {{4|(0<<4)}, { 16*0.375, 64}, 1}, @@ -449,7 +452,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {16*13.5, 0}, 1}, {{0|(12<<4)}, {16*12, 0}, 1}, {{0|(11<<4)}, {16*11, 0}, 1}, @@ -465,49 +469,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, {16*1, 0}, 1}, {{0|(0<<4)}, {16*0, 0}, 1}, {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 0}, - {{1|(11<<4)}, {16*11.5, 16}, 0}, - {{1|(10<<4)}, {16*10.5, 16}, 0}, - {{1|(9<<4)}, { 16*9.5, 16}, 0}, - {{1|(8<<4)}, { 16*8.5, 16}, 0}, - {{1|(7<<4)}, { 16*7.5, 16}, 0}, - {{1|(6<<4)}, { 16*6.5, 16}, 0}, - {{1|(5<<4)}, { 16*5.5, 16}, 0}, - {{1|(4<<4)}, { 16*4.5, 16}, 0}, - {{1|(3<<4)}, { 16*3.5, 16}, 0}, - {{1|(2<<4)}, { 16*2.5, 16}, 0}, - {{1|(1<<4)}, { 16*1.5, 16}, 0}, + {{1|(12<<4)}, {16*12.5, 16}, 4}, + {{1|(11<<4)}, {16*11.5, 16}, 4}, + {{1|(10<<4)}, {16*10.5, 16}, 4}, + {{1|(9<<4)}, { 16*9.5, 16}, 4}, + {{1|(8<<4)}, { 16*8.5, 16}, 4}, + {{1|(7<<4)}, { 16*7.5, 16}, 4}, + {{1|(6<<4)}, { 16*6.5, 16}, 4}, + {{1|(5<<4)}, { 16*5.5, 16}, 4}, + {{1|(4<<4)}, { 16*4.5, 16}, 4}, + {{1|(3<<4)}, { 16*3.5, 16}, 4}, + {{1|(2<<4)}, { 16*2.5, 16}, 4}, + {{1|(1<<4)}, { 16*1.5, 16}, 4}, {{1|(0<<4)}, { 16*0.25, 16}, 1}, {{2|(13<<4)}, {16*13.375, 24}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 0}, - {{2|(10<<4)}, {16*10.75, 32}, 0}, - {{2|(9<<4)}, {16*9.75, 32}, 0}, - {{2|(8<<4)}, {16*8.75, 32}, 0}, - {{2|(7<<4)}, {16*7.75, 32}, 0}, - {{2|(6<<4)}, { 16*6.75, 32}, 0}, - {{2|(5<<4)}, { 16*5.75, 32}, 0}, - {{2|(4<<4)}, { 16*4.75, 32}, 0}, - {{2|(3<<4)}, { 16*3.75, 32}, 0}, - {{2|(2<<4)}, { 16*2.75, 32}, 0}, - {{2|(1<<4)}, { 16*1.75, 32}, 0}, + {{2|(11<<4)}, {16*11.75, 32}, 4}, + {{2|(10<<4)}, {16*10.75, 32}, 4}, + {{2|(9<<4)}, {16*9.75, 32}, 4}, + {{2|(8<<4)}, {16*8.75, 32}, 4}, + {{2|(7<<4)}, {16*7.75, 32}, 4}, + {{2|(6<<4)}, { 16*6.75, 32}, 4}, + {{2|(5<<4)}, { 16*5.75, 32}, 4}, + {{2|(4<<4)}, { 16*4.75, 32}, 4}, + {{2|(3<<4)}, { 16*3.75, 32}, 4}, + {{2|(2<<4)}, { 16*2.75, 32}, 4}, + {{2|(1<<4)}, { 16*1.75, 32}, 4}, {{2|(0<<4)}, { 16*0.375, 32}, 1}, {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 0}, - {{3|(9<<4)}, {16*10.25, 48}, 0}, - {{3|(8<<4)}, {16*9.25, 48}, 0}, - {{3|(7<<4)}, {16*8.25, 48}, 0}, - {{3|(6<<4)}, {16*7.25, 48}, 0}, - {{3|(5<<4)}, {16*6.25, 48}, 0}, - {{3|(4<<4)}, {16*5.25, 48}, 0}, - {{3|(3<<4)}, {16*4.25, 48}, 0}, - {{3|(2<<4)}, {16*3.25, 48}, 0}, - {{3|(1<<4)}, {16*1.25, 48}, 0}, + {{3|(10<<4)}, {16*11.25, 48}, 4}, + {{3|(9<<4)}, {16*10.25, 48}, 4}, + {{3|(8<<4)}, {16*9.25, 48}, 4}, + {{3|(7<<4)}, {16*8.25, 48}, 4}, + {{3|(6<<4)}, {16*7.25, 48}, 4}, + {{3|(5<<4)}, {16*6.25, 48}, 4}, + {{3|(4<<4)}, {16*5.25, 48}, 4}, + {{3|(3<<4)}, {16*4.25, 48}, 4}, + {{3|(2<<4)}, {16*3.25, 48}, 4}, + {{3|(1<<4)}, {16*1.25, 48}, 4}, {{3|(0<<4)}, {16*0.625, 48}, 1}, {{4|(13<<4)}, {16*13.875, 64}, 1}, {{4|(11<<4)}, {16*12.625, 64}, 1}, {{4|(10<<4)}, {16*11.375, 64}, 1}, {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 0}, + {{4|(5<<4)}, { 16*6.375, 64}, 4}, {{4|(2<<4)}, { 16*2.625, 64}, 1}, {{4|(1<<4)}, { 16*1.375, 64}, 1}, {{4|(0<<4)}, { 16*0.125, 64}, 1}, @@ -578,7 +582,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_16, G_16, I_16}, {0, K_16, J_16, L_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {17.23*13, 0}, 1}, {{0|(12<<4)}, {17.23*12, 0}, 1}, {{0|(11<<4)}, {17.23*11, 0}, 1}, @@ -594,51 +599,51 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(1<<4)}, { 17.23*1, 0}, 1}, {{0|(0<<4)}, { 17.23*0, 0}, 1}, {{1|(13<<4)}, {17.23*13, 16}, 1}, - {{1|(12<<4)}, {17.23*12, 16}, 0}, - {{1|(11<<4)}, {17.23*11, 16}, 0}, - {{1|(10<<4)}, {17.23*10, 16}, 0}, - {{1|(9<<4)}, {17.23*9, 16}, 0}, - {{1|(8<<4)}, {17.23*8, 16}, 0}, - {{1|(7<<4)}, {17.23*7, 16}, 0}, - {{1|(6<<4)}, { 17.23*6, 16}, 0}, - {{1|(5<<4)}, { 17.23*5, 16}, 0}, - {{1|(4<<4)}, { 17.23*4, 16}, 0}, - {{1|(3<<4)}, { 17.23*3, 16}, 0}, - {{1|(2<<4)}, { 17.23*2, 16}, 0}, - {{1|(1<<4)}, { 17.23*1, 16}, 0}, + {{1|(12<<4)}, {17.23*12, 16}, 4}, + {{1|(11<<4)}, {17.23*11, 16}, 4}, + {{1|(10<<4)}, {17.23*10, 16}, 4}, + {{1|(9<<4)}, {17.23*9, 16}, 4}, + {{1|(8<<4)}, {17.23*8, 16}, 4}, + {{1|(7<<4)}, {17.23*7, 16}, 4}, + {{1|(6<<4)}, { 17.23*6, 16}, 4}, + {{1|(5<<4)}, { 17.23*5, 16}, 4}, + {{1|(4<<4)}, { 17.23*4, 16}, 4}, + {{1|(3<<4)}, { 17.23*3, 16}, 4}, + {{1|(2<<4)}, { 17.23*2, 16}, 4}, + {{1|(1<<4)}, { 17.23*1, 16}, 4}, {{1|(0<<4)}, { 17.23*0, 16}, 1}, {{2|(13<<4)}, {17.23*13, 32}, 1}, - {{2|(11<<4)}, {17.23*11, 32}, 0}, - {{2|(10<<4)}, {17.23*10, 32}, 0}, - {{2|(9<<4)}, {17.23*9, 32}, 0}, - {{2|(8<<4)}, {17.23*8, 32}, 0}, - {{2|(7<<4)}, {17.23*7, 32}, 0}, - {{2|(6<<4)}, { 17.23*6, 32}, 0}, - {{2|(5<<4)}, { 17.23*5, 32}, 0}, - {{2|(4<<4)}, { 17.23*4, 32}, 0}, - {{2|(3<<4)}, { 17.23*3, 32}, 0}, - {{2|(2<<4)}, { 17.23*2, 32}, 0}, - {{2|(1<<4)}, { 17.23*1, 32}, 0}, + {{2|(11<<4)}, {17.23*11, 32}, 4}, + {{2|(10<<4)}, {17.23*10, 32}, 4}, + {{2|(9<<4)}, {17.23*9, 32}, 4}, + {{2|(8<<4)}, {17.23*8, 32}, 4}, + {{2|(7<<4)}, {17.23*7, 32}, 4}, + {{2|(6<<4)}, { 17.23*6, 32}, 4}, + {{2|(5<<4)}, { 17.23*5, 32}, 4}, + {{2|(4<<4)}, { 17.23*4, 32}, 4}, + {{2|(3<<4)}, { 17.23*3, 32}, 4}, + {{2|(2<<4)}, { 17.23*2, 32}, 4}, + {{2|(1<<4)}, { 17.23*1, 32}, 4}, {{2|(0<<4)}, { 17.23*0, 32}, 1}, {{3|(13<<4)}, {17.23*13, 48}, 1}, - {{3|(11<<4)}, {17.23*11, 48}, 0}, - {{3|(10<<4)}, {17.23*10, 48}, 0}, - {{3|(9<<4)}, {17.23*9, 48}, 0}, - {{3|(8<<4)}, {17.23*8, 48}, 0}, - {{3|(7<<4)}, {17.23*7, 48}, 0}, - {{3|(6<<4)}, { 17.23*6, 48}, 0}, - {{3|(5<<4)}, { 17.23*5, 48}, 0}, - {{3|(4<<4)}, { 17.23*4, 48}, 0}, - {{3|(3<<4)}, { 17.23*3, 48}, 0}, - {{3|(2<<4)}, { 17.23*2, 48}, 0}, - {{3|(1<<4)}, { 17.23*1, 48}, 0}, + {{3|(11<<4)}, {17.23*11, 48}, 4}, + {{3|(10<<4)}, {17.23*10, 48}, 4}, + {{3|(9<<4)}, {17.23*9, 48}, 4}, + {{3|(8<<4)}, {17.23*8, 48}, 4}, + {{3|(7<<4)}, {17.23*7, 48}, 4}, + {{3|(6<<4)}, { 17.23*6, 48}, 4}, + {{3|(5<<4)}, { 17.23*5, 48}, 4}, + {{3|(4<<4)}, { 17.23*4, 48}, 4}, + {{3|(3<<4)}, { 17.23*3, 48}, 4}, + {{3|(2<<4)}, { 17.23*2, 48}, 4}, + {{3|(1<<4)}, { 17.23*1, 48}, 4}, {{3|(0<<4)}, { 17.23*0, 48}, 1}, {{4|(13<<4)}, {17.23*13, 64}, 1}, {{4|(11<<4)}, {17.23*11, 64}, 1}, {{4|(10<<4)}, {17.23*10, 64}, 1}, {{4|(9<<4)}, {17.23*9, 64}, 1}, {{4|(8<<4)}, {17.23*8, 64}, 1}, - {{4|(5<<4)}, { 17.23*5, 64}, 0}, + {{4|(5<<4)}, { 17.23*5, 64}, 4}, {{4|(2<<4)}, { 17.23*2, 64}, 1}, {{4|(1<<4)}, { 17.23*1, 64}, 1}, {{4|(0<<4)}, { 17.23*0, 64}, 1}, diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c index fcdf29e4e..741fc55fb 100644 --- a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c @@ -42,10 +42,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c index 6ba3ac7e6..1f3807c3b 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c @@ -43,10 +43,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c index 772eddf07..4575eb19d 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c @@ -43,10 +43,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c index a78e23703..5e3884803 100644 --- a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c @@ -42,10 +42,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index 2784f6fa6..3dfa78374 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -56,11 +56,9 @@ void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool defa for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color(i, red, green, blue); - } + + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 6f4ae9fed..13ea84302 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -269,64 +269,64 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} - | | modifier + | | flags | | | */ - {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 0}, // LED 1 on right > Key 6 - {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 0}, // LED 2 > Key 7 - {{10|(0<<4)}, {17.2*10, 12.8*0}, 0}, // LED 3 > Key 8 - {{11|(0<<4)}, {17.2*11, 12.8*0}, 0}, // LED 4 > Key 9 - {{12|(0<<4)}, {17.2*12, 12.8*0}, 0}, // LED 5 > Key 0 - - {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 0}, // LED 6 - {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 0}, // LED 7 - {{10|(1<<4)}, {17.2*10, 12.8*1}, 0}, // LED 8 - {{11|(1<<4)}, {17.2*11, 12.8*1}, 0}, // LED 9 - {{12|(1<<4)}, {17.2*12, 12.8*1}, 0}, // LED 10 - - {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 0}, // LED 11 - {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 0}, // LED 12 - {{10|(2<<4)}, {17.2*10, 12.8*2}, 0}, // LED 13 - {{11|(2<<4)}, {17.2*11, 12.8*2}, 0}, // LED 14 - {{12|(2<<4)}, {17.2*12, 12.8*2}, 0}, // LED 15 - - {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 0}, // LED 16 - {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 0}, // LED 17 - {{10|(3<<4)}, {17.2*10, 12.8*3}, 0}, // LED 18 - {{11|(3<<4)}, {17.2*11, 12.8*3}, 0}, // LED 19 - {{12|(3<<4)}, {17.2*12, 12.8*3}, 0}, // LED 20 + {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 4}, // LED 1 on right > Key 6 + {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 4}, // LED 2 > Key 7 + {{10|(0<<4)}, {17.2*10, 12.8*0}, 4}, // LED 3 > Key 8 + {{11|(0<<4)}, {17.2*11, 12.8*0}, 4}, // LED 4 > Key 9 + {{12|(0<<4)}, {17.2*12, 12.8*0}, 4}, // LED 5 > Key 0 + + {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 4}, // LED 6 + {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 4}, // LED 7 + {{10|(1<<4)}, {17.2*10, 12.8*1}, 4}, // LED 8 + {{11|(1<<4)}, {17.2*11, 12.8*1}, 4}, // LED 9 + {{12|(1<<4)}, {17.2*12, 12.8*1}, 4}, // LED 10 + + {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 4}, // LED 11 + {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 4}, // LED 12 + {{10|(2<<4)}, {17.2*10, 12.8*2}, 4}, // LED 13 + {{11|(2<<4)}, {17.2*11, 12.8*2}, 4}, // LED 14 + {{12|(2<<4)}, {17.2*12, 12.8*2}, 4}, // LED 15 + + {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 4}, // LED 16 + {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 4}, // LED 17 + {{10|(3<<4)}, {17.2*10, 12.8*3}, 4}, // LED 18 + {{11|(3<<4)}, {17.2*11, 12.8*3}, 4}, // LED 19 + {{12|(3<<4)}, {17.2*12, 12.8*3}, 4}, // LED 20 {{ 9|(4<<4)}, {17.2* 9, 12.8*4}, 1}, // LED 21 {{10|(4<<4)}, {17.2*10, 12.8*4}, 1}, // LED 22 {{11|(4<<4)}, {17.2*11, 12.8*4}, 1}, // LED 23 {{12|(4<<4)}, {17.2*12, 12.8*4}, 1}, // LED 24 - {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 0}, // LED 1 on left > Key 5 - {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 0}, // LED 2 > Key 4 - {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 0}, // LED 3 > Key 3 - {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 0}, // LED 4 > Key 2 - {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 0}, // LED 5 > Key 1 - - {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 0}, // LED 6 - {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 0}, // LED 7 - {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 0}, // LED 8 - {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 0}, // LED 9 - {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 0}, // LED 10 - - {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 0}, // LED 11 - {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 0}, // LED 12 - {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 0}, // LED 13 - {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 0}, // LED 14 - {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 0}, // LED 15 - - {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 0}, // LED 16 - {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 0}, // LED 17 - {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 0}, // LED 18 - {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 0}, // LED 19 - {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 0}, // LED 20 + {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 4}, // LED 1 on left > Key 5 + {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 4}, // LED 2 > Key 4 + {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 4}, // LED 3 > Key 3 + {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 4}, // LED 4 > Key 2 + {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 4}, // LED 5 > Key 1 + + {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 4}, // LED 6 + {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 4}, // LED 7 + {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 4}, // LED 8 + {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 4}, // LED 9 + {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 4}, // LED 10 + + {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 4}, // LED 11 + {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 4}, // LED 12 + {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 4}, // LED 13 + {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 4}, // LED 14 + {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 4}, // LED 15 + + {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 4}, // LED 16 + {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 4}, // LED 17 + {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 4}, // LED 18 + {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 4}, // LED 19 + {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 4}, // LED 20 {{ 4|(4<<4)}, {17.2* 4, 12.8*4}, 1}, // LED 21 {{ 3|(4<<4)}, {17.2* 3, 12.8*4}, 1}, // LED 22 diff --git a/keyboards/exclusive/e6_rgb/e6_rgb.c b/keyboards/exclusive/e6_rgb/e6_rgb.c index d50af86b5..42f879990 100644 --- a/keyboards/exclusive/e6_rgb/e6_rgb.c +++ b/keyboards/exclusive/e6_rgb/e6_rgb.c @@ -114,80 +114,80 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_16, D_16, F_16}, {0, B_16, A_16, C_16}, }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ //cs1 {{0|(0<<4)}, { 0, 0}, 1}, - {{0|(1<<4)}, { 17, 0}, 0}, + {{0|(1<<4)}, { 17, 0}, 4}, {{1|(0<<4)}, { 0, 16}, 1}, {{2|(0<<4)}, { 0, 32}, 1}, //cs2 - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, + {{0|(2<<4)}, { 34, 0}, 4}, + {{0|(3<<4)}, { 51, 0}, 4}, + {{1|(1<<4)}, { 17, 16}, 4}, + {{1|(2<<4)}, { 34, 16}, 4}, //cs3 - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{3|(1<<4)}, { 17, 48}, 0}, - {{3|(2<<4)}, { 34, 48}, 0}, + {{2|(1<<4)}, { 17, 32}, 4}, + {{2|(2<<4)}, { 34, 32}, 4}, + {{3|(1<<4)}, { 17, 48}, 4}, + {{3|(2<<4)}, { 34, 48}, 4}, //cs4 - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(5<<4)}, { 85, 0}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, + {{0|(4<<4)}, { 68, 0}, 4}, + {{0|(5<<4)}, { 85, 0}, 4}, + {{1|(3<<4)}, { 51, 16}, 4}, + {{1|(4<<4)}, { 68, 16}, 4}, //cs5 - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(12<<4)}, {204, 0}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, + {{0|(11<<4)}, {187, 0}, 4}, + {{0|(12<<4)}, {204, 0}, 4}, + {{1|(11<<4)}, {187, 16}, 4}, + {{1|(12<<4)}, {204, 16}, 4}, //cs6 - {{0|(7<<4)}, {119, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, + {{0|(7<<4)}, {119, 0}, 4}, + {{0|(8<<4)}, {136, 0}, 4}, + {{1|(7<<4)}, {119, 16}, 4}, + {{1|(8<<4)}, {136, 16}, 4}, //cs7 - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, + {{0|(9<<4)}, {153, 0}, 4}, + {{0|(10<<4)}, {170, 0}, 4}, + {{1|(9<<4)}, {153, 16}, 4}, + {{1|(10<<4)}, {170, 16}, 4}, //cs8 - {{0|(13<<4)}, {221, 0}, 0}, - {{0|(14<<4)}, {221, 0}, 0}, + {{0|(13<<4)}, {221, 0}, 4}, + {{0|(14<<4)}, {221, 0}, 4}, {{1|(13<<4)}, {221, 32}, 1}, {{2|(12<<4)}, {221, 16}, 1}, //cs9 - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, + {{2|(3<<4)}, { 51, 32}, 4}, + {{2|(4<<4)}, { 68, 32}, 4}, + {{3|(3<<4)}, { 51, 48}, 4}, + {{3|(4<<4)}, { 68, 48}, 4}, //cs10 - {{0|(6<<4)}, {102, 0}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, + {{0|(6<<4)}, {102, 0}, 4}, + {{1|(5<<4)}, { 85, 16}, 4}, + {{1|(6<<4)}, {102, 16}, 4}, + {{2|(5<<4)}, { 85, 32}, 4}, //cs11 - {{2|(6<<4)}, {102, 32}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(5<<4)}, {102, 64}, 0}, + {{2|(6<<4)}, {102, 32}, 4}, + {{3|(5<<4)}, { 85, 48}, 4}, + {{3|(6<<4)}, {102, 48}, 4}, + {{4|(5<<4)}, {102, 64}, 4}, //cs12 - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, + {{2|(7<<4)}, {119, 32}, 4}, + {{2|(8<<4)}, {136, 32}, 4}, + {{3|(7<<4)}, {119, 48}, 4}, + {{3|(8<<4)}, {136, 48}, 4}, //cs13 - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(9<<4)}, {153, 48}, 0}, + {{2|(9<<4)}, {153, 32}, 4}, + {{2|(10<<4)}, {170, 32}, 4}, + {{3|(9<<4)}, {153, 48}, 4}, {{4|(6<<4)}, {136, 48}, 1}, //cs14 - {{2|(11<<4)}, {187, 32}, 0}, - {{3|(10<<4)}, {170, 48}, 0}, + {{2|(11<<4)}, {187, 32}, 4}, + {{3|(10<<4)}, {170, 48}, 4}, {{3|(11<<4)}, {187, 48}, 1}, {{4|(7<<4)}, {153, 48}, 1}, //cs15 diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c index e99ed11a7..5827b42e2 100644 --- a/keyboards/hadron/ver3/ver3.c +++ b/keyboards/hadron/ver3/ver3.c @@ -21,21 +21,21 @@ #ifdef RGB_MATRIX_ENABLE #include "rgblight.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} | | modifier | | | */ - {{1|(13<<4)}, {195, 3}, 0}, - {{4|(13<<4)}, {195, 16}, 0}, - {{4|(10<<4)}, {150, 16}, 0}, - {{4|(7<<4)}, {105, 16}, 0}, - {{4|(4<<4)}, {60, 16}, 0}, - {{4|(1<<4)}, {15, 16}, 0}, - {{1|(1<<4)}, {15, 3}, 0}, - {{1|(4<<4)}, {60, 3}, 0}, - {{1|(7<<4)}, {105, 3}, 0}, - {{1|(10<<4)}, {150, 3}, 0} + {{1|(13<<4)}, {195, 3}, 4}, + {{4|(13<<4)}, {195, 16}, 4}, + {{4|(10<<4)}, {150, 16}, 4}, + {{4|(7<<4)}, {105, 16}, 4}, + {{4|(4<<4)}, {60, 16}, 4}, + {{4|(1<<4)}, {15, 16}, 4}, + {{1|(1<<4)}, {15, 3}, 4}, + {{1|(4<<4)}, {60, 3}, 4}, + {{1|(7<<4)}, {105, 3}, 4}, + {{1|(10<<4)}, {150, 3}, 4} }; #endif diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c index 882611030..bd6dd19b2 100644 --- a/keyboards/hs60/v1/v1.c +++ b/keyboards/hs60/v1/v1.c @@ -165,7 +165,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +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, @@ -174,70 +174,70 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, + {{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}, 0}, - {{2|(11<<4)}, {197, 32}, 0}, - - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, + {{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}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, + {{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}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, - - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 + {{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}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, + {{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} @@ -319,7 +319,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15} //D16 }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +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, ---, @@ -328,70 +328,70 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, + {{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}, 0}, - {{2|(11<<4)}, {187, 32}, 0}, - - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, + {{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}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, + {{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}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, - - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 - {{3|(1<<4)}, { 17, 48}, 0}, + {{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}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, + {{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} diff --git a/keyboards/massdrop/alt/config.h b/keyboards/massdrop/alt/config.h index f63c38bf6..59e66e133 100644 --- a/keyboards/massdrop/alt/config.h +++ b/keyboards/massdrop/alt/config.h @@ -123,6 +123,5 @@ along with this program. If not, see . #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_LED_PROCESS_LIMIT 15 #define RGB_MATRIX_LED_FLUSH_LIMIT 10 -#define RGB_MATRIX_EXTRA_TOG #include "config_led.h" diff --git a/keyboards/massdrop/alt/config_led.c b/keyboards/massdrop/alt/config_led.c index 7d98e47c9..1a9a539a0 100644 --- a/keyboards/massdrop/alt/config_led.c +++ b/keyboards/massdrop/alt/config_led.c @@ -20,122 +20,122 @@ // // There is a quick-and-dirty implementation of this under ledvis.html -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /* 0 */ { { (0)|(0 << 4) }, { 8, 56 }, 0 }, // KC_ESC - /* 1 */ { { (0)|(1 << 4) }, { 22, 56 }, 0 }, // KC_1 - /* 2 */ { { (0)|(2 << 4) }, { 35, 56 }, 0 }, // KC_2 - /* 3 */ { { (0)|(3 << 4) }, { 49, 56 }, 0 }, // KC_3 - /* 4 */ { { (0)|(4 << 4) }, { 63, 56 }, 0 }, // KC_4 - /* 5 */ { { (0)|(5 << 4) }, { 77, 56 }, 0 }, // KC_5 - /* 6 */ { { (0)|(6 << 4) }, { 91, 56 }, 0 }, // KC_6 - /* 7 */ { { (0)|(7 << 4) }, { 105, 56 }, 0 }, // KC_7 - /* 8 */ { { (0)|(8 << 4) }, { 118, 56 }, 0 }, // KC_8 - /* 9 */ { { (0)|(9 << 4) }, { 132, 56 }, 0 }, // KC_9 - /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 0 }, // KC_0 - /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 0 }, // KC_MINS - /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 0 }, // KC_EQL - /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 0 }, // KC_BSPC - /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 0 }, // KC_DEL - /* 15 */ { { (1)|(0 << 4) }, { 11, 44 }, 0 }, // KC_TAB - /* 16 */ { { (1)|(1 << 4) }, { 28, 44 }, 0 }, // KC_Q - /* 17 */ { { (1)|(2 << 4) }, { 42, 44 }, 0 }, // KC_W - /* 18 */ { { (1)|(3 << 4) }, { 56, 44 }, 0 }, // KC_E - /* 19 */ { { (1)|(4 << 4) }, { 70, 44 }, 0 }, // KC_R - /* 20 */ { { (1)|(5 << 4) }, { 84, 44 }, 0 }, // KC_T - /* 21 */ { { (1)|(6 << 4) }, { 98, 44 }, 0 }, // KC_Y - /* 22 */ { { (1)|(7 << 4) }, { 112, 44 }, 0 }, // KC_U - /* 23 */ { { (1)|(8 << 4) }, { 125, 44 }, 0 }, // KC_I - /* 24 */ { { (1)|(9 << 4) }, { 139, 44 }, 0 }, // KC_O - /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 0 }, // KC_P - /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 0 }, // KC_LBRC - /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 0 }, // KC_RBRC - /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 0 }, // KC_BSLS - /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 0 }, // KC_HOME +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + /* 0 */ { { (0)|(0 << 4) }, { 8, 56 }, 4 }, // KC_ESC + /* 1 */ { { (0)|(1 << 4) }, { 22, 56 }, 4 }, // KC_1 + /* 2 */ { { (0)|(2 << 4) }, { 35, 56 }, 4 }, // KC_2 + /* 3 */ { { (0)|(3 << 4) }, { 49, 56 }, 4 }, // KC_3 + /* 4 */ { { (0)|(4 << 4) }, { 63, 56 }, 4 }, // KC_4 + /* 5 */ { { (0)|(5 << 4) }, { 77, 56 }, 4 }, // KC_5 + /* 6 */ { { (0)|(6 << 4) }, { 91, 56 }, 4 }, // KC_6 + /* 7 */ { { (0)|(7 << 4) }, { 105, 56 }, 4 }, // KC_7 + /* 8 */ { { (0)|(8 << 4) }, { 118, 56 }, 4 }, // KC_8 + /* 9 */ { { (0)|(9 << 4) }, { 132, 56 }, 4 }, // KC_9 + /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 4 }, // KC_0 + /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 4 }, // KC_MINS + /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 4 }, // KC_EQL + /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 4 }, // KC_BSPC + /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 4 }, // KC_DEL + /* 15 */ { { (1)|(0 << 4) }, { 11, 44 }, 4 }, // KC_TAB + /* 16 */ { { (1)|(1 << 4) }, { 28, 44 }, 4 }, // KC_Q + /* 17 */ { { (1)|(2 << 4) }, { 42, 44 }, 4 }, // KC_W + /* 18 */ { { (1)|(3 << 4) }, { 56, 44 }, 4 }, // KC_E + /* 19 */ { { (1)|(4 << 4) }, { 70, 44 }, 4 }, // KC_R + /* 20 */ { { (1)|(5 << 4) }, { 84, 44 }, 4 }, // KC_T + /* 21 */ { { (1)|(6 << 4) }, { 98, 44 }, 4 }, // KC_Y + /* 22 */ { { (1)|(7 << 4) }, { 112, 44 }, 4 }, // KC_U + /* 23 */ { { (1)|(8 << 4) }, { 125, 44 }, 4 }, // KC_I + /* 24 */ { { (1)|(9 << 4) }, { 139, 44 }, 4 }, // KC_O + /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 4 }, // KC_P + /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 4 }, // KC_LBRC + /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 4 }, // KC_RBRC + /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 4 }, // KC_BSLS + /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 4 }, // KC_HOME /* 30 */ { { (2)|(0 << 4) }, { 13, 32 }, 1 }, // KC_CAPS - /* 31 */ { { (2)|(1 << 4) }, { 32, 32 }, 0 }, // KC_A - /* 32 */ { { (2)|(2 << 4) }, { 46, 32 }, 0 }, // KC_S - /* 33 */ { { (2)|(3 << 4) }, { 60, 32 }, 0 }, // KC_D - /* 34 */ { { (2)|(4 << 4) }, { 73, 32 }, 0 }, // KC_F - /* 35 */ { { (2)|(5 << 4) }, { 87, 32 }, 0 }, // KC_G - /* 36 */ { { (2)|(6 << 4) }, { 101, 32 }, 0 }, // KC_H - /* 37 */ { { (2)|(7 << 4) }, { 115, 32 }, 0 }, // KC_J - /* 38 */ { { (2)|(8 << 4) }, { 129, 32 }, 0 }, // KC_K - /* 39 */ { { (2)|(9 << 4) }, { 143, 32 }, 0 }, // KC_L - /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 0 }, // KC_SCLN - /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 0 }, // KC_QUOT + /* 31 */ { { (2)|(1 << 4) }, { 32, 32 }, 4 }, // KC_A + /* 32 */ { { (2)|(2 << 4) }, { 46, 32 }, 4 }, // KC_S + /* 33 */ { { (2)|(3 << 4) }, { 60, 32 }, 4 }, // KC_D + /* 34 */ { { (2)|(4 << 4) }, { 73, 32 }, 4 }, // KC_F + /* 35 */ { { (2)|(5 << 4) }, { 87, 32 }, 4 }, // KC_G + /* 36 */ { { (2)|(6 << 4) }, { 101, 32 }, 4 }, // KC_H + /* 37 */ { { (2)|(7 << 4) }, { 115, 32 }, 4 }, // KC_J + /* 38 */ { { (2)|(8 << 4) }, { 129, 32 }, 4 }, // KC_K + /* 39 */ { { (2)|(9 << 4) }, { 143, 32 }, 4 }, // KC_L + /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 4 }, // KC_SCLN + /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 4 }, // KC_QUOT /* _________________________________________ */ // ____ - /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 0 }, // KC_ENT - /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 0 }, // KC_PGUP - /* 44 */ { { (3)|(0 << 4) }, { 16, 19 }, 0 }, // KC_LSFT - /* 45 */ { { (3)|(2 << 4) }, { 39, 19 }, 0 }, // KC_Z - /* 46 */ { { (3)|(3 << 4) }, { 53, 19 }, 0 }, // KC_X - /* 47 */ { { (3)|(4 << 4) }, { 67, 19 }, 0 }, // KC_C - /* 48 */ { { (3)|(5 << 4) }, { 80, 19 }, 0 }, // KC_V - /* 49 */ { { (3)|(6 << 4) }, { 94, 19 }, 0 }, // KC_B - /* 50 */ { { (3)|(7 << 4) }, { 108, 19 }, 0 }, // KC_N - /* 51 */ { { (3)|(8 << 4) }, { 122, 19 }, 0 }, // KC_M - /* 52 */ { { (3)|(9 << 4) }, { 136, 19 }, 0 }, // KC_COMM - /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 0 }, // KC_DOT - /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 0 }, // KC_SLSH - /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 0 }, // KC_RSFT + /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 4 }, // KC_ENT + /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 4 }, // KC_PGUP + /* 44 */ { { (3)|(0 << 4) }, { 16, 19 }, 4 }, // KC_LSFT + /* 45 */ { { (3)|(2 << 4) }, { 39, 19 }, 4 }, // KC_Z + /* 46 */ { { (3)|(3 << 4) }, { 53, 19 }, 4 }, // KC_X + /* 47 */ { { (3)|(4 << 4) }, { 67, 19 }, 4 }, // KC_C + /* 48 */ { { (3)|(5 << 4) }, { 80, 19 }, 4 }, // KC_V + /* 49 */ { { (3)|(6 << 4) }, { 94, 19 }, 4 }, // KC_B + /* 50 */ { { (3)|(7 << 4) }, { 108, 19 }, 4 }, // KC_N + /* 51 */ { { (3)|(8 << 4) }, { 122, 19 }, 4 }, // KC_M + /* 52 */ { { (3)|(9 << 4) }, { 136, 19 }, 4 }, // KC_COMM + /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 4 }, // KC_DOT + /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 4 }, // KC_SLSH + /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 4 }, // KC_RSFT /* _________________________________________ */ // ____ - /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 0 }, // KC_UP - /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 0 }, // KC_PGDN - /* 58 */ { { (4)|(0 << 4) }, { 9, 7 }, 0 }, // KC_LCTL - /* 59 */ { { (4)|(1 << 4) }, { 27, 7 }, 0 }, // KC_LGUI - /* 60 */ { { (4)|(2 << 4) }, { 44, 7 }, 0 }, // KC_LALT + /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 4 }, // KC_UP + /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 4 }, // KC_PGDN + /* 58 */ { { (4)|(0 << 4) }, { 9, 7 }, 4 }, // KC_LCTL + /* 59 */ { { (4)|(1 << 4) }, { 27, 7 }, 4 }, // KC_LGUI + /* 60 */ { { (4)|(2 << 4) }, { 44, 7 }, 4 }, // KC_LALT /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ - /* 61 */ { { (4)|(6 << 4) }, { 96, 7 }, 0 }, // KC_SPC + /* 61 */ { { (4)|(6 << 4) }, { 96, 7 }, 4 }, // KC_SPC /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ /* _________________________________________ */ // ____ - /* 62 */ { { (4)|(10 << 4) }, { 148, 7 }, 0 }, // KC_RALT - /* 63 */ { { (4)|(11 << 4) }, { 165, 7 }, 0 }, // MO(1) - /* 64 */ { { (4)|(12 << 4) }, { 188, 7 }, 0 }, // KC_LEFT - /* 65 */ { { (4)|(13 << 4) }, { 201, 7 }, 0 }, // KC_DOWN - /* 66 */ { { (4)|(14 << 4) }, { 215, 7 }, 0 }, // KC_RGHT + /* 62 */ { { (4)|(10 << 4) }, { 148, 7 }, 4 }, // KC_RALT + /* 63 */ { { (4)|(11 << 4) }, { 165, 7 }, 4 }, // MO(1) + /* 64 */ { { (4)|(12 << 4) }, { 188, 7 }, 4 }, // KC_LEFT + /* 65 */ { { (4)|(13 << 4) }, { 201, 7 }, 4 }, // KC_DOWN + /* 66 */ { { (4)|(14 << 4) }, { 215, 7 }, 4 }, // KC_RGHT // Underglow LEDs - { { 255 }, { 1, 1 }, 0 }, - { { 255 }, { 15, 0 }, 0 }, - { { 255 }, { 31, 0 }, 0 }, - { { 255 }, { 47, 0 }, 0 }, - { { 255 }, { 63, 0 }, 0 }, - { { 255 }, { 79, 0 }, 0 }, - { { 255 }, { 95, 0 }, 0 }, - { { 255 }, { 112, 0 }, 0 }, - { { 255 }, { 128, 0 }, 0 }, - { { 255 }, { 144, 0 }, 0 }, - { { 255 }, { 160, 0 }, 0 }, - { { 255 }, { 176, 0 }, 0 }, - { { 255 }, { 192, 0 }, 0 }, - { { 255 }, { 208, 0 }, 0 }, - { { 255 }, { 222, 1 }, 0 }, - { { 255 }, { 224, 13 }, 0 }, - { { 255 }, { 224, 25 }, 0 }, - { { 255 }, { 224, 38 }, 0 }, - { { 255 }, { 224, 50 }, 0 }, - { { 255 }, { 222, 62 }, 0 }, - { { 255 }, { 191, 64 }, 0 }, - { { 255 }, { 179, 64 }, 0 }, - { { 255 }, { 167, 64 }, 0 }, - { { 255 }, { 153, 64 }, 0 }, - { { 255 }, { 139, 64 }, 0 }, - { { 255 }, { 125, 64 }, 0 }, - { { 255 }, { 112, 64 }, 0 }, - { { 255 }, { 98, 64 }, 0 }, - { { 255 }, { 84, 64 }, 0 }, - { { 255 }, { 70, 64 }, 0 }, - { { 255 }, { 56, 64 }, 0 }, - { { 255 }, { 42, 64 }, 0 }, - { { 255 }, { 28, 64 }, 0 }, - { { 255 }, { 1, 62 }, 0 }, - { { 255 }, { 0, 50 }, 0 }, - { { 255 }, { 0, 38 }, 0 }, - { { 255 }, { 0, 25 }, 0 }, - { { 255 }, { 0, 13 }, 0 }, + { { 255 }, { 1, 1 }, 2 }, + { { 255 }, { 15, 0 }, 2 }, + { { 255 }, { 31, 0 }, 2 }, + { { 255 }, { 47, 0 }, 2 }, + { { 255 }, { 63, 0 }, 2 }, + { { 255 }, { 79, 0 }, 2 }, + { { 255 }, { 95, 0 }, 2 }, + { { 255 }, { 112, 0 }, 2 }, + { { 255 }, { 128, 0 }, 2 }, + { { 255 }, { 144, 0 }, 2 }, + { { 255 }, { 160, 0 }, 2 }, + { { 255 }, { 176, 0 }, 2 }, + { { 255 }, { 192, 0 }, 2 }, + { { 255 }, { 208, 0 }, 2 }, + { { 255 }, { 222, 1 }, 2 }, + { { 255 }, { 224, 13 }, 2 }, + { { 255 }, { 224, 25 }, 2 }, + { { 255 }, { 224, 38 }, 2 }, + { { 255 }, { 224, 50 }, 2 }, + { { 255 }, { 222, 62 }, 2 }, + { { 255 }, { 191, 64 }, 2 }, + { { 255 }, { 179, 64 }, 2 }, + { { 255 }, { 167, 64 }, 2 }, + { { 255 }, { 153, 64 }, 2 }, + { { 255 }, { 139, 64 }, 2 }, + { { 255 }, { 125, 64 }, 2 }, + { { 255 }, { 112, 64 }, 2 }, + { { 255 }, { 98, 64 }, 2 }, + { { 255 }, { 84, 64 }, 2 }, + { { 255 }, { 70, 64 }, 2 }, + { { 255 }, { 56, 64 }, 2 }, + { { 255 }, { 42, 64 }, 2 }, + { { 255 }, { 28, 64 }, 2 }, + { { 255 }, { 1, 62 }, 2 }, + { { 255 }, { 0, 50 }, 2 }, + { { 255 }, { 0, 38 }, 2 }, + { { 255 }, { 0, 25 }, 2 }, + { { 255 }, { 0, 13 }, 2 }, }; #ifdef USB_LED_INDICATOR_ENABLE diff --git a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c index a4519d404..f6f79ad91 100644 --- a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c +++ b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c @@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index a4519d404..f6f79ad91 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c index 26a1c6d01..222d7e2c5 100644 --- a/keyboards/massdrop/alt/keymaps/mac/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/config.h b/keyboards/massdrop/ctrl/config.h index df2e50921..9b9f98f5f 100644 --- a/keyboards/massdrop/ctrl/config.h +++ b/keyboards/massdrop/ctrl/config.h @@ -123,6 +123,5 @@ along with this program. If not, see . #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_LED_PROCESS_LIMIT 15 #define RGB_MATRIX_LED_FLUSH_LIMIT 10 -#define RGB_MATRIX_EXTRA_TOG #include "config_led.h" diff --git a/keyboards/massdrop/ctrl/config_led.c b/keyboards/massdrop/ctrl/config_led.c index afdbf3a22..20d9c649e 100644 --- a/keyboards/massdrop/ctrl/config_led.c +++ b/keyboards/massdrop/ctrl/config_led.c @@ -5,133 +5,133 @@ #include "rgb_matrix.h" #include "config_led.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS - { { 0|(0<<4) }, { 7, 5 }, 0 }, - { { 0|(1<<4) }, { 31, 5 }, 0 }, - { { 0|(2<<4) }, { 43, 5 }, 0 }, - { { 0|(3<<4) }, { 55, 5 }, 0 }, - { { 0|(4<<4) }, { 67, 5 }, 0 }, - { { 0|(5<<4) }, { 85, 5 }, 0 }, - { { 0|(6<<4) }, { 97, 5 }, 0 }, - { { 0|(7<<4) }, { 109, 5 }, 0 }, - { { 6|(0<<4) }, { 121, 5 }, 0 }, - { { 6|(1<<4) }, { 139, 5 }, 0 }, - { { 6|(2<<4) }, { 151, 5 }, 0 }, - { { 6|(3<<4) }, { 163, 5 }, 0 }, - { { 6|(4<<4) }, { 175, 5 }, 0 }, - { { 6|(5<<4) }, { 193, 5 }, 0 }, + { { 0|(0<<4) }, { 7, 5 }, 4 }, + { { 0|(1<<4) }, { 31, 5 }, 4 }, + { { 0|(2<<4) }, { 43, 5 }, 4 }, + { { 0|(3<<4) }, { 55, 5 }, 4 }, + { { 0|(4<<4) }, { 67, 5 }, 4 }, + { { 0|(5<<4) }, { 85, 5 }, 4 }, + { { 0|(6<<4) }, { 97, 5 }, 4 }, + { { 0|(7<<4) }, { 109, 5 }, 4 }, + { { 6|(0<<4) }, { 121, 5 }, 4 }, + { { 6|(1<<4) }, { 139, 5 }, 4 }, + { { 6|(2<<4) }, { 151, 5 }, 4 }, + { { 6|(3<<4) }, { 163, 5 }, 4 }, + { { 6|(4<<4) }, { 175, 5 }, 4 }, + { { 6|(5<<4) }, { 193, 5 }, 4 }, { { 6|(6<<4) }, { 205, 5 }, 1 }, - { { 6|(7<<4) }, { 217, 5 }, 0 }, + { { 6|(7<<4) }, { 217, 5 }, 4 }, // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP - { { 1|(0<<4) }, { 7, 20 }, 0 }, - { { 1|(1<<4) }, { 19, 20 }, 0 }, - { { 1|(2<<4) }, { 31, 20 }, 0 }, - { { 1|(3<<4) }, { 43, 20 }, 0 }, - { { 1|(4<<4) }, { 55, 20 }, 0 }, - { { 1|(5<<4) }, { 67, 20 }, 0 }, - { { 1|(6<<4) }, { 79, 20 }, 0 }, - { { 1|(7<<4) }, { 91, 20 }, 0 }, - { { 7|(0<<4) }, { 103, 20 }, 0 }, - { { 7|(1<<4) }, { 115, 20 }, 0 }, - { { 7|(2<<4) }, { 127, 20 }, 0 }, - { { 7|(3<<4) }, { 139, 20 }, 0 }, - { { 7|(4<<4) }, { 151, 20 }, 0 }, - { { 7|(5<<4) }, { 169, 20 }, 0 }, - { { 7|(6<<4) }, { 193, 20 }, 0 }, - { { 7|(7<<4) }, { 205, 20 }, 0 }, - { { 9|(7<<4) }, { 217, 20 }, 0 }, + { { 1|(0<<4) }, { 7, 20 }, 4 }, + { { 1|(1<<4) }, { 19, 20 }, 4 }, + { { 1|(2<<4) }, { 31, 20 }, 4 }, + { { 1|(3<<4) }, { 43, 20 }, 4 }, + { { 1|(4<<4) }, { 55, 20 }, 4 }, + { { 1|(5<<4) }, { 67, 20 }, 4 }, + { { 1|(6<<4) }, { 79, 20 }, 4 }, + { { 1|(7<<4) }, { 91, 20 }, 4 }, + { { 7|(0<<4) }, { 103, 20 }, 4 }, + { { 7|(1<<4) }, { 115, 20 }, 4 }, + { { 7|(2<<4) }, { 127, 20 }, 4 }, + { { 7|(3<<4) }, { 139, 20 }, 4 }, + { { 7|(4<<4) }, { 151, 20 }, 4 }, + { { 7|(5<<4) }, { 169, 20 }, 4 }, + { { 7|(6<<4) }, { 193, 20 }, 4 }, + { { 7|(7<<4) }, { 205, 20 }, 4 }, + { { 9|(7<<4) }, { 217, 20 }, 4 }, // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN - { { 2|(0<<4) }, { 10, 30 }, 0 }, - { { 2|(1<<4) }, { 25, 30 }, 0 }, - { { 2|(2<<4) }, { 37, 30 }, 0 }, - { { 2|(3<<4) }, { 49, 30 }, 0 }, - { { 2|(4<<4) }, { 61, 30 }, 0 }, - { { 2|(5<<4) }, { 73, 30 }, 0 }, - { { 2|(6<<4) }, { 85, 30 }, 0 }, - { { 2|(7<<4) }, { 97, 30 }, 0 }, - { { 8|(0<<4) }, { 109, 30 }, 0 }, - { { 8|(1<<4) }, { 121, 30 }, 0 }, - { { 8|(2<<4) }, { 133, 30 }, 0 }, - { { 8|(3<<4) }, { 145, 30 }, 0 }, - { { 8|(4<<4) }, { 157, 30 }, 0 }, - { { 8|(5<<4) }, { 172, 30 }, 0 }, - { { 8|(6<<4) }, { 193, 30 }, 0 }, - { { 8|(7<<4) }, { 205, 30 }, 0 }, - { { 9|(6<<4) }, { 217, 30 }, 0 }, + { { 2|(0<<4) }, { 10, 30 }, 4 }, + { { 2|(1<<4) }, { 25, 30 }, 4 }, + { { 2|(2<<4) }, { 37, 30 }, 4 }, + { { 2|(3<<4) }, { 49, 30 }, 4 }, + { { 2|(4<<4) }, { 61, 30 }, 4 }, + { { 2|(5<<4) }, { 73, 30 }, 4 }, + { { 2|(6<<4) }, { 85, 30 }, 4 }, + { { 2|(7<<4) }, { 97, 30 }, 4 }, + { { 8|(0<<4) }, { 109, 30 }, 4 }, + { { 8|(1<<4) }, { 121, 30 }, 4 }, + { { 8|(2<<4) }, { 133, 30 }, 4 }, + { { 8|(3<<4) }, { 145, 30 }, 4 }, + { { 8|(4<<4) }, { 157, 30 }, 4 }, + { { 8|(5<<4) }, { 172, 30 }, 4 }, + { { 8|(6<<4) }, { 193, 30 }, 4 }, + { { 8|(7<<4) }, { 205, 30 }, 4 }, + { { 9|(6<<4) }, { 217, 30 }, 4 }, // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT { { 3|(0<<4) }, { 11, 39 }, 1 }, - { { 3|(1<<4) }, { 28, 39 }, 0 }, - { { 3|(2<<4) }, { 40, 39 }, 0 }, - { { 3|(3<<4) }, { 52, 39 }, 0 }, - { { 3|(4<<4) }, { 64, 39 }, 0 }, - { { 3|(5<<4) }, { 76, 39 }, 0 }, - { { 3|(6<<4) }, { 88, 39 }, 0 }, - { { 3|(7<<4) }, { 100, 39 }, 0 }, - { { 9|(0<<4) }, { 112, 39 }, 0 }, - { { 9|(1<<4) }, { 124, 39 }, 0 }, - { { 9|(2<<4) }, { 136, 39 }, 0 }, - { { 9|(3<<4) }, { 148, 39 }, 0 }, - { { 9|(4<<4) }, { 168, 39 }, 0 }, + { { 3|(1<<4) }, { 28, 39 }, 4 }, + { { 3|(2<<4) }, { 40, 39 }, 4 }, + { { 3|(3<<4) }, { 52, 39 }, 4 }, + { { 3|(4<<4) }, { 64, 39 }, 4 }, + { { 3|(5<<4) }, { 76, 39 }, 4 }, + { { 3|(6<<4) }, { 88, 39 }, 4 }, + { { 3|(7<<4) }, { 100, 39 }, 4 }, + { { 9|(0<<4) }, { 112, 39 }, 4 }, + { { 9|(1<<4) }, { 124, 39 }, 4 }, + { { 9|(2<<4) }, { 136, 39 }, 4 }, + { { 9|(3<<4) }, { 148, 39 }, 4 }, + { { 9|(4<<4) }, { 168, 39 }, 4 }, // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP - { { 4|(0<<4) }, { 14, 49 }, 0 }, - { { 4|(1<<4) }, { 34, 49 }, 0 }, - { { 4|(2<<4) }, { 46, 49 }, 0 }, - { { 4|(3<<4) }, { 58, 49 }, 0 }, - { { 4|(4<<4) }, { 70, 49 }, 0 }, - { { 4|(5<<4) }, { 82, 49 }, 0 }, - { { 4|(6<<4) }, { 94, 49 }, 0 }, - { { 4|(7<<4) }, { 106, 49 }, 0 }, - { { 10|(0<<4) }, { 118, 49 }, 0 }, - { { 10|(1<<4) }, { 130, 49 }, 0 }, - { { 10|(2<<4) }, { 142, 49 }, 0 }, - { { 10|(3<<4) }, { 165, 49 }, 0 }, - { { 9|(5<<4) }, { 205, 49 }, 0 }, + { { 4|(0<<4) }, { 14, 49 }, 4 }, + { { 4|(1<<4) }, { 34, 49 }, 4 }, + { { 4|(2<<4) }, { 46, 49 }, 4 }, + { { 4|(3<<4) }, { 58, 49 }, 4 }, + { { 4|(4<<4) }, { 70, 49 }, 4 }, + { { 4|(5<<4) }, { 82, 49 }, 4 }, + { { 4|(6<<4) }, { 94, 49 }, 4 }, + { { 4|(7<<4) }, { 106, 49 }, 4 }, + { { 10|(0<<4) }, { 118, 49 }, 4 }, + { { 10|(1<<4) }, { 130, 49 }, 4 }, + { { 10|(2<<4) }, { 142, 49 }, 4 }, + { { 10|(3<<4) }, { 165, 49 }, 4 }, + { { 9|(5<<4) }, { 205, 49 }, 4 }, // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - { { 5|(0<<4) }, { 8, 59 }, 0 }, - { { 5|(1<<4) }, { 23, 59 }, 0 }, - { { 5|(2<<4) }, { 38, 59 }, 0 }, - { { 5|(3<<4) }, { 83, 59 }, 0 }, - { { 5|(4<<4) }, { 129, 59 }, 0 }, - { { 5|(5<<4) }, { 144, 59 }, 0 }, - { { 5|(6<<4) }, { 159, 59 }, 0 }, - { { 5|(7<<4) }, { 174, 59 }, 0 }, - { { 10|(4<<4) }, { 193, 59 }, 0 }, - { { 10|(5<<4) }, { 205, 59 }, 0 }, - { { 10|(6<<4) }, { 217, 59 }, 0 }, + { { 5|(0<<4) }, { 8, 59 }, 4 }, + { { 5|(1<<4) }, { 23, 59 }, 4 }, + { { 5|(2<<4) }, { 38, 59 }, 4 }, + { { 5|(3<<4) }, { 83, 59 }, 4 }, + { { 5|(4<<4) }, { 129, 59 }, 4 }, + { { 5|(5<<4) }, { 144, 59 }, 4 }, + { { 5|(6<<4) }, { 159, 59 }, 4 }, + { { 5|(7<<4) }, { 174, 59 }, 4 }, + { { 10|(4<<4) }, { 193, 59 }, 4 }, + { { 10|(5<<4) }, { 205, 59 }, 4 }, + { { 10|(6<<4) }, { 217, 59 }, 4 }, // Underglow / Border - { { 0xFF }, { 222, 64 }, 0 }, - { { 0xFF }, { 204, 64 }, 0 }, - { { 0xFF }, { 186, 64 }, 0 }, - { { 0xFF }, { 167, 64 }, 0 }, - { { 0xFF }, { 149, 64 }, 0 }, - { { 0xFF }, { 130, 64 }, 0 }, - { { 0xFF }, { 112, 64 }, 0 }, - { { 0xFF }, { 94, 64 }, 0 }, - { { 0xFF }, { 75, 64 }, 0 }, - { { 0xFF }, { 57, 64 }, 0 }, - { { 0xFF }, { 38, 64 }, 0 }, - { { 0xFF }, { 20, 64 }, 0 }, - { { 0xFF }, { 0, 64 }, 0 }, - { { 0xFF }, { 0, 47 }, 0 }, - { { 0xFF }, { 0, 32 }, 0 }, - { { 0xFF }, { 0, 17 }, 0 }, - { { 0xFF }, { 0, 0 }, 0 }, - { { 0xFF }, { 20, 0 }, 0 }, - { { 0xFF }, { 38, 0 }, 0 }, - { { 0xFF }, { 57, 0 }, 0 }, - { { 0xFF }, { 75, 0 }, 0 }, - { { 0xFF }, { 94, 0 }, 0 }, - { { 0xFF }, { 112, 0 }, 0 }, - { { 0xFF }, { 130, 0 }, 0 }, - { { 0xFF }, { 149, 0 }, 0 }, - { { 0xFF }, { 167, 0 }, 0 }, - { { 0xFF }, { 186, 0 }, 0 }, - { { 0xFF }, { 204, 0 }, 0 }, - { { 0xFF }, { 222, 1 }, 0 }, - { { 0xFF }, { 224, 17 }, 0 }, - { { 0xFF }, { 224, 32 }, 0 }, - { { 0xFF }, { 224, 47 }, 0 }, + { { 0xFF }, { 222, 64 }, 2 }, + { { 0xFF }, { 204, 64 }, 2 }, + { { 0xFF }, { 186, 64 }, 2 }, + { { 0xFF }, { 167, 64 }, 2 }, + { { 0xFF }, { 149, 64 }, 2 }, + { { 0xFF }, { 130, 64 }, 2 }, + { { 0xFF }, { 112, 64 }, 2 }, + { { 0xFF }, { 94, 64 }, 2 }, + { { 0xFF }, { 75, 64 }, 2 }, + { { 0xFF }, { 57, 64 }, 2 }, + { { 0xFF }, { 38, 64 }, 2 }, + { { 0xFF }, { 20, 64 }, 2 }, + { { 0xFF }, { 0, 64 }, 2 }, + { { 0xFF }, { 0, 47 }, 2 }, + { { 0xFF }, { 0, 32 }, 2 }, + { { 0xFF }, { 0, 17 }, 2 }, + { { 0xFF }, { 0, 0 }, 2 }, + { { 0xFF }, { 20, 0 }, 2 }, + { { 0xFF }, { 38, 0 }, 2 }, + { { 0xFF }, { 57, 0 }, 2 }, + { { 0xFF }, { 75, 0 }, 2 }, + { { 0xFF }, { 94, 0 }, 2 }, + { { 0xFF }, { 112, 0 }, 2 }, + { { 0xFF }, { 130, 0 }, 2 }, + { { 0xFF }, { 149, 0 }, 2 }, + { { 0xFF }, { 167, 0 }, 2 }, + { { 0xFF }, { 186, 0 }, 2 }, + { { 0xFF }, { 204, 0 }, 2 }, + { { 0xFF }, { 222, 1 }, 2 }, + { { 0xFF }, { 224, 17 }, 2 }, + { { 0xFF }, { 224, 32 }, 2 }, + { { 0xFF }, { 224, 47 }, 2 }, }; #ifdef USB_LED_INDICATOR_ENABLE diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c index 182abbbad..53c96d95d 100644 --- a/keyboards/massdrop/ctrl/keymaps/default/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c index 41cf82757..79fe7388a 100644 --- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/model01/leds.c b/keyboards/model01/leds.c index 7a62c7424..0abc1f0da 100644 --- a/keyboards/model01/leds.c +++ b/keyboards/model01/leds.c @@ -46,34 +46,34 @@ void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b) { #ifdef RGB_MATRIX_ENABLE __attribute__ ((weak)) -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0x73}, { 3, 35}, 0}, - {{0x72}, { 0, 26}, 0}, - {{0x71}, { 0, 17}, 0}, - {{0x70}, { 0, 6}, 0}, - {{0x60}, { 14, 5}, 0}, - {{0x61}, { 15, 16}, 0}, - {{0x62}, { 16, 25}, 0}, - {{0x63}, { 17, 34}, 0}, - {{0x53}, { 31, 29}, 0}, - {{0x52}, { 31, 19}, 0}, - {{0x51}, { 30, 11}, 0}, - {{0x50}, { 30, 1}, 0}, - {{0x40}, { 45, 0}, 0}, - {{0x41}, { 45, 8}, 0}, - {{0x42}, { 46, 17}, 0}, - {{0x43}, { 46, 27}, 0}, - {{0x33}, { 60, 27}, 0}, - {{0x32}, { 60, 18}, 0}, - {{0x31}, { 60, 9}, 0}, - {{0x30}, { 60, 0}, 0}, - {{0x20}, { 74, 2}, 0}, - {{0x21}, { 74, 11}, 0}, - {{0x22}, { 75, 20}, 0}, - {{0x23}, { 74, 28}, 0}, - {{0x12}, { 89, 30}, 0}, - {{0x11}, { 89, 19}, 0}, - {{0x10}, { 89, 7}, 0}, +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0x73}, { 3, 35}, 4}, + {{0x72}, { 0, 26}, 4}, + {{0x71}, { 0, 17}, 4}, + {{0x70}, { 0, 6}, 4}, + {{0x60}, { 14, 5}, 4}, + {{0x61}, { 15, 16}, 4}, + {{0x62}, { 16, 25}, 4}, + {{0x63}, { 17, 34}, 4}, + {{0x53}, { 31, 29}, 4}, + {{0x52}, { 31, 19}, 4}, + {{0x51}, { 30, 11}, 4}, + {{0x50}, { 30, 1}, 4}, + {{0x40}, { 45, 0}, 4}, + {{0x41}, { 45, 8}, 4}, + {{0x42}, { 46, 17}, 4}, + {{0x43}, { 46, 27}, 4}, + {{0x33}, { 60, 27}, 4}, + {{0x32}, { 60, 18}, 4}, + {{0x31}, { 60, 9}, 4}, + {{0x30}, { 60, 0}, 4}, + {{0x20}, { 74, 2}, 4}, + {{0x21}, { 74, 11}, 4}, + {{0x22}, { 75, 20}, 4}, + {{0x23}, { 74, 28}, 4}, + {{0x12}, { 89, 30}, 4}, + {{0x11}, { 89, 19}, 4}, + {{0x10}, { 89, 7}, 4}, {{0x00}, { 70, 38}, 1}, {{0x01}, { 82, 41}, 1}, {{0x02}, { 93, 45}, 1}, @@ -84,33 +84,33 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0x76}, {130, 45}, 1}, {{0x75}, {141, 41}, 1}, {{0x74}, {153, 38}, 1}, - {{0x64}, {134, 7}, 0}, - {{0x65}, {134, 19}, 0}, - {{0x66}, {134, 30}, 0}, - {{0x57}, {149, 28}, 0}, - {{0x56}, {148, 20}, 0}, - {{0x55}, {149, 11}, 0}, - {{0x54}, {149, 2}, 0}, - {{0x44}, {163, 0}, 0}, - {{0x45}, {163, 9}, 0}, - {{0x46}, {163, 18}, 0}, - {{0x47}, {163, 27}, 0}, - {{0x37}, {177, 27}, 0}, - {{0x36}, {177, 17}, 0}, - {{0x35}, {178, 8}, 0}, - {{0x34}, {178, 0}, 0}, - {{0x24}, {193, 1}, 0}, - {{0x25}, {193, 11}, 0}, - {{0x26}, {192, 19}, 0}, - {{0x27}, {192, 29}, 0}, - {{0x17}, {206, 34}, 0}, - {{0x16}, {207, 25}, 0}, - {{0x15}, {208, 16}, 0}, - {{0x14}, {209, 5}, 0}, - {{0x04}, {224, 6}, 0}, - {{0x05}, {223, 17}, 0}, - {{0x06}, {223, 26}, 0}, - {{0x07}, {220, 35}, 0}, + {{0x64}, {134, 7}, 4}, + {{0x65}, {134, 19}, 4}, + {{0x66}, {134, 30}, 4}, + {{0x57}, {149, 28}, 4}, + {{0x56}, {148, 20}, 4}, + {{0x55}, {149, 11}, 4}, + {{0x54}, {149, 2}, 4}, + {{0x44}, {163, 0}, 4}, + {{0x45}, {163, 9}, 4}, + {{0x46}, {163, 18}, 4}, + {{0x47}, {163, 27}, 4}, + {{0x37}, {177, 27}, 4}, + {{0x36}, {177, 17}, 4}, + {{0x35}, {178, 8}, 4}, + {{0x34}, {178, 0}, 4}, + {{0x24}, {193, 1}, 4}, + {{0x25}, {193, 11}, 4}, + {{0x26}, {192, 19}, 4}, + {{0x27}, {192, 29}, 4}, + {{0x17}, {206, 34}, 4}, + {{0x16}, {207, 25}, 4}, + {{0x15}, {208, 16}, 4}, + {{0x14}, {209, 5}, 4}, + {{0x04}, {224, 6}, 4}, + {{0x05}, {223, 17}, 4}, + {{0x06}, {223, 26}, 4}, + {{0x07}, {220, 35}, 4}, }; static struct { diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index c3b7e2617..94f507189 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -79,49 +79,49 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} - | | modifier + | | flags | | | */ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 0}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 0}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 0}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 0}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 0}, - {{4|(0<<4)}, {20.36*6, 21.33*0}, 0}, - {{4|(1<<4)}, {20.36*7, 21.33*0}, 0}, - {{4|(2<<4)}, {20.36*8, 21.33*0}, 0}, - {{4|(3<<4)}, {20.36*9, 21.33*0}, 0}, - {{4|(4<<4)}, {20.36*10,21.33*0}, 0}, + {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, + {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, + {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, + {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, + {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, + {{4|(0<<4)}, {20.36*6, 21.33*0}, 4}, + {{4|(1<<4)}, {20.36*7, 21.33*0}, 4}, + {{4|(2<<4)}, {20.36*8, 21.33*0}, 4}, + {{4|(3<<4)}, {20.36*9, 21.33*0}, 4}, + {{4|(4<<4)}, {20.36*10,21.33*0}, 4}, {{4|(5<<4)}, {20.36*11,21.33*0}, 1}, {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 0}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 0}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 0}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 0}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 0}, - {{5|(0<<4)}, {20.36*6, 21.33*1}, 0}, - {{5|(1<<4)}, {20.36*7, 21.33*1}, 0}, - {{5|(2<<4)}, {20.36*8, 21.33*1}, 0}, - {{5|(3<<4)}, {20.36*9, 21.33*1}, 0}, - {{5|(4<<4)}, {20.36*10,21.33*1}, 0}, + {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, + {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, + {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, + {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, + {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, + {{5|(0<<4)}, {20.36*6, 21.33*1}, 4}, + {{5|(1<<4)}, {20.36*7, 21.33*1}, 4}, + {{5|(2<<4)}, {20.36*8, 21.33*1}, 4}, + {{5|(3<<4)}, {20.36*9, 21.33*1}, 4}, + {{5|(4<<4)}, {20.36*10,21.33*1}, 4}, {{5|(5<<4)}, {20.36*11,21.33*1}, 1}, {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 0}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 0}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 0}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 0}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 0}, - {{6|(0<<4)}, {20.36*6, 21.33*2}, 0}, - {{6|(1<<4)}, {20.36*7, 21.33*2}, 0}, - {{6|(2<<4)}, {20.36*8, 21.33*2}, 0}, - {{6|(3<<4)}, {20.36*9, 21.33*2}, 0}, - {{6|(4<<4)}, {20.36*10,21.33*2}, 0}, + {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, + {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, + {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, + {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, + {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, + {{6|(0<<4)}, {20.36*6, 21.33*2}, 4}, + {{6|(1<<4)}, {20.36*7, 21.33*2}, 4}, + {{6|(2<<4)}, {20.36*8, 21.33*2}, 4}, + {{6|(3<<4)}, {20.36*9, 21.33*2}, 4}, + {{6|(4<<4)}, {20.36*10,21.33*2}, 4}, {{6|(5<<4)}, {20.36*11,21.33*2}, 1}, {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, @@ -129,7 +129,7 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, {{7|(3<<4)}, {20.36*3, 21.33*3}, 1}, {{7|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{7|(5<<4)}, {20.36*5.5,21.33*3}, 0}, + {{7|(5<<4)}, {20.36*5.5,21.33*3}, 4}, {{7|(0<<4)}, {20.36*7, 21.33*3}, 1}, {{7|(1<<4)}, {20.36*8, 21.33*3}, 1}, {{7|(2<<4)}, {20.36*9, 21.33*3}, 1}, diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c index 6e3b08938..5b7177c6c 100644 --- a/keyboards/planck/keymaps/tom/keymap.c +++ b/keyboards/planck/keymaps/tom/keymap.c @@ -231,7 +231,7 @@ void rgb_matrix_indicators_user(void) { case _RAISE: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if ( led.modifier ) { + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); } else { rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); @@ -242,7 +242,7 @@ void rgb_matrix_indicators_user(void) { case _LOWER: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if ( led.modifier ) { + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); } else { rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c index f463090dd..178d28274 100644 --- a/keyboards/planck/light/light.c +++ b/keyboards/planck/light/light.c @@ -77,49 +77,49 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_14, C8_14, C7_14} }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} - | | modifier + | | flags | | | */ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 0}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 0}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 0}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 0}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 0}, - {{0|(6<<4)}, {20.36*6, 21.33*0}, 0}, - {{0|(7<<4)}, {20.36*7, 21.33*0}, 0}, - {{0|(8<<4)}, {20.36*8, 21.33*0}, 0}, - {{0|(9<<4)}, {20.36*9, 21.33*0}, 0}, - {{0|(10<<4)}, {20.36*10,21.33*0}, 0}, + {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, + {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, + {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, + {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, + {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, + {{0|(6<<4)}, {20.36*6, 21.33*0}, 4}, + {{0|(7<<4)}, {20.36*7, 21.33*0}, 4}, + {{0|(8<<4)}, {20.36*8, 21.33*0}, 4}, + {{0|(9<<4)}, {20.36*9, 21.33*0}, 4}, + {{0|(10<<4)}, {20.36*10,21.33*0}, 4}, {{0|(11<<4)}, {20.36*11,21.33*0}, 1}, {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 0}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 0}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 0}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 0}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 0}, - {{1|(6<<4)}, {20.36*6, 21.33*1}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33*1}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33*1}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33*1}, 0}, - {{1|(10<<4)}, {20.36*10,21.33*1}, 0}, + {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, + {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, + {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, + {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, + {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, + {{1|(6<<4)}, {20.36*6, 21.33*1}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33*1}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33*1}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33*1}, 4}, + {{1|(10<<4)}, {20.36*10,21.33*1}, 4}, {{1|(11<<4)}, {20.36*11,21.33*1}, 1}, {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 0}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 0}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 0}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 0}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 0}, - {{2|(6<<4)}, {20.36*6, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(10<<4)}, {20.36*10,21.33*2}, 0}, + {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, + {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, + {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, + {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, + {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, + {{2|(6<<4)}, {20.36*6, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(10<<4)}, {20.36*10,21.33*2}, 4}, {{2|(11<<4)}, {20.36*11,21.33*2}, 1}, {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, @@ -127,9 +127,9 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, {{3|(3<<4)}, {20.36*3, 21.33*3}, 1}, {{3|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{3|(5<<4)}, {20.36*5, 21.33*3}, 0}, - {{3|(5<<4)}, {20.36*5.5,21.33*3}, 0}, - {{3|(6<<4)}, {20.36*6, 21.33*3}, 0}, + {{3|(5<<4)}, {20.36*5, 21.33*3}, 4}, + {{3|(5<<4)}, {20.36*5.5,21.33*3}, 4}, + {{3|(6<<4)}, {20.36*6, 21.33*3}, 4}, {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, diff --git a/keyboards/sol/rev1/rev1.c b/keyboards/sol/rev1/rev1.c index 049b5c218..b668b02e9 100644 --- a/keyboards/sol/rev1/rev1.c +++ b/keyboards/sol/rev1/rev1.c @@ -1,35 +1,35 @@ #include "sol.h" #ifdef RGB_MATRIX_ENABLE - const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { // Left Hand Mapped Left to Right { { 0 | (0 << 4) }, { 0, 0 }, 1}, - { { 0 | (1 << 4) }, { 22, 0 }, 0}, - { { 0 | (2 << 4) }, { 37, 0 }, 0}, - { { 0 | (3 << 4) }, { 37, 0 }, 0}, - { { 0 | (4 << 4) }, { 67, 0 }, 0}, - { { 0 | (5 << 4) }, { 82, 0 }, 0}, + { { 0 | (1 << 4) }, { 22, 0 }, 4}, + { { 0 | (2 << 4) }, { 37, 0 }, 4}, + { { 0 | (3 << 4) }, { 37, 0 }, 4}, + { { 0 | (4 << 4) }, { 67, 0 }, 4}, + { { 0 | (5 << 4) }, { 82, 0 }, 4}, { { 0 | (6 << 4) }, { 104, 0 }, 1}, { { 1 | (0 << 4) }, { 0, 16 }, 1}, - { { 1 | (1 << 4) }, { 22, 16 }, 0}, - { { 1 | (2 << 4) }, { 37, 16 }, 0}, - { { 1 | (3 << 4) }, { 37, 16 }, 0}, - { { 1 | (4 << 4) }, { 67, 16 }, 0}, - { { 1 | (5 << 4) }, { 82, 16 }, 0}, + { { 1 | (1 << 4) }, { 22, 16 }, 4}, + { { 1 | (2 << 4) }, { 37, 16 }, 4}, + { { 1 | (3 << 4) }, { 37, 16 }, 4}, + { { 1 | (4 << 4) }, { 67, 16 }, 4}, + { { 1 | (5 << 4) }, { 82, 16 }, 4}, { { 1 | (6 << 4) }, { 104, 16 }, 1}, { { 2 | (0 << 4) }, { 0, 32 }, 1}, - { { 2 | (1 << 4) }, { 22, 32 }, 0}, - { { 2 | (2 << 4) }, { 37, 32 }, 0}, - { { 2 | (3 << 4) }, { 37, 32 }, 0}, - { { 2 | (4 << 4) }, { 67, 32 }, 0}, - { { 2 | (5 << 4) }, { 82, 32 }, 0}, + { { 2 | (1 << 4) }, { 22, 32 }, 4}, + { { 2 | (2 << 4) }, { 37, 32 }, 4}, + { { 2 | (3 << 4) }, { 37, 32 }, 4}, + { { 2 | (4 << 4) }, { 67, 32 }, 4}, + { { 2 | (5 << 4) }, { 82, 32 }, 4}, { { 2 | (6 << 4) }, { 104, 32 }, 1}, { { 3 | (0 << 4) }, { 0, 48 }, 1}, - { { 3 | (1 << 4) }, { 22, 48 }, 0}, - { { 3 | (2 << 4) }, { 37, 48 }, 0}, - { { 3 | (3 << 4) }, { 37, 48 }, 0}, - { { 3 | (4 << 4) }, { 67, 48 }, 0}, - { { 3 | (5 << 4) }, { 82, 48 }, 0}, + { { 3 | (1 << 4) }, { 22, 48 }, 4}, + { { 3 | (2 << 4) }, { 37, 48 }, 4}, + { { 3 | (3 << 4) }, { 37, 48 }, 4}, + { { 3 | (4 << 4) }, { 67, 48 }, 4}, + { { 3 | (5 << 4) }, { 82, 48 }, 4}, { { 3 | (6 << 4) }, { 104, 48 }, 1}, { { 4 | (0 << 4) }, { 0, 64 }, 1}, { { 4 | (1 << 4) }, { 22, 64 }, 1}, @@ -42,32 +42,32 @@ { { 5 | (6 << 4) }, { 97, 55 }, 1}, // Left Hand Mapped Right to Left { { 6 | (0 << 4) }, { 224, 0 }, 1}, - { { 6 | (1 << 4) }, { 202, 0 }, 0}, - { { 6 | (2 << 4) }, { 187, 0 }, 0}, - { { 6 | (3 << 4) }, { 172, 0 }, 0}, - { { 6 | (4 << 4) }, { 157, 0 }, 0}, - { { 6 | (5 << 4) }, { 142, 0 }, 0}, + { { 6 | (1 << 4) }, { 202, 0 }, 4}, + { { 6 | (2 << 4) }, { 187, 0 }, 4}, + { { 6 | (3 << 4) }, { 172, 0 }, 4}, + { { 6 | (4 << 4) }, { 157, 0 }, 4}, + { { 6 | (5 << 4) }, { 142, 0 }, 4}, { { 6 | (6 << 4) }, { 120, 0 }, 1}, { { 7 | (0 << 4) }, { 224, 16 }, 1}, - { { 7 | (1 << 4) }, { 202, 16 }, 0}, - { { 7 | (2 << 4) }, { 187, 16 }, 0}, - { { 7 | (3 << 4) }, { 172, 16 }, 0}, - { { 7 | (4 << 4) }, { 157, 16 }, 0}, - { { 7 | (5 << 4) }, { 142, 16 }, 0}, + { { 7 | (1 << 4) }, { 202, 16 }, 4}, + { { 7 | (2 << 4) }, { 187, 16 }, 4}, + { { 7 | (3 << 4) }, { 172, 16 }, 4}, + { { 7 | (4 << 4) }, { 157, 16 }, 4}, + { { 7 | (5 << 4) }, { 142, 16 }, 4}, { { 7 | (6 << 4) }, { 120, 16 }, 1}, { { 8 | (0 << 4) }, { 224, 32 }, 1}, - { { 8 | (1 << 4) }, { 202, 32 }, 0}, - { { 8 | (2 << 4) }, { 187, 32 }, 0}, - { { 8 | (3 << 4) }, { 172, 32 }, 0}, - { { 8 | (4 << 4) }, { 157, 32 }, 0}, - { { 8 | (5 << 4) }, { 142, 32 }, 0}, + { { 8 | (1 << 4) }, { 202, 32 }, 4}, + { { 8 | (2 << 4) }, { 187, 32 }, 4}, + { { 8 | (3 << 4) }, { 172, 32 }, 4}, + { { 8 | (4 << 4) }, { 157, 32 }, 4}, + { { 8 | (5 << 4) }, { 142, 32 }, 4}, { { 8 | (6 << 4) }, { 120, 32 }, 1}, { { 9 | (0 << 4) }, { 224, 48 }, 1}, - { { 9 | (1 << 4) }, { 202, 48 }, 0}, - { { 9 | (2 << 4) }, { 187, 48 }, 0}, - { { 9 | (3 << 4) }, { 172, 48 }, 0}, - { { 9 | (4 << 4) }, { 157, 48 }, 0}, - { { 9 | (5 << 4) }, { 142, 48 }, 0}, + { { 9 | (1 << 4) }, { 202, 48 }, 4}, + { { 9 | (2 << 4) }, { 187, 48 }, 4}, + { { 9 | (3 << 4) }, { 172, 48 }, 4}, + { { 9 | (4 << 4) }, { 157, 48 }, 4}, + { { 9 | (5 << 4) }, { 142, 48 }, 4}, { { 9 | (6 << 4) }, { 120, 48 }, 1}, { { 10 | (0 << 4) }, { 224, 64 }, 1}, { { 10 | (1 << 4) }, { 202, 64 }, 1}, diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index e7f43ad66..26c2e3304 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -405,10 +405,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 16defede9..f82b4e7da 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -179,10 +179,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 5ca9b87a6..8c16c7790 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -162,28 +162,11 @@ void rgb_matrix_update_pwm_buffers(void) { } void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { -#ifdef RGB_MATRIX_EXTRA_TOG - const bool is_key = g_rgb_leds[index].matrix_co.raw != 0xff; - if ( - (rgb_matrix_config.enable == RGB_ZONE_KEYS && !is_key) || - (rgb_matrix_config.enable == RGB_ZONE_UNDER && is_key) - ) { - rgb_matrix_driver.set_color(index, 0, 0, 0); - return; - } -#endif - rgb_matrix_driver.set_color(index, red, green, blue); } void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { -#ifdef RGB_MATRIX_EXTRA_TOG - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -#else rgb_matrix_driver.set_color_all(red, green, blue); -#endif } bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { @@ -262,7 +245,7 @@ static bool rgb_matrix_none(effect_params_t* params) { static uint8_t rgb_last_enable = UINT8_MAX; static uint8_t rgb_last_effect = UINT8_MAX; -static effect_params_t rgb_effect_params = { 0, 0 }; +static effect_params_t rgb_effect_params = { 0, 0xFF }; static rgb_task_states rgb_task_state = SYNCING; static void rgb_task_timers(void) { @@ -575,29 +558,31 @@ void rgb_matrix_set_suspend_state(bool state) { } void rgb_matrix_toggle(void) { - rgb_matrix_config.enable++; - if (!rgb_matrix_config.enable) { - rgb_task_state = STARTING; - } + rgb_matrix_config.enable ^= 1; + rgb_task_state = STARTING; eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } void rgb_matrix_enable(void) { - rgb_matrix_config.enable = 1; + rgb_matrix_enable_noeeprom(); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } void rgb_matrix_enable_noeeprom(void) { - rgb_matrix_config.enable = 1; + if (!rgb_matrix_config.enable) + rgb_task_state = STARTING; + rgb_matrix_config.enable = 1; } void rgb_matrix_disable(void) { - rgb_matrix_config.enable = 0; + rgb_matrix_disable_noeeprom(); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } void rgb_matrix_disable_noeeprom(void) { - rgb_matrix_config.enable = 0; + if (rgb_matrix_config.enable) + rgb_task_state = STARTING; + rgb_matrix_config.enable = 0; } void rgb_matrix_step(void) { @@ -658,6 +643,14 @@ void rgb_matrix_decrease_speed(void) { eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this } +led_flags_t rgb_matrix_get_flags(void) { + return rgb_effect_params.flags; +} + +void rgb_matrix_set_flags(led_flags_t flags) { + rgb_effect_params.flags = flags; +} + void rgb_matrix_mode(uint8_t mode) { rgb_matrix_config.mode = mode; rgb_task_state = STARTING; diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 775cbeac0..33665ffff 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -54,7 +54,9 @@ uint8_t max = DRIVER_LED_TOTAL; #endif -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) continue + +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; typedef struct { @@ -209,6 +211,8 @@ void rgb_matrix_increase_val(void); void rgb_matrix_decrease_val(void); void rgb_matrix_increase_speed(void); void rgb_matrix_decrease_speed(void); +led_flags_t rgb_matrix_get_flags(void); +void rgb_matrix_set_flags(led_flags_t flags); void rgb_matrix_mode(uint8_t mode); void rgb_matrix_mode_noeeprom(uint8_t mode); uint8_t rgb_matrix_get_mode(void); diff --git a/quantum/rgb_matrix_animations/alpha_mods_anim.h b/quantum/rgb_matrix_animations/alpha_mods_anim.h index cc1914d7f..4bd01c4fc 100644 --- a/quantum/rgb_matrix_animations/alpha_mods_anim.h +++ b/quantum/rgb_matrix_animations/alpha_mods_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; // alphas = color1, mods = color2 @@ -14,7 +14,8 @@ bool rgb_matrix_alphas_mods(effect_params_t* params) { RGB rgb2 = hsv_to_rgb(hsv); for (uint8_t i = led_min; i < led_max; i++) { - if (g_rgb_leds[i].modifier) { + RGB_MATRIX_TEST_LED_FLAGS(); + if (HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); } else { rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); diff --git a/quantum/rgb_matrix_animations/breathing_anim.h b/quantum/rgb_matrix_animations/breathing_anim.h index 4a9a1dcdb..54d60f927 100644 --- a/quantum/rgb_matrix_animations/breathing_anim.h +++ b/quantum/rgb_matrix_animations/breathing_anim.h @@ -12,6 +12,7 @@ bool rgb_matrix_breathing(effect_params_t* params) { HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, val }; RGB rgb = hsv_to_rgb(hsv); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } return led_max < DRIVER_LED_TOTAL; diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h index 5c18cfa0c..513dff128 100644 --- a/quantum/rgb_matrix_animations/cycle_all_anim.h +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h @@ -2,16 +2,16 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_all(effect_params_t* params) { RGB_MATRIX_USE_LIMITS(led_min, led_max); HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; - uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); + hsv.h = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { - hsv.h = time; + RGB_MATRIX_TEST_LED_FLAGS(); RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/cycle_left_right_anim.h b/quantum/rgb_matrix_animations/cycle_left_right_anim.h index f519aeb47..428adea22 100644 --- a/quantum/rgb_matrix_animations/cycle_left_right_anim.h +++ b/quantum/rgb_matrix_animations/cycle_left_right_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_left_right(effect_params_t* params) { @@ -11,6 +11,7 @@ bool rgb_matrix_cycle_left_right(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = point.x - time; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/cycle_up_down_anim.h b/quantum/rgb_matrix_animations/cycle_up_down_anim.h index 8b91d890d..ea63095d2 100644 --- a/quantum/rgb_matrix_animations/cycle_up_down_anim.h +++ b/quantum/rgb_matrix_animations/cycle_up_down_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_up_down(effect_params_t* params) { @@ -11,6 +11,7 @@ bool rgb_matrix_cycle_up_down(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = point.y - time; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/dual_beacon_anim.h b/quantum/rgb_matrix_animations/dual_beacon_anim.h index dda315780..00f6e5088 100644 --- a/quantum/rgb_matrix_animations/dual_beacon_anim.h +++ b/quantum/rgb_matrix_animations/dual_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_dual_beacon(effect_params_t* params) { @@ -13,6 +13,7 @@ bool rgb_matrix_dual_beacon(effect_params_t* params) { int8_t cos_value = cos8(time) - 128; int8_t sin_value = sin8(time) - 128; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/gradient_up_down_anim.h b/quantum/rgb_matrix_animations/gradient_up_down_anim.h index 11498e22f..05117540a 100644 --- a/quantum/rgb_matrix_animations/gradient_up_down_anim.h +++ b/quantum/rgb_matrix_animations/gradient_up_down_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_gradient_up_down(effect_params_t* params) { @@ -10,6 +10,7 @@ bool rgb_matrix_gradient_up_down(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t scale = scale8(64, rgb_matrix_config.speed); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; // The y range will be 0..64, map this to 0..4 // Relies on hue being 8-bit and wrapping diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h index 01ff5c230..dffa53264 100644 --- a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h @@ -2,10 +2,11 @@ #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; -static void jellybean_raindrops_set_color(int i) { +static void jellybean_raindrops_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.val }; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); @@ -15,14 +16,14 @@ bool rgb_matrix_jellybean_raindrops(effect_params_t* params) { if (!params->init) { // Change one LED every tick, make sure speed is not 0 if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { - jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL); + jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); } return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (int i = led_min; i < led_max; i++) { - jellybean_raindrops_set_color(i); + jellybean_raindrops_set_color(i, params); } return led_max < DRIVER_LED_TOTAL; } diff --git a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h index 3c15e64ab..89f6965c3 100644 --- a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_beacon(effect_params_t* params) { @@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_beacon(effect_params_t* params) { int16_t cos_value = 2 * (cos8(time) - 128); int16_t sin_value = 2 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h index 0d11d5280..0d57aef57 100644 --- a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { @@ -11,6 +11,7 @@ bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = abs8(point.y - 32) + (point.x - time) + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h index d7cd42cbe..03652758c 100644 --- a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS extern rgb_counters_t g_rgb_counters; -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { @@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { int16_t cos_value = 3 * (cos8(time) - 128); int16_t sin_value = 3 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); point_t point = g_rgb_leds[i].point; hsv.h = ((point.y - 32) * cos_value + (56 - abs8(point.x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index fc721375b..0e3a87864 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h @@ -5,7 +5,8 @@ extern rgb_counters_t g_rgb_counters; extern rgb_config_t rgb_matrix_config; -static void raindrops_set_color(int i) { +static void raindrops_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; // Take the shortest path between hues @@ -25,14 +26,14 @@ bool rgb_matrix_raindrops(effect_params_t* params) { if (!params->init) { // Change one LED every tick, make sure speed is not 0 if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { - raindrops_set_color(rand() % DRIVER_LED_TOTAL); + raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); } return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (int i = led_min; i < led_max; i++) { - raindrops_set_color(i); + raindrops_set_color(i, params); } return led_max < DRIVER_LED_TOTAL; } diff --git a/quantum/rgb_matrix_animations/solid_color_anim.h b/quantum/rgb_matrix_animations/solid_color_anim.h index 24a197beb..033c1f933 100644 --- a/quantum/rgb_matrix_animations/solid_color_anim.h +++ b/quantum/rgb_matrix_animations/solid_color_anim.h @@ -8,6 +8,7 @@ bool rgb_matrix_solid_color(effect_params_t* params) { HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; RGB rgb = hsv_to_rgb(hsv); for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } return led_max < DRIVER_LED_TOTAL; diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h index 220e54233..836409dd6 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h @@ -13,6 +13,7 @@ bool rgb_matrix_solid_reactive(effect_params_t* params) { uint16_t max_tick = 65535 / rgb_matrix_config.speed; // Relies on hue being 8-bit and wrapping for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); uint16_t tick = max_tick; for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h index af602cba1..1dec1886d 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_par hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { + RGB_MATRIX_TEST_LED_FLAGS(); int16_t dx = point.x - g_last_hit_tracker.x[j]; int16_t dy = point.y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h index 8b4a139dc..8952a1e2b 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { + RGB_MATRIX_TEST_LED_FLAGS(); int16_t dx = point.x - g_last_hit_tracker.x[j]; int16_t dy = point.y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h index e84cd6939..d7bdb414e 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h @@ -12,6 +12,7 @@ bool rgb_matrix_solid_reactive_simple(effect_params_t* params) { // Max tick based on speed scale ensures results from scale16by8 with rgb_matrix_config.speed are no greater than 255 uint16_t max_tick = 65535 / rgb_matrix_config.speed; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); uint16_t tick = max_tick; for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h index abb01892e..d86cb1284 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_para hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { + RGB_MATRIX_TEST_LED_FLAGS(); int16_t dx = point.x - g_last_hit_tracker.x[j]; int16_t dy = point.y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); diff --git a/quantum/rgb_matrix_animations/solid_splash_anim.h b/quantum/rgb_matrix_animations/solid_splash_anim.h index 82ac055b8..14312f33d 100644 --- a/quantum/rgb_matrix_animations/solid_splash_anim.h +++ b/quantum/rgb_matrix_animations/solid_splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -12,6 +12,7 @@ static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* p HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); hsv.v = 0; point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { diff --git a/quantum/rgb_matrix_animations/splash_anim.h b/quantum/rgb_matrix_animations/splash_anim.h index 829d30eef..3c96d451e 100644 --- a/quantum/rgb_matrix_animations/splash_anim.h +++ b/quantum/rgb_matrix_animations/splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) -extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -12,6 +12,7 @@ static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) HSV hsv = { 0, rgb_matrix_config.sat, 0 }; uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); hsv.h = rgb_matrix_config.hue; hsv.v = 0; point_t point = g_rgb_leds[i].point; diff --git a/quantum/rgb_matrix_types.h b/quantum/rgb_matrix_types.h index 908e96da5..7a3bc6714 100644 --- a/quantum/rgb_matrix_types.h +++ b/quantum/rgb_matrix_types.h @@ -67,19 +67,21 @@ typedef union { }; } matrix_co_t; +#define HAS_FLAGS(bits, flags) ((bits & flags) == flags) +#define HAS_ANY_FLAGS(bits, flags) ((bits & flags) != 0x00) + +#define LED_FLAG_ALL 0xFF +#define LED_FLAG_NONE 0x00 +#define LED_FLAG_MODIFIER 0x01 +#define LED_FLAG_UNDERGLOW 0x02 +#define LED_FLAG_KEYLIGHT 0x04 + typedef struct PACKED { - matrix_co_t matrix_co; - point_t point; - uint8_t modifier:1; + matrix_co_t matrix_co; + point_t point; + uint8_t flags; } rgb_led; -typedef enum { - RGB_ZONE_OFF = 0, - RGB_ZONE_ALL, - RGB_ZONE_KEYS, - RGB_ZONE_UNDER, -} rgb_zone_t; - typedef union { uint32_t raw; struct PACKED { diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index e29fb6587..a2eab1b56 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -443,9 +443,9 @@ static void led_matrix_massdrop_config_override(int i) uint8_t highest_active_layer = biton32(layer_state); - if (led_lighting_mode == LED_MODE_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw == 0xff) { + if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { //Do not act on this LED - } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw != 0xff) { + } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { //Do not act on this LED } else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) { //Do not act on this LED (Only show indicators) -- cgit v1.2.3-70-g09d2 From 7c2a7ab817becfef88025b9bef80c4e212cc0913 Mon Sep 17 00:00:00 2001 From: Daniel Peregolise Date: Tue, 30 Apr 2019 15:11:57 -0400 Subject: [Keyboard] doro67 readme clarification (#5736) * readme clarification * Apply suggestions from code review verbiage updates Co-Authored-By: dperegolise * mechmerlin suggested verbiage --- keyboards/doro67/multi/keymaps/default/readme.md | 7 +++++++ keyboards/doro67/multi/keymaps/default_iso/readme.md | 7 +++++++ keyboards/doro67/multi/keymaps/default_multi/readme.md | 7 +++++++ keyboards/doro67/multi/readme.md | 7 +++++++ keyboards/doro67/regular/keymaps/default/readme.md | 4 ++++ keyboards/doro67/regular/readme.md | 4 ++++ keyboards/doro67/rgb/keymaps/default/readme.md | 6 ++++++ keyboards/doro67/rgb/readme.md | 6 ++++++ 8 files changed, 48 insertions(+) (limited to 'keyboards/doro67/rgb') diff --git a/keyboards/doro67/multi/keymaps/default/readme.md b/keyboards/doro67/multi/keymaps/default/readme.md index 6e63cde3a..9b9136b34 100644 --- a/keyboards/doro67/multi/keymaps/default/readme.md +++ b/keyboards/doro67/multi/keymaps/default/readme.md @@ -1,5 +1,12 @@ # Default Doro67 ANSI layout. +**THIS IS THE DEFAULT ANSI KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + This is the default ANSI layout that comes flashed on the Doro67 multi PCB with the exception of adding backtick as it was not mapped. diff --git a/keyboards/doro67/multi/keymaps/default_iso/readme.md b/keyboards/doro67/multi/keymaps/default_iso/readme.md index d375f0cc5..4b3d2ba4a 100644 --- a/keyboards/doro67/multi/keymaps/default_iso/readme.md +++ b/keyboards/doro67/multi/keymaps/default_iso/readme.md @@ -1,5 +1,12 @@ # Default Doro67 ISO layout. +**THIS IS THE DEFAULT ISO KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + This is the default ISO layout that comes flashed on the Doro67 multi PCB with the exception of adding backtick and UK ISO specific keycodes as they were not mapped. diff --git a/keyboards/doro67/multi/keymaps/default_multi/readme.md b/keyboards/doro67/multi/keymaps/default_multi/readme.md index e32f820c2..5761c006b 100644 --- a/keyboards/doro67/multi/keymaps/default_multi/readme.md +++ b/keyboards/doro67/multi/keymaps/default_multi/readme.md @@ -1,5 +1,12 @@ # Default Doro67 Multi layout. +**THIS IS THE DEFAULT MULTI-LAYOUT (SPLIT BACKSPACE) KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + This is the default Multi layout that comes flashed on the Doro67 multi PCB with the exception of adding backtick as it was not mapped. diff --git a/keyboards/doro67/multi/readme.md b/keyboards/doro67/multi/readme.md index 40fd53ee1..80465c3ac 100644 --- a/keyboards/doro67/multi/readme.md +++ b/keyboards/doro67/multi/readme.md @@ -2,6 +2,13 @@ 65% custom keyboard made by 80ultraman/Alf/Backprop Studios with multiple layout support. Despite the layout options available, layout is dictated by the selected integrated plate. +**MULTI-LAYOUT PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker). +The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased an RGB PCB, please see the 'rgb' directory. + Keyboard Maintainer: [ShadeDream](https://github.com/shadedream) Hardware Supported: Doro67 Multi PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) diff --git a/keyboards/doro67/regular/keymaps/default/readme.md b/keyboards/doro67/regular/keymaps/default/readme.md index 7443a357f..0af057d78 100644 --- a/keyboards/doro67/regular/keymaps/default/readme.md +++ b/keyboards/doro67/regular/keymaps/default/readme.md @@ -1 +1,5 @@ # The default keymap for doro67 + +**THIS IS THE DEFAULT KEYMAP DIRECTORY (AVAILABILITY: CHINA GB ONLY)** +If you are a non-china buyer, you probably have the multi PCB or rgb PCB. +Please look at the "multi" and "rgb" readme files. \ No newline at end of file diff --git a/keyboards/doro67/regular/readme.md b/keyboards/doro67/regular/readme.md index 7635a40f9..e2ef7bc64 100644 --- a/keyboards/doro67/regular/readme.md +++ b/keyboards/doro67/regular/readme.md @@ -4,6 +4,10 @@ This is not the PCB with RGB support. Do not flash RGB firmware for this board. +**REGULAR PCB (AVAILABILITY: CHINA GB ONLY)* +If you are a non-china buyer, you probably have the multi PCB or rgb PCB. +Please look at the "multi" and "rgb" readme files. + Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: Doro67 Regular PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) diff --git a/keyboards/doro67/rgb/keymaps/default/readme.md b/keyboards/doro67/rgb/keymaps/default/readme.md index 4ba5eb30f..eb5c49419 100644 --- a/keyboards/doro67/rgb/keymaps/default/readme.md +++ b/keyboards/doro67/rgb/keymaps/default/readme.md @@ -1 +1,7 @@ # The default keymap for rgb + +**RGB PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "rgb" directory includes the keymap for the RGB PCB. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased a non-rgb PCB, please see the 'multi' directory. \ No newline at end of file diff --git a/keyboards/doro67/rgb/readme.md b/keyboards/doro67/rgb/readme.md index 3a527c933..61c82d0d1 100644 --- a/keyboards/doro67/rgb/readme.md +++ b/keyboards/doro67/rgb/readme.md @@ -4,6 +4,12 @@ Flashing the regular PCB firmware on this board will work, but will disable RGB lighting. +**THIS IS THE RGB PCB DIRECTORY (AVAILABILITY: CHINA + INTERNATIONAL GB)** +The "rgb" directory includes the keymap for the RGB PCB. + +The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers. +If you purchased a non-rgb PCB, please see the 'multi' directory. + Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: Doro 67 RGB PCB Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0) -- cgit v1.2.3-70-g09d2 From af89752bffbaf5dcea30ea16be66b4d682701bc4 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 7 May 2019 18:22:46 -0500 Subject: 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 --- docs/feature_rgb_matrix.md | 32 +- keyboards/boston_meetup/2019/2019.c | 40 +- keyboards/crkbd/rev1/rev1.c | 125 +++--- keyboards/doro67/rgb/rgb.c | 103 ++--- keyboards/dztech/dz40rgb/dz40rgb.c | 163 ++------ keyboards/dztech/dz40rgb/keymaps/default/keymap.c | 6 +- .../dztech/dz40rgb/keymaps/split_space/keymap.c | 6 +- keyboards/dztech/dz60rgb/dz60rgb.c | 419 +++++---------------- keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c | 5 +- keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c | 5 +- keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c | 5 +- keyboards/dztech/dz60rgb/keymaps/iso/keymap.c | 5 +- keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c | 30 +- keyboards/dztech/dz65rgb/dz65rgb.c | 90 +---- keyboards/ergodox_ez/ergodox_ez.c | 99 ++--- keyboards/exclusive/e6_rgb/e6_rgb.c | 130 +++---- keyboards/hadron/ver3/ver3.c | 45 +-- keyboards/hs60/v1/v1.c | 218 ++++------- keyboards/massdrop/alt/config_led.c | 143 ++----- keyboards/massdrop/ctrl/config_led.c | 180 +++------ keyboards/model01/leds.c | 95 ++--- keyboards/planck/ez/ez.c | 78 ++-- keyboards/planck/keymaps/tom/keymap.c | 11 +- keyboards/planck/light/light.c | 87 ++--- keyboards/sol/rev1/rev1.c | 115 ++---- keyboards/sol/sol.c | 19 - layouts/community/ergodox/drashna/keymap.c | 7 +- layouts/community/ortho_4x12/drashna/keymap.c | 5 +- quantum/rgb_matrix.c | 16 +- quantum/rgb_matrix.h | 4 +- quantum/rgb_matrix_animations/alpha_mods_anim.h | 4 +- quantum/rgb_matrix_animations/cycle_all_anim.h | 2 +- .../rgb_matrix_animations/cycle_left_right_anim.h | 5 +- quantum/rgb_matrix_animations/cycle_up_down_anim.h | 5 +- quantum/rgb_matrix_animations/dual_beacon_anim.h | 5 +- .../rgb_matrix_animations/gradient_up_down_anim.h | 5 +- .../jellybean_raindrops_anim.h | 4 +- .../rgb_matrix_animations/rainbow_beacon_anim.h | 5 +- .../rainbow_moving_chevron_anim.h | 5 +- .../rgb_matrix_animations/rainbow_pinwheels_anim.h | 5 +- quantum/rgb_matrix_animations/raindrops_anim.h | 3 +- quantum/rgb_matrix_animations/solid_color_anim.h | 1 + .../rgb_matrix_animations/solid_reactive_anim.h | 1 + .../rgb_matrix_animations/solid_reactive_cross.h | 7 +- .../rgb_matrix_animations/solid_reactive_nexus.h | 7 +- .../solid_reactive_simple_anim.h | 1 + .../rgb_matrix_animations/solid_reactive_wide.h | 7 +- quantum/rgb_matrix_animations/solid_splash_anim.h | 7 +- quantum/rgb_matrix_animations/splash_anim.h | 7 +- quantum/rgb_matrix_types.h | 18 +- tmk_core/protocol/arm_atsam/led_matrix.c | 9 +- 51 files changed, 755 insertions(+), 1644 deletions(-) (limited to 'keyboards/doro67/rgb') diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 91ec77ace..5eb9d5536 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -124,21 +124,25 @@ Configure the hardware via your `config.h`: --- -From this point forward the configuration is the same for all the drivers. The struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example: +From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example: ```C -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, - .... -} +const led_config_t g_led_config = { { + // Key Matrix to LED Index + { 5, NO_LED, NO_LED, 0 }, + { NO_LED, NO_LED, NO_LED, NO_LED }, + { 4, NO_LED, NO_LED, 1 }, + { 3, NO_LED, NO_LED, 2 } +}, { + // LED Index to Physical Position + { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 } +}, { + // LED Index to Flag + 1, 4, 4, 4, 4, 1 +} }; ``` -The first part, `{row | col << 4}`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `{x=0..224, y=0..64}` represents the LED's physical position on the keyboard. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64 as the effects are based on this range. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position: +The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical position on the keyboard. The first value, `x`, is between 0-224 (inclusive), and the second value, `y`, is between 0-64 (inclusive). This range is due to effect that calculate the center or halves for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position: ```C x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION @@ -147,7 +151,7 @@ y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. -`flags` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. +`// LED Index to Flag` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. ## Flags @@ -155,8 +159,8 @@ Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based |------------------------------------|-------------------------------------------| |`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.| |`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.| -|`#define LED_FLAG_NONE 0x00` |If thes LED has no flags. | -|`#define LED_FLAG_ALL 0xFF` |If thes LED has all flags. | +|`#define LED_FLAG_NONE 0x00` |If this LED has no flags. | +|`#define LED_FLAG_ALL 0xFF` |If this LED has all flags. | |`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. | |`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. | |`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. | diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c index 45c185549..933c14dee 100644 --- a/keyboards/boston_meetup/2019/2019.c +++ b/keyboards/boston_meetup/2019/2019.c @@ -19,20 +19,18 @@ #include "haptic.h" #ifdef RGB_MATRIX_ENABLE -#include "rgblight.h" - -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /*{row | col << 4} - | {x=0..224, y=0..64} - | | modifier - | | | */ - {{1|(3<<4)}, {188, 16}, 4}, - {{3|(3<<4)}, {187, 48}, 4}, - {{4|(2<<4)}, {149, 64}, 4}, - {{4|(1<<4)}, {112, 64}, 4}, - {{3|(0<<4)}, {37, 48}, 4}, - {{1|(0<<4)}, {38, 16}, 4} -}; +#include "rgb_matrix.h" + +led_config_t g_led_config = { { + { 5, NO_LED, NO_LED, 0 }, + { NO_LED, NO_LED, NO_LED, NO_LED }, + { 4, NO_LED, NO_LED, 1 }, + { 3, NO_LED, NO_LED, 2 } +}, { + { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 } +}, { + 4, 4, 4, 4, 4, 4 +} }; #endif uint8_t *o_fb; @@ -48,12 +46,12 @@ uint16_t counterst = 0; #define ScreenOffInterval 60000 /* milliseconds */ static uint16_t last_flush; -volatile uint8_t led_numlock = false; -volatile uint8_t led_capslock = false; +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; volatile uint8_t led_scrolllock = false; static uint8_t layer; -static bool queue_for_send = false; +static bool queue_for_send = false; static uint8_t encoder_value = 32; __attribute__ ((weak)) @@ -64,13 +62,13 @@ void draw_ui(void) { /* Boston MK title is 55 x 10 pixels */ #define NAME_X 0 -#define NAME_Y 0 +#define NAME_Y 0 draw_string(NAME_X + 1, NAME_Y + 2, "BOSTON MK", PIXEL_ON, NORM, 0); /* Layer indicator is 41 x 10 pixels */ #define LAYER_INDICATOR_X 60 -#define LAYER_INDICATOR_Y 0 +#define LAYER_INDICATOR_Y 0 draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); @@ -88,7 +86,7 @@ void draw_ui(void) { draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM); } - } + } draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 12, 12, PIXEL_ON, NORM); /* hadron oled location on thumbnail */ draw_rect_filled_soft(MATRIX_DISPLAY_X + 5, MATRIX_DISPLAY_Y + 2, 6, 2, PIXEL_ON, NORM); @@ -195,7 +193,7 @@ void matrix_init_kb(void) { queue_for_send = true; matrix_init_user(); } - + void matrix_scan_kb(void) { if (queue_for_send) { #ifdef QWIIC_MICRO_OLED_ENABLE diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c index 2345028d2..38ab92788 100644 --- a/keyboards/crkbd/rev1/rev1.c +++ b/keyboards/crkbd/rev1/rev1.c @@ -51,78 +51,65 @@ void led_set_kb(uint8_t usb_led) { // 05 06 06 05 // 15 14 07 07 14 15 3 -/* {row | col << 4} logical layout rows/cols - * | {x=0..224, y=0..64} physical layout - * | | | modifier - * | | | */ -#define RGB_MATRIX_LEFT_LEDS \ - { { 0xFF }, { 85, 16 }, 2 }, /* 1 */ \ - { { 0xFF }, { 50, 13 }, 2 }, /* 2 */ \ - { { 0xFF }, { 16, 20 }, 2 }, /* 3 */ \ - { { 0xFF }, { 16, 38 }, 2 }, /* 4 */ \ - { { 0xFF }, { 50, 48 }, 2 }, /* 5 */ \ - { { 0xFF }, { 85, 52 }, 2 }, /* 6 */ \ - { { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, /* 7 */ \ - { { 2 | ( 5 << 4 ) }, { 85, 39 }, 4 }, /* 8 */ \ - { { 1 | ( 5 << 4 ) }, { 85, 21 }, 4 }, /* 9 */ \ - { { 0 | ( 5 << 4 ) }, { 85, 4 }, 4 }, /* 10 */ \ - { { 0 | ( 4 << 4 ) }, { 68, 02 }, 4 }, /* 11 */ \ - { { 1 | ( 4 << 4 ) }, { 68, 19 }, 4 }, /* 12 */ \ - { { 2 | ( 4 << 4 ) }, { 68, 37 }, 4 }, /* 13 */ \ - { { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, /* 14 */ \ - { { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, /* 15 */ \ - { { 2 | ( 3 << 4 ) }, { 50, 35 }, 4 }, /* 16 */ \ - { { 1 | ( 3 << 4 ) }, { 50, 13 }, 4 }, /* 17 */ \ - { { 0 | ( 3 << 4 ) }, { 50, 0 }, 4 }, /* 18 */ \ - { { 0 | ( 2 << 4 ) }, { 33, 3 }, 4 }, /* 19 */ \ - { { 1 | ( 2 << 4 ) }, { 33, 20 }, 4 }, /* 20 */ \ - { { 2 | ( 2 << 4 ) }, { 33, 37 }, 4 }, /* 21 */ \ - { { 2 | ( 1 << 4 ) }, { 16, 42 }, 4 }, /* 22 */ \ - { { 1 | ( 1 << 4 ) }, { 16, 24 }, 4 }, /* 23 */ \ - { { 0 | ( 1 << 4 ) }, { 16, 7 }, 4 }, /* 24 */ \ - { { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, /* 25 */ \ - { { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, /* 26 */ \ - { { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, /* 27 */ - -#define RGB_MATRIX_RIGHT_LEDS \ - { { 0xFF }, { 139, 16 }, 2 }, /* 1 */ \ - { { 0xFF }, { 174, 13 }, 2 }, /* 2 */ \ - { { 0xFF }, { 208, 20 }, 2 }, /* 3 */ \ - { { 0xFF }, { 208, 38 }, 2 }, /* 4 */ \ - { { 0xFF }, { 174, 48 }, 2 }, /* 5 */ \ - { { 0xFF }, { 139, 52 }, 2 }, /* 6 */ \ - { { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, /* 7 */ \ - { { 6 | ( 5 << 4 ) }, { 139, 39 }, 4 }, /* 8 */ \ - { { 5 | ( 5 << 4 ) }, { 139, 21 }, 4 }, /* 9 */ \ - { { 4 | ( 5 << 4 ) }, { 139, 4 }, 4 }, /* 10 */ \ - { { 4 | ( 4 << 4 ) }, { 156, 02 }, 4 }, /* 11 */ \ - { { 5 | ( 4 << 4 ) }, { 156, 19 }, 4 }, /* 12 */ \ - { { 6 | ( 4 << 4 ) }, { 156, 37 }, 4 }, /* 13 */ \ - { { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, /* 14 */ \ - { { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, /* 15 */ \ - { { 6 | ( 3 << 4 ) }, { 174, 35 }, 4 }, /* 16 */ \ - { { 5 | ( 3 << 4 ) }, { 174, 13 }, 4 }, /* 17 */ \ - { { 4 | ( 3 << 4 ) }, { 174, 0 }, 4 }, /* 18 */ \ - { { 4 | ( 2 << 4 ) }, { 191, 3 }, 4 }, /* 19 */ \ - { { 5 | ( 2 << 4 ) }, { 191, 20 }, 4 }, /* 20 */ \ - { { 6 | ( 2 << 4 ) }, { 191, 37 }, 4 }, /* 21 */ \ - { { 6 | ( 1 << 4 ) }, { 208, 42 }, 4 }, /* 22 */ \ - { { 5 | ( 1 << 4 ) }, { 208, 24 }, 4 }, /* 23 */ \ - { { 4 | ( 1 << 4 ) }, { 208, 7 }, 4 }, /* 24 */ \ - { { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, /* 25 */ \ - { { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, /* 26 */ \ - { { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, /* 27 */ #ifdef RGB_MATRIX_SPLIT_RIGHT -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - RGB_MATRIX_RIGHT_LEDS - RGB_MATRIX_LEFT_LEDS - }; +led_config_t g_led_config = { { + { 51, 50, 45, 44, 37, 36, NO_LED }, + { 52, 49, 46, 43, 38, 35, NO_LED }, + { 53, 48, 47, 42, 39, 34, NO_LED }, + { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED }, + { 24, 23, 18, 17, 10, 9, NO_LED }, + { 25, 22, 19, 16, 11, 8, NO_LED }, + { 26, 21, 20, 15, 12, 7, NO_LED }, + { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED } +}, { + { 139, 16 }, { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 }, + { 139, 39 }, { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 }, + { 164, 55 }, { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 }, + { 208, 42 }, { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 }, { 85, 16 }, + { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 }, { 85, 39 }, + { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 }, { 60, 55 }, + { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 }, { 16, 42 }, + { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 } +}, { + 2, 2, 2, 2, 2, 2, 1, + 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 4, + 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1 +} }; #else -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - RGB_MATRIX_LEFT_LEDS - RGB_MATRIX_RIGHT_LEDS - }; +led_config_t g_led_config = { { + { 24, 23, 18, 17, 10, 9, NO_LED }, + { 25, 22, 19, 16, 11, 8, NO_LED }, + { 26, 21, 20, 15, 12, 7, NO_LED }, + { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED }, + { 51, 50, 45, 44, 37, 36, NO_LED }, + { 52, 49, 46, 43, 38, 35, NO_LED }, + { 53, 48, 47, 42, 39, 34, NO_LED }, + { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED } +}, { + { 85, 16 }, { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 }, + { 85, 39 }, { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 }, + { 60, 55 }, { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 }, + { 16, 42 }, { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 }, { 139, 16 }, + { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 }, { 139, 39 }, + { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 }, { 164, 55 }, + { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 }, { 208, 42 }, + { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 } +}, { + 2, 2, 2, 2, 2, 2, 1, + 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 1, 4, + 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1 +} }; #endif #endif diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c index 8aaf6ef4a..e8c9ac632 100644 --- a/keyboards/doro67/rgb/rgb.c +++ b/keyboards/doro67/rgb/rgb.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ #include "rgb.h" +#include "rgb_matrix_types.h" // Optional override functions below. // You can leave any or all of these undefined. @@ -52,76 +53,32 @@ void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(0<<4)}, {15*0, 0}, 4}, // Esc - {{0|(1<<4)}, {15*1, 0}, 4}, // 1 - {{0|(2<<4)}, {15*2, 0}, 4}, // 2 - {{0|(3<<4)}, {15*3, 0}, 4}, // 3 - {{0|(4<<4)}, {15*4, 0}, 4}, // 4 - {{0|(5<<4)}, {15*5, 0}, 4}, // 5 - {{0|(6<<4)}, {15*6, 0}, 4}, // 6 - {{0|(7<<4)}, {15*7, 0}, 4}, // 7 - {{0|(8<<4)}, {15*8, 0}, 4}, // 8 - {{0|(9<<4)}, {15*9, 0}, 4}, // 9 - {{0|(10<<4)}, {15*10, 0}, 4}, // 0 - {{0|(11<<4)}, {15*11, 0}, 4}, // - - {{0|(12<<4)}, {15*12, 0}, 4}, // = - {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace - {{0|(14<<4)}, {15*15, 0}, 1}, // Ins - - {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab - {{1|(1<<4)}, {15*1.5, 16}, 4}, // Q - {{1|(2<<4)}, {15*2.5, 16}, 4}, // W - {{1|(3<<4)}, {15*3.5, 16}, 4}, // E - {{1|(4<<4)}, {15*4.5, 16}, 4}, // R - {{1|(5<<4)}, {15*5.5, 16}, 4}, // T - {{1|(6<<4)}, {15*6.5, 16}, 4}, // Y - {{1|(7<<4)}, {15*7.5, 16}, 4}, // U - {{1|(8<<4)}, {15*8.5, 16}, 4}, // I - {{1|(9<<4)}, {15*9.5, 16}, 4}, // O - {{1|(10<<4)}, {15*10.5, 16}, 4}, // P - {{1|(11<<4)}, {15*11.5, 16}, 4}, // [ - {{1|(12<<4)}, {15*12.5, 16}, 4}, // ] - {{1|(13<<4)}, {15*13.75, 16}, 1}, // - {{1|(14<<4)}, {15*15, 16}, 1}, // Del - - {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock - {{2|(1<<4)}, {15*1.75, 32}, 4}, // A - {{2|(2<<4)}, {15*2.75, 32}, 4}, // S - {{2|(3<<4)}, {15*3.75, 32}, 4}, // D - {{2|(4<<4)}, {15*4.75, 32}, 4}, // F - {{2|(5<<4)}, {15*5.75, 32}, 4}, // G - {{2|(6<<4)}, {15*6.75, 32}, 4}, // H - {{2|(7<<4)}, {15*7.75, 32}, 4}, // J - {{2|(8<<4)}, {15*8.75, 32}, 4}, // K - {{2|(9<<4)}, {15*9.75, 32}, 4}, // L - {{2|(10<<4)}, {15*10.75, 32}, 4}, // ; - {{2|(11<<4)}, {15*11.75, 32}, 4}, // ' - {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter - {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup - - {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift - {{3|(2<<4)}, {15*2, 48}, 4}, // Z - {{3|(3<<4)}, {15*3, 48}, 4}, // X - {{3|(4<<4)}, {15*4, 48}, 4}, // C - {{3|(5<<4)}, {15*5, 48}, 4}, // V - {{3|(6<<4)}, {15*6, 48}, 4}, // B - {{3|(7<<4)}, {15*7, 48}, 4}, // N - {{3|(8<<4)}, {15*8, 48}, 4}, // M - {{3|(9<<4)}, {15*9, 48}, 4}, // , - {{3|(10<<4)}, {15*10, 48}, 4}, // . - {{3|(11<<4)}, {15*11, 48}, 4}, // / - {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift - {{3|(13<<4)}, {15*14, 48}, 1}, // Up - {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn - - {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl - {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI - {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt - {{4|(3<<4)}, {15*6.75, 64}, 4}, // Space - {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt - {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN - {{4|(12<<4)}, {15*13, 64}, 1}, // Left - {{4|(13<<4)}, {15*14, 64}, 1}, // Down - {{4|(14<<4)}, {15*15, 64}, 1}, // Right -}; +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, + { 58, 59, 60, 61, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 62, 63, NO_LED, 64, 65, 66 } +}, { + // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins + { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 202, 0 }, { 225, 0 }, + // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del + { 7, 16 }, { 22, 16 }, { 37, 16 }, { 52, 16 }, { 67, 16 }, { 82, 16 }, { 97, 16 }, { 112, 16 }, { 127, 16 }, { 142, 16 }, { 157, 16 }, { 172, 16 }, { 187, 16 }, { 206, 16 }, { 225, 16 }, + // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup + { 11, 32 }, { 26, 32 }, { 41, 32 }, { 56, 32 }, { 71, 32 }, { 86, 32 }, { 101, 32 }, { 116, 32 }, { 131, 32 }, { 146, 32 }, { 161, 32 }, { 176, 32 }, { 198, 32 }, { 225, 32 }, + // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn + { 18, 48 }, { 30, 48 }, { 45, 48 }, { 60, 48 }, { 75, 48 }, { 90, 48 }, { 105, 48 }, { 120, 48 }, { 135, 48 }, { 150, 48 }, { 165, 48 }, { 191, 48 }, { 210, 48 }, { 225, 48 }, + // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right + { 3, 64 }, { 22, 64 }, { 33, 64 }, { 101, 64 }, { 135, 64 }, { 153, 64 }, { 195, 64 }, { 210, 64 }, { 225, 64 } +}, { + // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right + 1, 1, 1, 4, 1, 1, 1, 1, 1 +} }; diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c index 34bfc4366..e5e39c92a 100644 --- a/keyboards/dztech/dz40rgb/dz40rgb.c +++ b/keyboards/dztech/dz40rgb/dz40rgb.c @@ -52,7 +52,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_3, D_3, F_3}, {0, E_2, D_2, F_2}, {0, E_1, D_1, F_1}, - + {0, E_13, D_13, F_13}, {0, E_14, D_14, F_14}, @@ -71,70 +71,25 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - - {{0|(11<<4)}, {20.36*11, 0}, 1}, - {{0|(10<<4)}, {20.36*10, 0}, 1}, - {{0|(9<<4)}, {20.36*9, 0}, 1}, - {{0|(8<<4)}, {20.36*8, 0}, 1}, - {{0|(7<<4)}, {20.36*7, 0}, 1}, - {{0|(6<<4)}, { 20.36*6, 0}, 1}, - {{0|(5<<4)}, { 20.36*5, 0}, 1}, - {{0|(4<<4)}, { 20.36*4, 0}, 1}, - {{0|(3<<4)}, { 20.36*3, 0}, 1}, - {{0|(2<<4)}, { 20.36*2, 0}, 1}, - {{0|(1<<4)}, { 20.36*1, 0}, 1}, - {{0|(0<<4)}, { 20.36*0, 0}, 1}, - - {{0|(12<<4)}, {20.36*11, 21.33*0.5}, 1}, - {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, - - {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 4}, - {{1|(9<<4)}, {20.36*9, 21.33}, 4}, - {{1|(8<<4)}, {20.36*8, 21.33}, 4}, - {{1|(7<<4)}, {20.36*7, 21.33}, 4}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, - {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, - - {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, - {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, +led_config_t g_led_config = { { + { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28 }, + { 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42 } +}, { + { 223, 0 }, { 203, 0 }, { 183, 0 }, { 162, 0 }, { 142, 0 }, { 122, 0 }, { 101, 0 }, { 81, 0 }, { 61, 0 }, { 40, 0 }, { 20, 0 }, { 0, 0 }, + { 223, 10 }, { 0, 10 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, + { 20, 21 }, { 0, 21 }, { 223, 31 }, { 0, 31 }, { 223, 42 }, { 203, 42 }, { 183, 42 }, { 162, 42 }, { 142, 42 }, { 122, 42 }, { 101, 42 }, { 81, 42 }, + { 61, 42 }, { 40, 42 }, { 20, 42 }, { 0, 42 }, { 223, 53 }, { 0, 53 }, { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 122, 63 }, + { 101, 63 }, { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1 +} }; - {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, - {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, - - {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, - {{2|(13<<4)}, {20.36*0,21.33*2.5}, 1}, - - {{3|(11<<4)}, {20.36*11, 21.33*3}, 1}, - {{3|(10<<4)}, {20.36*10, 21.33*3}, 1}, - {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, - {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, - {{3|(6<<4)}, { 20.36*6, 21.33*3}, 1}, - {{3|(5<<4)}, { 20.36*5, 21.33*3}, 1}, - {{3|(4<<4)}, { 20.36*4, 21.33*3}, 1}, - {{3|(3<<4)}, { 20.36*3, 21.33*3}, 1}, - {{3|(2<<4)}, { 20.36*2, 21.33*3}, 1}, - {{3|(1<<4)}, { 20.36*1, 21.33*3}, 1}, - {{3|(0<<4)}, { 20.36*0, 21.33*3}, 1} - -}; #else const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations @@ -205,69 +160,25 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28 }, + { 52, 51, 50, 49, 48, NO_LED, 47, 46, 45, 44, 43, 42 } +}, { + { 223, 0 }, { 203, 0 }, { 183, 0 }, { 162, 0 }, { 142, 0 }, { 122, 0 }, { 101, 0 }, { 81, 0 }, { 61, 0 }, { 40, 0 }, { 20, 0 }, { 0, 0 }, + { 223, 10 }, { 0, 10 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, + { 20, 21 }, { 0, 21 }, { 223, 31 }, { 0, 31 }, { 223, 42 }, { 203, 42 }, { 183, 42 }, { 162, 42 }, { 142, 42 }, { 122, 42 }, { 101, 42 }, { 81, 42 }, + { 61, 42 }, { 40, 42 }, { 20, 42 }, { 0, 42 }, { 223, 53 }, { 0, 53 }, { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 111, 63 }, + { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 +} }; - {{0|(11<<4)}, {20.36*11, 0}, 1}, - {{0|(10<<4)}, {20.36*10, 0}, 1}, - {{0|(9<<4)}, {20.36*9, 0}, 1}, - {{0|(8<<4)}, {20.36*8, 0}, 1}, - {{0|(7<<4)}, {20.36*7, 0}, 1}, - {{0|(6<<4)}, { 20.36*6, 0}, 1}, - {{0|(5<<4)}, { 20.36*5, 0}, 1}, - {{0|(4<<4)}, { 20.36*4, 0}, 1}, - {{0|(3<<4)}, { 20.36*3, 0}, 1}, - {{0|(2<<4)}, { 20.36*2, 0}, 1}, - {{0|(1<<4)}, { 20.36*1, 0}, 1}, - {{0|(0<<4)}, { 20.36*0, 0}, 1}, - - {{0|(12<<4)}, {20.36*11, 21.33*0.5}, 1}, - {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, - - {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 4}, - {{1|(9<<4)}, {20.36*9, 21.33}, 4}, - {{1|(8<<4)}, {20.36*8, 21.33}, 4}, - {{1|(7<<4)}, {20.36*7, 21.33}, 4}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, - {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, - - {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, - {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, - - {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, - {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, - - {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, - {{2|(13<<4)}, {20.36*0,21.33*2.5}, 1}, - - {{3|(11<<4)}, {20.36*11, 21.33*3}, 1}, - {{3|(10<<4)}, {20.36*10, 21.33*3}, 1}, - {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, - {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, - {{3|(6<<4)}, { 20.36*5.5, 21.33*3}, 1}, - {{3|(4<<4)}, { 20.36*4, 21.33*3}, 1}, - {{3|(3<<4)}, { 20.36*3, 21.33*3}, 1}, - {{3|(2<<4)}, { 20.36*2, 21.33*3}, 1}, - {{3|(1<<4)}, { 20.36*1, 21.33*3}, 1}, - {{3|(0<<4)}, { 20.36*0, 21.33*3}, 1} - -}; #endif diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c index 59b917121..650c178a7 100644 --- a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c @@ -31,11 +31,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; + +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c index 5613e3500..80741b19c 100644 --- a/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c @@ -53,12 +53,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/dz60rgb.c b/keyboards/dztech/dz60rgb/dz60rgb.c index 10b2ea7a8..28ac7ce9e 100644 --- a/keyboards/dztech/dz60rgb/dz60rgb.c +++ b/keyboards/dztech/dz60rgb/dz60rgb.c @@ -65,69 +65,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(13<<4)}, {16*13.5, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.875, 64}, 1}, - {{4|(11<<4)}, {16*12.625, 64}, 1}, - {{4|(10<<4)}, {16*11.375, 64}, 1}, - {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 4}, - {{4|(2<<4)}, { 16*2.625, 64}, 1}, - {{4|(1<<4)}, { 16*1.375, 64}, 1}, - {{4|(0<<4)}, { 16*0.125, 64}, 1}, -}; +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 28 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 14 }, + { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, NO_LED }, + { 60, 59, 58, NO_LED, NO_LED, 57, NO_LED, NO_LED, NO_LED, 56, 55, 54, NO_LED, 53 } +}, { + { 216, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, 0 }, + { 220, 24 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, + { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 210, 48 }, + { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 222, 64 }, { 202, 64 }, { 182, 64 }, + { 162, 64 }, { 102, 64 }, { 42, 64 }, { 22, 64 }, { 2, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, + 1, 4, 1, 1, 1 +} }; + #elif defined (dzrgb60_hhkb) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_15, G_15, I_15}, @@ -194,70 +151,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{2|(12<<4)}, {16*14, 0}, 1}, - {{0|(13<<4)}, {16*13, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{2|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 4}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.625, 64}, 1}, - {{4|(11<<4)}, {16*12.375, 64}, 1}, - {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 4}, - {{4|(2<<4)}, { 16*2.875, 64}, 1}, - {{4|(1<<4)}, { 16*1.625, 64}, 1}, - {{4|(0<<4)}, { 16*0.375, 64}, 1}, -}; +led_config_t g_led_config = { { + { 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, + { 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15 }, + { 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 0, 29 }, + { 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, NO_LED, 42 }, + { 61, 60, 59, NO_LED, NO_LED, 58, NO_LED, NO_LED, NO_LED, NO_LED, 57, 56, NO_LED, 55 } +}, { + { 224, 0 }, { 208, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, + { 0, 0 }, { 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, + { 4, 16 }, { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, + { 224, 48 }, { 202, 48 }, { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 218, 64 }, + { 198, 64 }, { 178, 64 }, { 112, 64 }, { 46, 64 }, { 26, 64 }, { 6, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 1, 1, 1 +} }; + #elif defined (dzrgb60_hhkb_iso) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, H_15, G_15, I_15}, @@ -324,70 +237,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{2|(12<<4)}, {16*14, 0}, 1}, - {{0|(13<<4)}, {16*13, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{2|(13<<4)}, {16*13.75, 24}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{1|(13<<4)}, {16*12.75, 32}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(13<<4)}, {16*14, 48}, 1}, - {{3|(11<<4)}, {16*12.625, 48}, 4}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.625, 64}, 1}, - {{4|(11<<4)}, {16*12.375, 64}, 1}, - {{4|(10<<4)}, {16*11.125, 64}, 1}, - {{4|(5<<4)}, { 16*7, 64}, 4}, - {{4|(2<<4)}, { 16*2.875, 64}, 1}, - {{4|(1<<4)}, { 16*1.625, 64}, 1}, - {{4|(0<<4)}, { 16*0.375, 64}, 1}, -}; +led_config_t g_led_config = { { + { 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }, + { 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29 }, + { 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 0, 15 }, + { 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, NO_LED, 42 }, + { 61, 60, 59, NO_LED, NO_LED, 58, NO_LED, NO_LED, NO_LED, NO_LED, 57, 56, NO_LED, 55 } +}, { + { 224, 0 }, { 208, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, + { 0, 0 }, { 220, 24 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, + { 4, 16 }, { 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, + { 224, 48 }, { 202, 48 }, { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 218, 64 }, + { 198, 64 }, { 178, 64 }, { 112, 64 }, { 46, 64 }, { 26, 64 }, { 6, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 4, 1, 1, 1 +} }; + #elif defined (dzrgb60_ansi) const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_14, J_14, L_14}, @@ -453,69 +322,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(13<<4)}, {16*13.5, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{1|(13<<4)}, {16*13.75, 16}, 1}, - {{1|(12<<4)}, {16*12.5, 16}, 4}, - {{1|(11<<4)}, {16*11.5, 16}, 4}, - {{1|(10<<4)}, {16*10.5, 16}, 4}, - {{1|(9<<4)}, { 16*9.5, 16}, 4}, - {{1|(8<<4)}, { 16*8.5, 16}, 4}, - {{1|(7<<4)}, { 16*7.5, 16}, 4}, - {{1|(6<<4)}, { 16*6.5, 16}, 4}, - {{1|(5<<4)}, { 16*5.5, 16}, 4}, - {{1|(4<<4)}, { 16*4.5, 16}, 4}, - {{1|(3<<4)}, { 16*3.5, 16}, 4}, - {{1|(2<<4)}, { 16*2.5, 16}, 4}, - {{1|(1<<4)}, { 16*1.5, 16}, 4}, - {{1|(0<<4)}, { 16*0.25, 16}, 1}, - {{2|(13<<4)}, {16*13.375, 24}, 1}, - {{2|(11<<4)}, {16*11.75, 32}, 4}, - {{2|(10<<4)}, {16*10.75, 32}, 4}, - {{2|(9<<4)}, {16*9.75, 32}, 4}, - {{2|(8<<4)}, {16*8.75, 32}, 4}, - {{2|(7<<4)}, {16*7.75, 32}, 4}, - {{2|(6<<4)}, { 16*6.75, 32}, 4}, - {{2|(5<<4)}, { 16*5.75, 32}, 4}, - {{2|(4<<4)}, { 16*4.75, 32}, 4}, - {{2|(3<<4)}, { 16*3.75, 32}, 4}, - {{2|(2<<4)}, { 16*2.75, 32}, 4}, - {{2|(1<<4)}, { 16*1.75, 32}, 4}, - {{2|(0<<4)}, { 16*0.375, 32}, 1}, - {{3|(11<<4)}, {16*13.125, 48}, 1}, - {{3|(10<<4)}, {16*11.25, 48}, 4}, - {{3|(9<<4)}, {16*10.25, 48}, 4}, - {{3|(8<<4)}, {16*9.25, 48}, 4}, - {{3|(7<<4)}, {16*8.25, 48}, 4}, - {{3|(6<<4)}, {16*7.25, 48}, 4}, - {{3|(5<<4)}, {16*6.25, 48}, 4}, - {{3|(4<<4)}, {16*5.25, 48}, 4}, - {{3|(3<<4)}, {16*4.25, 48}, 4}, - {{3|(2<<4)}, {16*3.25, 48}, 4}, - {{3|(1<<4)}, {16*1.25, 48}, 4}, - {{3|(0<<4)}, {16*0.625, 48}, 1}, - {{4|(13<<4)}, {16*13.875, 64}, 1}, - {{4|(11<<4)}, {16*12.625, 64}, 1}, - {{4|(10<<4)}, {16*11.375, 64}, 1}, - {{4|(9<<4)}, {16*10.125, 64}, 1}, - {{4|(5<<4)}, { 16*6.375, 64}, 4}, - {{4|(2<<4)}, { 16*2.625, 64}, 1}, - {{4|(1<<4)}, { 16*1.375, 64}, 1}, - {{4|(0<<4)}, { 16*0.125, 64}, 1}, -}; +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 28 }, + { 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, NO_LED, NO_LED }, + { 60, 59, 58, NO_LED, NO_LED, 57, NO_LED, NO_LED, NO_LED, 56, 55, 54, NO_LED, 53 } +}, { + { 216, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, 0 }, + { 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, + { 214, 24 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 210, 48 }, + { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 222, 64 }, { 202, 64 }, { 182, 64 }, + { 162, 64 }, { 102, 64 }, { 42, 64 }, { 22, 64 }, { 2, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, + 1, 4, 1, 1, 1 +} }; + #else const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_14, J_14, L_14}, @@ -583,71 +409,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, K_16, J_16, L_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(13<<4)}, {17.23*13, 0}, 1}, - {{0|(12<<4)}, {17.23*12, 0}, 1}, - {{0|(11<<4)}, {17.23*11, 0}, 1}, - {{0|(10<<4)}, {17.23*10, 0}, 1}, - {{0|(9<<4)}, {17.23*9, 0}, 1}, - {{0|(8<<4)}, {17.23*8, 0}, 1}, - {{0|(7<<4)}, {17.23*7, 0}, 1}, - {{0|(6<<4)}, { 17.23*6, 0}, 1}, - {{0|(5<<4)}, { 17.23*5, 0}, 1}, - {{0|(4<<4)}, { 17.23*4, 0}, 1}, - {{0|(3<<4)}, { 17.23*3, 0}, 1}, - {{0|(2<<4)}, { 17.23*2, 0}, 1}, - {{0|(1<<4)}, { 17.23*1, 0}, 1}, - {{0|(0<<4)}, { 17.23*0, 0}, 1}, - {{1|(13<<4)}, {17.23*13, 16}, 1}, - {{1|(12<<4)}, {17.23*12, 16}, 4}, - {{1|(11<<4)}, {17.23*11, 16}, 4}, - {{1|(10<<4)}, {17.23*10, 16}, 4}, - {{1|(9<<4)}, {17.23*9, 16}, 4}, - {{1|(8<<4)}, {17.23*8, 16}, 4}, - {{1|(7<<4)}, {17.23*7, 16}, 4}, - {{1|(6<<4)}, { 17.23*6, 16}, 4}, - {{1|(5<<4)}, { 17.23*5, 16}, 4}, - {{1|(4<<4)}, { 17.23*4, 16}, 4}, - {{1|(3<<4)}, { 17.23*3, 16}, 4}, - {{1|(2<<4)}, { 17.23*2, 16}, 4}, - {{1|(1<<4)}, { 17.23*1, 16}, 4}, - {{1|(0<<4)}, { 17.23*0, 16}, 1}, - {{2|(13<<4)}, {17.23*13, 32}, 1}, - {{2|(11<<4)}, {17.23*11, 32}, 4}, - {{2|(10<<4)}, {17.23*10, 32}, 4}, - {{2|(9<<4)}, {17.23*9, 32}, 4}, - {{2|(8<<4)}, {17.23*8, 32}, 4}, - {{2|(7<<4)}, {17.23*7, 32}, 4}, - {{2|(6<<4)}, { 17.23*6, 32}, 4}, - {{2|(5<<4)}, { 17.23*5, 32}, 4}, - {{2|(4<<4)}, { 17.23*4, 32}, 4}, - {{2|(3<<4)}, { 17.23*3, 32}, 4}, - {{2|(2<<4)}, { 17.23*2, 32}, 4}, - {{2|(1<<4)}, { 17.23*1, 32}, 4}, - {{2|(0<<4)}, { 17.23*0, 32}, 1}, - {{3|(13<<4)}, {17.23*13, 48}, 1}, - {{3|(11<<4)}, {17.23*11, 48}, 4}, - {{3|(10<<4)}, {17.23*10, 48}, 4}, - {{3|(9<<4)}, {17.23*9, 48}, 4}, - {{3|(8<<4)}, {17.23*8, 48}, 4}, - {{3|(7<<4)}, {17.23*7, 48}, 4}, - {{3|(6<<4)}, { 17.23*6, 48}, 4}, - {{3|(5<<4)}, { 17.23*5, 48}, 4}, - {{3|(4<<4)}, { 17.23*4, 48}, 4}, - {{3|(3<<4)}, { 17.23*3, 48}, 4}, - {{3|(2<<4)}, { 17.23*2, 48}, 4}, - {{3|(1<<4)}, { 17.23*1, 48}, 4}, - {{3|(0<<4)}, { 17.23*0, 48}, 1}, - {{4|(13<<4)}, {17.23*13, 64}, 1}, - {{4|(11<<4)}, {17.23*11, 64}, 1}, - {{4|(10<<4)}, {17.23*10, 64}, 1}, - {{4|(9<<4)}, {17.23*9, 64}, 1}, - {{4|(8<<4)}, {17.23*8, 64}, 1}, - {{4|(5<<4)}, { 17.23*5, 64}, 4}, - {{4|(2<<4)}, { 17.23*2, 64}, 1}, - {{4|(1<<4)}, { 17.23*1, 64}, 1}, - {{4|(0<<4)}, { 17.23*0, 64}, 1}, -}; +led_config_t g_led_config = { { + { 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 }, + { 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, NO_LED, 28 }, + { 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, NO_LED, 41 }, + { 62, 61, 60, NO_LED, NO_LED, 59, NO_LED, NO_LED, 58, 57, 56, 55, NO_LED, 54 } +}, { + { 223, 0 }, { 206, 0 }, { 189, 0 }, { 172, 0 }, { 155, 0 }, { 137, 0 }, { 120, 0 }, { 103, 0 }, { 86, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 }, + { 223, 16 }, { 206, 16 }, { 189, 16 }, { 172, 16 }, { 155, 16 }, { 137, 16 }, { 120, 16 }, { 103, 16 }, { 86, 16 }, { 68, 16 }, { 51, 16 }, { 34, 16 }, { 17, 16 }, { 0, 16 }, + { 223, 32 }, { 189, 32 }, { 172, 32 }, { 155, 32 }, { 137, 32 }, { 120, 32 }, { 103, 32 }, { 86, 32 }, { 68, 32 }, { 51, 32 }, { 34, 32 }, { 17, 32 }, { 0, 32 }, { 223, 48 }, + { 189, 48 }, { 172, 48 }, { 155, 48 }, { 137, 48 }, { 120, 48 }, { 103, 48 }, { 86, 48 }, { 68, 48 }, { 51, 48 }, { 34, 48 }, { 17, 48 }, { 0, 48 }, { 223, 64 }, { 189, 64 }, + { 172, 64 }, { 155, 64 }, { 137, 64 }, { 86, 64 }, { 34, 64 }, { 17, 64 }, { 0, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, + 1, 1, 1, 4, 1, 1, 1 +} }; + #endif void matrix_init_kb(void) { diff --git a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c index 741fc55fb..584f035ef 100644 --- a/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c @@ -38,11 +38,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c index 1f3807c3b..5a7a56801 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c @@ -39,11 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c index 4575eb19d..34c1752ff 100644 --- a/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c @@ -39,11 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS), }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c index 5e3884803..3a90d2f33 100644 --- a/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/iso/keymap.c @@ -38,11 +38,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c index 3dfa78374..a6d1e226b 100644 --- a/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c +++ b/keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c @@ -50,40 +50,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool default_layer) -{ - rgb_led led; - - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { - rgb_matrix_set_color( i, red, green, blue ); - } - } +extern led_config_t g_led_config; +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } } void rgb_matrix_indicators_user(void) { uint8_t this_led = host_keyboard_leds(); - + if (!g_suspend_state) { switch (biton32(layer_state)) { case _LAYER1: rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; - + case _LAYER2: rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; - + case _LAYER4: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; } } - + if (this_led & (1 << USB_LED_CAPS_LOCK)) { rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); } - + switch (biton32(layer_state)) { case _LAYER3: if (this_led & (1 << USB_LED_NUM_LOCK)) { @@ -91,7 +87,7 @@ void rgb_matrix_indicators_user(void) } else { rgb_matrix_set_color(13, 0x00, 0x00, 0x00); } - + rgb_matrix_set_color(0, 0x00, 0xFF, 0x00); rgb_matrix_set_color(1, 0x00, 0x00, 0x00); rgb_matrix_set_color(1, 0x00, 0xFF, 0x00); diff --git a/keyboards/dztech/dz65rgb/dz65rgb.c b/keyboards/dztech/dz65rgb/dz65rgb.c index 78b345843..e14943d97 100644 --- a/keyboards/dztech/dz65rgb/dz65rgb.c +++ b/keyboards/dztech/dz65rgb/dz65rgb.c @@ -73,76 +73,26 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15}, // LD16 {1, C8_16, C7_16, C6_16}, // LD17 }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{1|(7<<4)}, {16*7, 16}, 4}, - {{1|(6<<4)}, {16*6, 16}, 4}, - {{1|(5<<4)}, {16*5, 16}, 4}, - {{1|(4<<4)}, {16*4, 16}, 4}, - {{1|(3<<4)}, {16*3, 16}, 4}, - {{1|(2<<4)}, {16*2, 16}, 4}, - {{1|(1<<4)}, {16*1, 16}, 4}, - {{1|(0<<4)}, {16*0, 16}, 1}, - {{2|(0<<4)}, {16*0, 32}, 1}, - {{0|(8<<4)}, {16*8, 0}, 1}, - {{0|(7<<4)}, {16*7, 0}, 1}, - {{0|(6<<4)}, {16*6, 0}, 1}, - {{0|(5<<4)}, {16*5, 0}, 1}, - {{0|(4<<4)}, {16*4, 0}, 1}, - {{0|(3<<4)}, {16*3, 0}, 1}, - {{0|(2<<4)}, {16*2, 0}, 1}, - {{0|(1<<4)}, {16*1, 0}, 1}, - {{0|(0<<4)}, {16*0, 0}, 1}, - {{0|(9<<4)}, {16*9, 0}, 1}, - {{0|(10<<4)}, {16*10, 0}, 1}, - {{0|(11<<4)}, {16*11, 0}, 1}, - {{0|(12<<4)}, {16*12, 0}, 1}, - {{0|(13<<4)}, {16*13, 0}, 1}, - {{0|(14<<4)}, {16*14, 0}, 1}, - {{1|(14<<4)}, {16*14, 16}, 1}, - {{2|(14<<4)}, {16*14, 32}, 1}, - {{1|(8<<4)}, {16*8, 16}, 4}, - {{1|(9<<4)}, {16*9, 16}, 4}, - {{1|(10<<4)}, {16*10, 16}, 4}, - {{1|(11<<4)}, {16*11, 16}, 4}, - {{1|(12<<4)}, {16*12, 16}, 4}, - {{1|(13<<4)}, {16*13, 16}, 4}, - {{3|(14<<4)}, {16*14, 48}, 1}, - {{4|(14<<4)}, {16*14, 64}, 1}, - {{4|(13<<4)}, {16*13, 64}, 1}, - {{4|(5<<4)}, {16*5, 64}, 1}, - {{3|(5<<4)}, {16*5, 48}, 4}, - {{3|(4<<4)}, {16*4, 48}, 4}, - {{3|(3<<4)}, {16*3, 48}, 4}, - {{3|(2<<4)}, {16*2, 48}, 4}, - {{3|(1<<4)}, {16*1, 48}, 4}, - {{4|(2<<4)}, {16*2, 64}, 1}, - {{4|(1<<4)}, {16*1, 64}, 1}, - {{2|(6<<4)}, {16*6, 32}, 4}, - {{2|(5<<4)}, {16*5, 32}, 4}, - {{2|(4<<4)}, {16*4, 32}, 4}, - {{2|(3<<4)}, {16*3, 32}, 4}, - {{2|(2<<4)}, {16*2, 32}, 4}, - {{2|(1<<4)}, {16*1, 32}, 4}, - {{3|(0<<4)}, {16*0, 48}, 1}, - {{4|(0<<4)}, {16*0, 64}, 1}, - {{2|(7<<4)}, {16*7, 32}, 4}, - {{2|(8<<4)}, {16*8, 32}, 4}, - {{2|(9<<4)}, {16*9, 32}, 4}, - {{2|(10<<4)}, {16*10, 32}, 4}, - {{2|(11<<4)}, {16*11, 32}, 4}, - {{2|(13<<4)}, {16*13, 32}, 4}, - {{3|(10<<4)}, {16*10, 48}, 4}, - {{3|(11<<4)}, {16*11, 48}, 4}, - {{3|(13<<4)}, {16*13, 48}, 4}, - {{3|(6<<4)}, {16*6, 48}, 4}, - {{3|(7<<4)}, {16*7, 48}, 4}, - {{3|(8<<4)}, {16*8, 48}, 4}, - {{3|(9<<4)}, {16*9, 48}, 4}, - {{4|(8<<4)}, {16*8, 64}, 1}, - {{4|(9<<4)}, {16*9, 64}, 1}, - {{4|(10<<4)}, {16*10, 64}, 1}, - {{4|(11<<4)}, {16*11, 64}, 1}, -}; + +led_config_t g_led_config = { { + { 17, 16, 15, 14, 13, 12, 11, 10, 9, 18, 19, 20, 21, 22, 23 }, + { 7, 6, 5, 4, 3, 2, 1, 0, 26, 27, 28, 29, 30, 31, 24 }, + { 8, 48, 47, 46, 45, 44, 43, 51, 52, 53, 54, 55, NO_LED, 56, 25 }, + { 49, 40, 39, 38, 37, 36, 60, 61, 62, 63, 57, 58, NO_LED, 59, 32 }, + { 50, 42, 41, NO_LED, NO_LED, 35, NO_LED, NO_LED, 64, 65, 66, 67, NO_LED, 34, 33 } +}, { + { 112, 16 }, { 96, 16 }, { 80, 16 }, { 64, 16 }, { 48, 16 }, { 32, 16 }, { 16, 16 }, { 0, 16 }, { 0, 32 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, + { 32, 0 }, { 16, 0 }, { 0, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 224, 0 }, { 224, 16 }, { 224, 32 }, { 128, 16 }, { 144, 16 }, { 160, 16 }, { 176, 16 }, + { 192, 16 }, { 208, 16 }, { 224, 48 }, { 224, 64 }, { 208, 64 }, { 80, 64 }, { 80, 48 }, { 64, 48 }, { 48, 48 }, { 32, 48 }, { 16, 48 }, { 32, 64 }, { 16, 64 }, { 96, 32 }, { 80, 32 }, + { 64, 32 }, { 48, 32 }, { 32, 32 }, { 16, 32 }, { 0, 48 }, { 0, 64 }, { 112, 32 }, { 128, 32 }, { 144, 32 }, { 160, 32 }, { 176, 32 }, { 208, 32 }, { 160, 48 }, { 176, 48 }, { 208, 48 }, + { 96, 48 }, { 112, 48 }, { 128, 48 }, { 144, 48 }, { 128, 64 }, { 144, 64 }, { 160, 64 }, { 176, 64 } +}, { + 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 1, 1, 4, 4, + 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 1, 1, 1, 1 +} }; void suspend_power_down_kb(void) { diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 13ea84302..09443cf72 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -269,68 +269,39 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - - /*{row | col << 4} - | {x=0..224, y=0..64} - | | flags - | | | */ - {{ 8|(0<<4)}, {17.2* 8, 12.8*0}, 4}, // LED 1 on right > Key 6 - {{ 9|(0<<4)}, {17.2* 9, 12.8*0}, 4}, // LED 2 > Key 7 - {{10|(0<<4)}, {17.2*10, 12.8*0}, 4}, // LED 3 > Key 8 - {{11|(0<<4)}, {17.2*11, 12.8*0}, 4}, // LED 4 > Key 9 - {{12|(0<<4)}, {17.2*12, 12.8*0}, 4}, // LED 5 > Key 0 - - {{ 8|(1<<4)}, {17.2* 8, 12.8*1}, 4}, // LED 6 - {{ 9|(1<<4)}, {17.2* 9, 12.8*1}, 4}, // LED 7 - {{10|(1<<4)}, {17.2*10, 12.8*1}, 4}, // LED 8 - {{11|(1<<4)}, {17.2*11, 12.8*1}, 4}, // LED 9 - {{12|(1<<4)}, {17.2*12, 12.8*1}, 4}, // LED 10 - - {{ 8|(2<<4)}, {17.2* 8, 12.8*2}, 4}, // LED 11 - {{ 9|(2<<4)}, {17.2* 9, 12.8*2}, 4}, // LED 12 - {{10|(2<<4)}, {17.2*10, 12.8*2}, 4}, // LED 13 - {{11|(2<<4)}, {17.2*11, 12.8*2}, 4}, // LED 14 - {{12|(2<<4)}, {17.2*12, 12.8*2}, 4}, // LED 15 - - {{ 8|(3<<4)}, {17.2* 8, 12.8*3}, 4}, // LED 16 - {{ 9|(3<<4)}, {17.2* 9, 12.8*3}, 4}, // LED 17 - {{10|(3<<4)}, {17.2*10, 12.8*3}, 4}, // LED 18 - {{11|(3<<4)}, {17.2*11, 12.8*3}, 4}, // LED 19 - {{12|(3<<4)}, {17.2*12, 12.8*3}, 4}, // LED 20 - - {{ 9|(4<<4)}, {17.2* 9, 12.8*4}, 1}, // LED 21 - {{10|(4<<4)}, {17.2*10, 12.8*4}, 1}, // LED 22 - {{11|(4<<4)}, {17.2*11, 12.8*4}, 1}, // LED 23 - {{12|(4<<4)}, {17.2*12, 12.8*4}, 1}, // LED 24 - - {{ 5|(0<<4)}, {17.2* 5, 12.8*0}, 4}, // LED 1 on left > Key 5 - {{ 4|(0<<4)}, {17.2* 4, 12.8*0}, 4}, // LED 2 > Key 4 - {{ 3|(0<<4)}, {17.2* 3, 12.8*0}, 4}, // LED 3 > Key 3 - {{ 2|(0<<4)}, {17.2* 2, 12.8*0}, 4}, // LED 4 > Key 2 - {{ 1|(0<<4)}, {17.2* 1, 12.8*0}, 4}, // LED 5 > Key 1 - - {{ 5|(1<<4)}, {17.2* 5, 12.8*1}, 4}, // LED 6 - {{ 4|(1<<4)}, {17.2* 4, 12.8*1}, 4}, // LED 7 - {{ 3|(1<<4)}, {17.2* 3, 12.8*1}, 4}, // LED 8 - {{ 2|(1<<4)}, {17.2* 2, 12.8*1}, 4}, // LED 9 - {{ 1|(1<<4)}, {17.2* 1, 12.8*1}, 4}, // LED 10 - - {{ 5|(2<<4)}, {17.2* 5, 12.8*2}, 4}, // LED 11 - {{ 4|(2<<4)}, {17.2* 4, 12.8*2}, 4}, // LED 12 - {{ 3|(2<<4)}, {17.2* 3, 12.8*2}, 4}, // LED 13 - {{ 2|(2<<4)}, {17.2* 2, 12.8*2}, 4}, // LED 14 - {{ 1|(2<<4)}, {17.2* 1, 12.8*2}, 4}, // LED 15 - - {{ 5|(3<<4)}, {17.2* 5, 12.8*3}, 4}, // LED 16 - {{ 4|(3<<4)}, {17.2* 4, 12.8*3}, 4}, // LED 17 - {{ 3|(3<<4)}, {17.2* 3, 12.8*3}, 4}, // LED 18 - {{ 2|(3<<4)}, {17.2* 2, 12.8*3}, 4}, // LED 19 - {{ 1|(3<<4)}, {17.2* 1, 12.8*3}, 4}, // LED 20 - - {{ 4|(4<<4)}, {17.2* 4, 12.8*4}, 1}, // LED 21 - {{ 3|(4<<4)}, {17.2* 3, 12.8*4}, 1}, // LED 22 - {{ 2|(4<<4)}, {17.2* 2, 12.8*4}, 1}, // LED 23 - {{ 1|(4<<4)}, {17.2* 1, 12.8*4}, 1}, // LED 24 > Key Hack -}; +led_config_t g_led_config = { { + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { 28, 33, 38, 43, 47, NO_LED }, + { 27, 32, 37, 42, 46, NO_LED }, + { 26, 31, 36, 41, 45, NO_LED }, + { 25, 30, 35, 40, 44, NO_LED }, + { 24, 29, 34, 39, 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, 5, 10, 15, NO_LED, NO_LED }, + { 1, 6, 11, 16, 20, NO_LED }, + { 2, 7, 12, 17, 21, NO_LED }, + { 3, 8, 13, 18, 22, NO_LED }, + { 4, 9, 14, 19, 23, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } +}, { + { 137, 0 }, { 154, 0 }, { 172, 0 }, { 189, 0 }, { 206, 0 }, { 137, 12 }, + { 154, 12 }, { 172, 12 }, { 189, 12 }, { 206, 12 }, { 137, 25 }, { 154, 25 }, + { 172, 25 }, { 189, 25 }, { 206, 25 }, { 137, 38 }, { 154, 38 }, { 172, 38 }, + { 189, 38 }, { 206, 38 }, { 154, 51 }, { 172, 51 }, { 189, 51 }, { 206, 51 }, + { 86, 0 }, { 68, 0 }, { 51, 0 }, { 34, 0 }, { 17, 0 }, { 86, 12 }, + { 68, 12 }, { 51, 12 }, { 34, 12 }, { 17, 12 }, { 86, 25 }, { 68, 25 }, + { 51, 25 }, { 34, 25 }, { 17, 25 }, { 86, 38 }, { 68, 38 }, { 51, 38 }, + { 34, 38 }, { 17, 38 }, { 68, 51 }, { 51, 51 }, { 34, 51 }, { 17, 51 } +}, { + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, + 4, 4, 1, 1, 1, 1 +} }; + #endif diff --git a/keyboards/exclusive/e6_rgb/e6_rgb.c b/keyboards/exclusive/e6_rgb/e6_rgb.c index 42f879990..106e58497 100644 --- a/keyboards/exclusive/e6_rgb/e6_rgb.c +++ b/keyboards/exclusive/e6_rgb/e6_rgb.c @@ -114,91 +114,79 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {0, E_16, D_16, F_16}, {0, B_16, A_16, C_16}, }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | flags - * | | | */ -//cs1 - {{0|(0<<4)}, { 0, 0}, 1}, - {{0|(1<<4)}, { 17, 0}, 4}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, +led_config_t g_led_config = { { + { 0, 1, 4, 5, 12, 13, 36, 20, 21, 24, 25, 16, 17, 28 }, + { 2, 6, 7, 14, 15, 37, 38, 22, 23, 26, 27, 18, 19, 30 }, + { 3, 8, 9, 32, 33, 39, 40, 44, 45, 48, 49, 52, 31, NO_LED }, + { 59, 10, 11, 34, 35, 41, 42, 46, 47, 50, 53, 54, 56, NO_LED }, + { 60, 61, 62, NO_LED, NO_LED, 43, 51, 55, 58, 57, NO_LED, NO_LED, NO_LED, NO_LED } +}, { +//cs1 + { 0, 0 }, { 17, 0 }, { 0, 16 }, { 0, 32 }, //cs2 - {{0|(2<<4)}, { 34, 0}, 4}, - {{0|(3<<4)}, { 51, 0}, 4}, - {{1|(1<<4)}, { 17, 16}, 4}, - {{1|(2<<4)}, { 34, 16}, 4}, + { 34, 0 }, { 51, 0 }, { 17, 16 }, { 34, 16 }, //cs3 - {{2|(1<<4)}, { 17, 32}, 4}, - {{2|(2<<4)}, { 34, 32}, 4}, - {{3|(1<<4)}, { 17, 48}, 4}, - {{3|(2<<4)}, { 34, 48}, 4}, + { 17, 32 }, { 34, 32 }, { 17, 48 }, { 34, 48 }, //cs4 - {{0|(4<<4)}, { 68, 0}, 4}, - {{0|(5<<4)}, { 85, 0}, 4}, - {{1|(3<<4)}, { 51, 16}, 4}, - {{1|(4<<4)}, { 68, 16}, 4}, + { 68, 0 }, { 85, 0 }, { 51, 16 }, { 68, 16 }, //cs5 - {{0|(11<<4)}, {187, 0}, 4}, - {{0|(12<<4)}, {204, 0}, 4}, - {{1|(11<<4)}, {187, 16}, 4}, - {{1|(12<<4)}, {204, 16}, 4}, + { 187, 0 }, { 204, 0 }, { 187, 16 }, { 204, 16 }, //cs6 - {{0|(7<<4)}, {119, 0}, 4}, - {{0|(8<<4)}, {136, 0}, 4}, - {{1|(7<<4)}, {119, 16}, 4}, - {{1|(8<<4)}, {136, 16}, 4}, + { 119, 0 }, { 136, 0 }, { 119, 16 }, { 136, 16 }, //cs7 - {{0|(9<<4)}, {153, 0}, 4}, - {{0|(10<<4)}, {170, 0}, 4}, - {{1|(9<<4)}, {153, 16}, 4}, - {{1|(10<<4)}, {170, 16}, 4}, + { 153, 0 }, { 170, 0 }, { 153, 16 }, { 170, 16 }, //cs8 - {{0|(13<<4)}, {221, 0}, 4}, - {{0|(14<<4)}, {221, 0}, 4}, - {{1|(13<<4)}, {221, 32}, 1}, - {{2|(12<<4)}, {221, 16}, 1}, + { 221, 0 }, { 221, 0 }, { 221, 32 }, { 221, 16 }, //cs9 - {{2|(3<<4)}, { 51, 32}, 4}, - {{2|(4<<4)}, { 68, 32}, 4}, - {{3|(3<<4)}, { 51, 48}, 4}, - {{3|(4<<4)}, { 68, 48}, 4}, + { 51, 32 }, { 68, 32 }, { 51, 48 }, { 68, 48 }, //cs10 - {{0|(6<<4)}, {102, 0}, 4}, - {{1|(5<<4)}, { 85, 16}, 4}, - {{1|(6<<4)}, {102, 16}, 4}, - {{2|(5<<4)}, { 85, 32}, 4}, + { 102, 0 }, { 85, 16 }, { 102, 16 }, { 85, 32 }, //cs11 - {{2|(6<<4)}, {102, 32}, 4}, - {{3|(5<<4)}, { 85, 48}, 4}, - {{3|(6<<4)}, {102, 48}, 4}, - {{4|(5<<4)}, {102, 64}, 4}, + { 102, 32 }, { 85, 48 }, { 102, 48 }, { 102, 64 }, //cs12 - {{2|(7<<4)}, {119, 32}, 4}, - {{2|(8<<4)}, {136, 32}, 4}, - {{3|(7<<4)}, {119, 48}, 4}, - {{3|(8<<4)}, {136, 48}, 4}, + { 119, 32 }, { 136, 32 }, { 119, 48 }, { 136, 48 }, //cs13 - {{2|(9<<4)}, {153, 32}, 4}, - {{2|(10<<4)}, {170, 32}, 4}, - {{3|(9<<4)}, {153, 48}, 4}, - {{4|(6<<4)}, {136, 48}, 1}, + { 153, 32 }, { 170, 32 }, { 153, 48 }, { 136, 48 }, //cs14 - {{2|(11<<4)}, {187, 32}, 4}, - {{3|(10<<4)}, {170, 48}, 4}, - {{3|(11<<4)}, {187, 48}, 1}, - {{4|(7<<4)}, {153, 48}, 1}, + { 187, 32 }, { 170, 48 }, { 187, 48 }, { 153, 48 }, //cs15 - {{3|(12<<4)}, {221, 48}, 1}, - - {{4|(9<<4)}, {221, 64}, 1}, - {{4|(8<<4)}, {204, 64}, 1}, + { 221, 48 }, { 221, 64 }, { 204, 64 }, //cs16 - {{3|(0<<4)}, { 0, 48}, 1}, - {{4|(0<<4)}, { 0, 64}, 1}, - {{4|(1<<4)}, { 17, 64}, 1}, - {{4|(2<<4)}, { 34, 64}, 1}, -}; + { 0, 48 }, { 0, 64 }, { 17, 64 }, { 34, 64 } +}, { +//cs1 + 1, 4, 1, 1, +//cs2 + 4, 4, 4, 4, +//cs3 + 4, 4, 4, 4, +//cs4 + 4, 4, 4, 4, +//cs5 + 4, 4, 4, 4, +//cs6 + 4, 4, 4, 4, +//cs7 + 4, 4, 4, 4, +//cs8 + 4, 4, 1, 1, +//cs9 + 4, 4, 4, 4, +//cs10 + 4, 4, 4, 4, +//cs11 + 4, 4, 4, 4, +//cs12 + 4, 4, 4, 4, +//cs13 + 4, 4, 4, 1, +//cs14 + 4, 4, 1, 1, +//cs15 + 1, 1, 1, +//cs16 + 1, 1, 1, 1 +} }; + #endif diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c index 5827b42e2..1491caba4 100644 --- a/keyboards/hadron/ver3/ver3.c +++ b/keyboards/hadron/ver3/ver3.c @@ -19,24 +19,19 @@ #include "haptic.h" #ifdef RGB_MATRIX_ENABLE -#include "rgblight.h" - -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /*{row | col << 4} - | {x=0..224, y=0..64} - | | modifier - | | | */ - {{1|(13<<4)}, {195, 3}, 4}, - {{4|(13<<4)}, {195, 16}, 4}, - {{4|(10<<4)}, {150, 16}, 4}, - {{4|(7<<4)}, {105, 16}, 4}, - {{4|(4<<4)}, {60, 16}, 4}, - {{4|(1<<4)}, {15, 16}, 4}, - {{1|(1<<4)}, {15, 3}, 4}, - {{1|(4<<4)}, {60, 3}, 4}, - {{1|(7<<4)}, {105, 3}, 4}, - {{1|(10<<4)}, {150, 3}, 4} -}; +#include "rgb_matrix.h" + +led_config_t g_led_config = { { + { 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, 6, NO_LED, NO_LED, 7, NO_LED, NO_LED, 8, NO_LED, NO_LED, 9, NO_LED, NO_LED, 0, 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, 5, NO_LED, NO_LED, 4, NO_LED, NO_LED, 3, NO_LED, NO_LED, 2, NO_LED, NO_LED, 1, NO_LED } +}, { + { 195, 3 }, { 195, 16 }, { 150, 16 }, { 105, 16 }, { 60, 16 }, { 15, 16 }, { 15, 3 }, { 60, 3 }, { 105, 3 }, { 150, 3 } +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 +} }; #endif @@ -53,12 +48,12 @@ uint16_t counterst = 0; #define ScreenOffInterval 60000 /* milliseconds */ static uint16_t last_flush; -volatile uint8_t led_numlock = false; -volatile uint8_t led_capslock = false; +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; volatile uint8_t led_scrolllock = false; static uint8_t layer; -static bool queue_for_send = false; +static bool queue_for_send = false; static uint8_t encoder_value = 32; __attribute__ ((weak)) @@ -69,7 +64,7 @@ void draw_ui(void) { /* Layer indicator is 41 x 10 pixels */ #define LAYER_INDICATOR_X 5 -#define LAYER_INDICATOR_Y 0 +#define LAYER_INDICATOR_Y 0 draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); @@ -83,7 +78,7 @@ void draw_ui(void) { for (uint8_t y = 0; y < MATRIX_COLS; y++) { draw_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); } - } + } draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 19, 9, PIXEL_ON, NORM); /* hadron oled location on thumbnail */ draw_rect_filled_soft(MATRIX_DISPLAY_X + 14, MATRIX_DISPLAY_Y + 2, 3, 1, PIXEL_ON, NORM); @@ -162,7 +157,7 @@ void read_host_led_state(void) { if (led_capslock == false){ led_capslock = true;} } else { - if (led_capslock == true){ + if (led_capslock == true){ led_capslock = false;} } if (leds & (1 << USB_LED_SCROLL_LOCK)) { @@ -197,7 +192,7 @@ void matrix_init_kb(void) { queue_for_send = true; matrix_init_user(); } - + void matrix_scan_kb(void) { if (queue_for_send) { #ifdef QWIIC_MICRO_OLED_ENABLE diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c index bd6dd19b2..5267c9457 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 +} diff --git a/keyboards/massdrop/alt/config_led.c b/keyboards/massdrop/alt/config_led.c index 1a9a539a0..42d4d1474 100644 --- a/keyboards/massdrop/alt/config_led.c +++ b/keyboards/massdrop/alt/config_led.c @@ -20,123 +20,34 @@ // // There is a quick-and-dirty implementation of this under ledvis.html -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - /* 0 */ { { (0)|(0 << 4) }, { 8, 56 }, 4 }, // KC_ESC - /* 1 */ { { (0)|(1 << 4) }, { 22, 56 }, 4 }, // KC_1 - /* 2 */ { { (0)|(2 << 4) }, { 35, 56 }, 4 }, // KC_2 - /* 3 */ { { (0)|(3 << 4) }, { 49, 56 }, 4 }, // KC_3 - /* 4 */ { { (0)|(4 << 4) }, { 63, 56 }, 4 }, // KC_4 - /* 5 */ { { (0)|(5 << 4) }, { 77, 56 }, 4 }, // KC_5 - /* 6 */ { { (0)|(6 << 4) }, { 91, 56 }, 4 }, // KC_6 - /* 7 */ { { (0)|(7 << 4) }, { 105, 56 }, 4 }, // KC_7 - /* 8 */ { { (0)|(8 << 4) }, { 118, 56 }, 4 }, // KC_8 - /* 9 */ { { (0)|(9 << 4) }, { 132, 56 }, 4 }, // KC_9 - /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 4 }, // KC_0 - /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 4 }, // KC_MINS - /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 4 }, // KC_EQL - /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 4 }, // KC_BSPC - /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 4 }, // KC_DEL - /* 15 */ { { (1)|(0 << 4) }, { 11, 44 }, 4 }, // KC_TAB - /* 16 */ { { (1)|(1 << 4) }, { 28, 44 }, 4 }, // KC_Q - /* 17 */ { { (1)|(2 << 4) }, { 42, 44 }, 4 }, // KC_W - /* 18 */ { { (1)|(3 << 4) }, { 56, 44 }, 4 }, // KC_E - /* 19 */ { { (1)|(4 << 4) }, { 70, 44 }, 4 }, // KC_R - /* 20 */ { { (1)|(5 << 4) }, { 84, 44 }, 4 }, // KC_T - /* 21 */ { { (1)|(6 << 4) }, { 98, 44 }, 4 }, // KC_Y - /* 22 */ { { (1)|(7 << 4) }, { 112, 44 }, 4 }, // KC_U - /* 23 */ { { (1)|(8 << 4) }, { 125, 44 }, 4 }, // KC_I - /* 24 */ { { (1)|(9 << 4) }, { 139, 44 }, 4 }, // KC_O - /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 4 }, // KC_P - /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 4 }, // KC_LBRC - /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 4 }, // KC_RBRC - /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 4 }, // KC_BSLS - /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 4 }, // KC_HOME - /* 30 */ { { (2)|(0 << 4) }, { 13, 32 }, 1 }, // KC_CAPS - /* 31 */ { { (2)|(1 << 4) }, { 32, 32 }, 4 }, // KC_A - /* 32 */ { { (2)|(2 << 4) }, { 46, 32 }, 4 }, // KC_S - /* 33 */ { { (2)|(3 << 4) }, { 60, 32 }, 4 }, // KC_D - /* 34 */ { { (2)|(4 << 4) }, { 73, 32 }, 4 }, // KC_F - /* 35 */ { { (2)|(5 << 4) }, { 87, 32 }, 4 }, // KC_G - /* 36 */ { { (2)|(6 << 4) }, { 101, 32 }, 4 }, // KC_H - /* 37 */ { { (2)|(7 << 4) }, { 115, 32 }, 4 }, // KC_J - /* 38 */ { { (2)|(8 << 4) }, { 129, 32 }, 4 }, // KC_K - /* 39 */ { { (2)|(9 << 4) }, { 143, 32 }, 4 }, // KC_L - /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 4 }, // KC_SCLN - /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 4 }, // KC_QUOT - /* _________________________________________ */ // ____ - /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 4 }, // KC_ENT - /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 4 }, // KC_PGUP - /* 44 */ { { (3)|(0 << 4) }, { 16, 19 }, 4 }, // KC_LSFT - /* 45 */ { { (3)|(2 << 4) }, { 39, 19 }, 4 }, // KC_Z - /* 46 */ { { (3)|(3 << 4) }, { 53, 19 }, 4 }, // KC_X - /* 47 */ { { (3)|(4 << 4) }, { 67, 19 }, 4 }, // KC_C - /* 48 */ { { (3)|(5 << 4) }, { 80, 19 }, 4 }, // KC_V - /* 49 */ { { (3)|(6 << 4) }, { 94, 19 }, 4 }, // KC_B - /* 50 */ { { (3)|(7 << 4) }, { 108, 19 }, 4 }, // KC_N - /* 51 */ { { (3)|(8 << 4) }, { 122, 19 }, 4 }, // KC_M - /* 52 */ { { (3)|(9 << 4) }, { 136, 19 }, 4 }, // KC_COMM - /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 4 }, // KC_DOT - /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 4 }, // KC_SLSH - /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 4 }, // KC_RSFT - /* _________________________________________ */ // ____ - /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 4 }, // KC_UP - /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 4 }, // KC_PGDN - /* 58 */ { { (4)|(0 << 4) }, { 9, 7 }, 4 }, // KC_LCTL - /* 59 */ { { (4)|(1 << 4) }, { 27, 7 }, 4 }, // KC_LGUI - /* 60 */ { { (4)|(2 << 4) }, { 44, 7 }, 4 }, // KC_LALT - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* 61 */ { { (4)|(6 << 4) }, { 96, 7 }, 4 }, // KC_SPC - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* _________________________________________ */ // ____ - /* 62 */ { { (4)|(10 << 4) }, { 148, 7 }, 4 }, // KC_RALT - /* 63 */ { { (4)|(11 << 4) }, { 165, 7 }, 4 }, // MO(1) - /* 64 */ { { (4)|(12 << 4) }, { 188, 7 }, 4 }, // KC_LEFT - /* 65 */ { { (4)|(13 << 4) }, { 201, 7 }, 4 }, // KC_DOWN - /* 66 */ { { (4)|(14 << 4) }, { 215, 7 }, 4 }, // KC_RGHT - +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66 } +}, { + { 8, 56 }, { 22, 56 }, { 35, 56 }, { 49, 56 }, { 63, 56 }, { 77, 56 }, { 91, 56 }, { 105, 56 }, { 118, 56 }, { 132, 56 }, { 146, 56 }, { 160, 56 }, { 174, 56 }, { 195, 56 }, { 215, 56 }, + { 11, 44 }, { 28, 44 }, { 42, 44 }, { 56, 44 }, { 70, 44 }, { 84, 44 }, { 98, 44 }, { 112, 44 }, { 125, 44 }, { 139, 44 }, { 153, 44 }, { 167, 44 }, { 181, 44 }, { 198, 44 }, { 215, 44 }, + { 13, 32 }, { 32, 32 }, { 46, 32 }, { 60, 32 }, { 73, 32 }, { 87, 32 }, { 101, 32 }, { 115, 32 }, { 129, 32 }, { 143, 32 }, { 156, 32 }, { 170, 32 }, { 193, 32 }, { 215, 32 }, { 16, 19 }, + { 39, 19 }, { 53, 19 }, { 67, 19 }, { 80, 19 }, { 94, 19 }, { 108, 19 }, { 122, 19 }, { 136, 19 }, { 150, 19 }, { 163, 19 }, { 182, 19 }, { 201, 19 }, { 215, 19 }, { 9, 7 }, { 27, 7 }, + { 44, 7 }, { 96, 7 }, { 148, 7 }, { 165, 7 }, { 188, 7 }, { 201, 7 }, { 215, 7 }, + // Underglow LEDs + { 1, 1 }, { 15, 0 }, { 31, 0 }, { 47, 0 }, { 63, 0 }, { 79, 0 }, { 95, 0 }, { 112, 0 }, { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 208, 0 }, { 222, 1 }, + { 224, 13 }, { 224, 25 }, { 224, 38 }, { 224, 50 }, { 222, 62 }, { 191, 64 }, { 179, 64 }, { 167, 64 }, { 153, 64 }, { 139, 64 }, { 125, 64 }, { 112, 64 }, { 98, 64 }, { 84, 64 }, { 70, 64 }, + { 56, 64 }, { 42, 64 }, { 28, 64 }, { 1, 62 }, { 0, 50 }, { 0, 38 }, { 0, 25 }, { 0, 13 } +}, { + 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, + 1, 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, // Underglow LEDs - { { 255 }, { 1, 1 }, 2 }, - { { 255 }, { 15, 0 }, 2 }, - { { 255 }, { 31, 0 }, 2 }, - { { 255 }, { 47, 0 }, 2 }, - { { 255 }, { 63, 0 }, 2 }, - { { 255 }, { 79, 0 }, 2 }, - { { 255 }, { 95, 0 }, 2 }, - { { 255 }, { 112, 0 }, 2 }, - { { 255 }, { 128, 0 }, 2 }, - { { 255 }, { 144, 0 }, 2 }, - { { 255 }, { 160, 0 }, 2 }, - { { 255 }, { 176, 0 }, 2 }, - { { 255 }, { 192, 0 }, 2 }, - { { 255 }, { 208, 0 }, 2 }, - { { 255 }, { 222, 1 }, 2 }, - { { 255 }, { 224, 13 }, 2 }, - { { 255 }, { 224, 25 }, 2 }, - { { 255 }, { 224, 38 }, 2 }, - { { 255 }, { 224, 50 }, 2 }, - { { 255 }, { 222, 62 }, 2 }, - { { 255 }, { 191, 64 }, 2 }, - { { 255 }, { 179, 64 }, 2 }, - { { 255 }, { 167, 64 }, 2 }, - { { 255 }, { 153, 64 }, 2 }, - { { 255 }, { 139, 64 }, 2 }, - { { 255 }, { 125, 64 }, 2 }, - { { 255 }, { 112, 64 }, 2 }, - { { 255 }, { 98, 64 }, 2 }, - { { 255 }, { 84, 64 }, 2 }, - { { 255 }, { 70, 64 }, 2 }, - { { 255 }, { 56, 64 }, 2 }, - { { 255 }, { 42, 64 }, 2 }, - { { 255 }, { 28, 64 }, 2 }, - { { 255 }, { 1, 62 }, 2 }, - { { 255 }, { 0, 50 }, 2 }, - { { 255 }, { 0, 38 }, 2 }, - { { 255 }, { 0, 25 }, 2 }, - { { 255 }, { 0, 13 }, 2 }, -}; + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + #ifdef USB_LED_INDICATOR_ENABLE void rgb_matrix_indicators_kb(void) diff --git a/keyboards/massdrop/ctrl/config_led.c b/keyboards/massdrop/ctrl/config_led.c index 20d9c649e..5f1c45207 100644 --- a/keyboards/massdrop/ctrl/config_led.c +++ b/keyboards/massdrop/ctrl/config_led.c @@ -5,134 +5,72 @@ #include "rgb_matrix.h" #include "config_led.h" -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 16, 17, 18, 19, 20, 21, 22, 23 }, + { 33, 34, 35, 36, 37, 38, 39, 40 }, + { 50, 51, 52, 53, 54, 55, 56, 57 }, + { 63, 64, 65, 66, 67, 68, 69, 70 }, + { 76, 77, 78, 79, 80, 81, 82, 83 }, + { 8, 9, 10, 11, 12, 13, 14, 15 }, + { 24, 25, 26, 27, 28, 29, 30, 31 }, + { 41, 42, 43, 44, 45, 46, 47, 48 }, + { 58, 59, 60, 61, 62, 75, 49, 32 }, + { 71, 72, 73, 74, 84, 85, 86, NO_LED } +}, { // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS - { { 0|(0<<4) }, { 7, 5 }, 4 }, - { { 0|(1<<4) }, { 31, 5 }, 4 }, - { { 0|(2<<4) }, { 43, 5 }, 4 }, - { { 0|(3<<4) }, { 55, 5 }, 4 }, - { { 0|(4<<4) }, { 67, 5 }, 4 }, - { { 0|(5<<4) }, { 85, 5 }, 4 }, - { { 0|(6<<4) }, { 97, 5 }, 4 }, - { { 0|(7<<4) }, { 109, 5 }, 4 }, - { { 6|(0<<4) }, { 121, 5 }, 4 }, - { { 6|(1<<4) }, { 139, 5 }, 4 }, - { { 6|(2<<4) }, { 151, 5 }, 4 }, - { { 6|(3<<4) }, { 163, 5 }, 4 }, - { { 6|(4<<4) }, { 175, 5 }, 4 }, - { { 6|(5<<4) }, { 193, 5 }, 4 }, - { { 6|(6<<4) }, { 205, 5 }, 1 }, - { { 6|(7<<4) }, { 217, 5 }, 4 }, + { 7, 5 }, { 31, 5 }, { 43, 5 }, { 55, 5 }, { 67, 5 }, { 85, 5 }, { 97, 5 }, { 109, 5 }, + { 121, 5 }, { 139, 5 }, { 151, 5 }, { 163, 5 }, { 175, 5 }, { 193, 5 }, { 205, 5 }, { 217, 5 }, // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP - { { 1|(0<<4) }, { 7, 20 }, 4 }, - { { 1|(1<<4) }, { 19, 20 }, 4 }, - { { 1|(2<<4) }, { 31, 20 }, 4 }, - { { 1|(3<<4) }, { 43, 20 }, 4 }, - { { 1|(4<<4) }, { 55, 20 }, 4 }, - { { 1|(5<<4) }, { 67, 20 }, 4 }, - { { 1|(6<<4) }, { 79, 20 }, 4 }, - { { 1|(7<<4) }, { 91, 20 }, 4 }, - { { 7|(0<<4) }, { 103, 20 }, 4 }, - { { 7|(1<<4) }, { 115, 20 }, 4 }, - { { 7|(2<<4) }, { 127, 20 }, 4 }, - { { 7|(3<<4) }, { 139, 20 }, 4 }, - { { 7|(4<<4) }, { 151, 20 }, 4 }, - { { 7|(5<<4) }, { 169, 20 }, 4 }, - { { 7|(6<<4) }, { 193, 20 }, 4 }, - { { 7|(7<<4) }, { 205, 20 }, 4 }, - { { 9|(7<<4) }, { 217, 20 }, 4 }, + { 7, 20 }, { 19, 20 }, { 31, 20 }, { 43, 20 }, { 55, 20 }, { 67, 20 }, { 79, 20 }, { 91, 20 }, + { 103, 20 }, { 115, 20 }, { 127, 20 }, { 139, 20 }, { 151, 20 }, { 169, 20 }, { 193, 20 }, { 205, 20 }, + { 217, 20 }, // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN - { { 2|(0<<4) }, { 10, 30 }, 4 }, - { { 2|(1<<4) }, { 25, 30 }, 4 }, - { { 2|(2<<4) }, { 37, 30 }, 4 }, - { { 2|(3<<4) }, { 49, 30 }, 4 }, - { { 2|(4<<4) }, { 61, 30 }, 4 }, - { { 2|(5<<4) }, { 73, 30 }, 4 }, - { { 2|(6<<4) }, { 85, 30 }, 4 }, - { { 2|(7<<4) }, { 97, 30 }, 4 }, - { { 8|(0<<4) }, { 109, 30 }, 4 }, - { { 8|(1<<4) }, { 121, 30 }, 4 }, - { { 8|(2<<4) }, { 133, 30 }, 4 }, - { { 8|(3<<4) }, { 145, 30 }, 4 }, - { { 8|(4<<4) }, { 157, 30 }, 4 }, - { { 8|(5<<4) }, { 172, 30 }, 4 }, - { { 8|(6<<4) }, { 193, 30 }, 4 }, - { { 8|(7<<4) }, { 205, 30 }, 4 }, - { { 9|(6<<4) }, { 217, 30 }, 4 }, + { 10, 30 }, { 25, 30 }, { 37, 30 }, { 49, 30 }, { 61, 30 }, { 73, 30 }, { 85, 30 }, { 97, 30 }, + { 109, 30 }, { 121, 30 }, { 133, 30 }, { 145, 30 }, { 157, 30 }, { 172, 30 }, { 193, 30 }, { 205, 30 }, + { 217, 30 }, // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT - { { 3|(0<<4) }, { 11, 39 }, 1 }, - { { 3|(1<<4) }, { 28, 39 }, 4 }, - { { 3|(2<<4) }, { 40, 39 }, 4 }, - { { 3|(3<<4) }, { 52, 39 }, 4 }, - { { 3|(4<<4) }, { 64, 39 }, 4 }, - { { 3|(5<<4) }, { 76, 39 }, 4 }, - { { 3|(6<<4) }, { 88, 39 }, 4 }, - { { 3|(7<<4) }, { 100, 39 }, 4 }, - { { 9|(0<<4) }, { 112, 39 }, 4 }, - { { 9|(1<<4) }, { 124, 39 }, 4 }, - { { 9|(2<<4) }, { 136, 39 }, 4 }, - { { 9|(3<<4) }, { 148, 39 }, 4 }, - { { 9|(4<<4) }, { 168, 39 }, 4 }, + { 11, 39 }, { 28, 39 }, { 40, 39 }, { 52, 39 }, { 64, 39 }, { 76, 39 }, { 88, 39 }, { 100, 39 }, + { 112, 39 }, { 124, 39 }, { 136, 39 }, { 148, 39 }, { 168, 39 }, // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP - { { 4|(0<<4) }, { 14, 49 }, 4 }, - { { 4|(1<<4) }, { 34, 49 }, 4 }, - { { 4|(2<<4) }, { 46, 49 }, 4 }, - { { 4|(3<<4) }, { 58, 49 }, 4 }, - { { 4|(4<<4) }, { 70, 49 }, 4 }, - { { 4|(5<<4) }, { 82, 49 }, 4 }, - { { 4|(6<<4) }, { 94, 49 }, 4 }, - { { 4|(7<<4) }, { 106, 49 }, 4 }, - { { 10|(0<<4) }, { 118, 49 }, 4 }, - { { 10|(1<<4) }, { 130, 49 }, 4 }, - { { 10|(2<<4) }, { 142, 49 }, 4 }, - { { 10|(3<<4) }, { 165, 49 }, 4 }, - { { 9|(5<<4) }, { 205, 49 }, 4 }, + { 14, 49 }, { 34, 49 }, { 46, 49 }, { 58, 49 }, { 70, 49 }, { 82, 49 }, { 94, 49 }, { 106, 49 }, + { 118, 49 }, { 130, 49 }, { 142, 49 }, { 165, 49 }, { 205, 49 }, // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - { { 5|(0<<4) }, { 8, 59 }, 4 }, - { { 5|(1<<4) }, { 23, 59 }, 4 }, - { { 5|(2<<4) }, { 38, 59 }, 4 }, - { { 5|(3<<4) }, { 83, 59 }, 4 }, - { { 5|(4<<4) }, { 129, 59 }, 4 }, - { { 5|(5<<4) }, { 144, 59 }, 4 }, - { { 5|(6<<4) }, { 159, 59 }, 4 }, - { { 5|(7<<4) }, { 174, 59 }, 4 }, - { { 10|(4<<4) }, { 193, 59 }, 4 }, - { { 10|(5<<4) }, { 205, 59 }, 4 }, - { { 10|(6<<4) }, { 217, 59 }, 4 }, + { 8, 59 }, { 23, 59 }, { 38, 59 }, { 83, 59 }, { 129, 59 }, { 144, 59 }, { 159, 59 }, { 174, 59 }, + { 193, 59 }, { 205, 59 }, { 217, 59 }, // Underglow / Border - { { 0xFF }, { 222, 64 }, 2 }, - { { 0xFF }, { 204, 64 }, 2 }, - { { 0xFF }, { 186, 64 }, 2 }, - { { 0xFF }, { 167, 64 }, 2 }, - { { 0xFF }, { 149, 64 }, 2 }, - { { 0xFF }, { 130, 64 }, 2 }, - { { 0xFF }, { 112, 64 }, 2 }, - { { 0xFF }, { 94, 64 }, 2 }, - { { 0xFF }, { 75, 64 }, 2 }, - { { 0xFF }, { 57, 64 }, 2 }, - { { 0xFF }, { 38, 64 }, 2 }, - { { 0xFF }, { 20, 64 }, 2 }, - { { 0xFF }, { 0, 64 }, 2 }, - { { 0xFF }, { 0, 47 }, 2 }, - { { 0xFF }, { 0, 32 }, 2 }, - { { 0xFF }, { 0, 17 }, 2 }, - { { 0xFF }, { 0, 0 }, 2 }, - { { 0xFF }, { 20, 0 }, 2 }, - { { 0xFF }, { 38, 0 }, 2 }, - { { 0xFF }, { 57, 0 }, 2 }, - { { 0xFF }, { 75, 0 }, 2 }, - { { 0xFF }, { 94, 0 }, 2 }, - { { 0xFF }, { 112, 0 }, 2 }, - { { 0xFF }, { 130, 0 }, 2 }, - { { 0xFF }, { 149, 0 }, 2 }, - { { 0xFF }, { 167, 0 }, 2 }, - { { 0xFF }, { 186, 0 }, 2 }, - { { 0xFF }, { 204, 0 }, 2 }, - { { 0xFF }, { 222, 1 }, 2 }, - { { 0xFF }, { 224, 17 }, 2 }, - { { 0xFF }, { 224, 32 }, 2 }, - { { 0xFF }, { 224, 47 }, 2 }, -}; + { 222, 64 }, { 204, 64 }, { 186, 64 }, { 167, 64 }, { 149, 64 }, { 130, 64 }, { 112, 64 }, { 94, 64 }, + { 75, 64 }, { 57, 64 }, { 38, 64 }, { 20, 64 }, { 0, 64 }, { 0, 47 }, { 0, 32 }, { 0, 17 }, + { 0, 0 }, { 20, 0 }, { 38, 0 }, { 57, 0 }, { 75, 0 }, { 94, 0 }, { 112, 0 }, { 130, 0 }, + { 149, 0 }, { 167, 0 }, { 186, 0 }, { 204, 0 }, { 222, 1 }, { 224, 17 }, { 224, 32 }, { 224, 47 } +}, { + // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1, 4, + // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, + // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, + // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, + // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, + // Underglow / Border + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + #ifdef USB_LED_INDICATOR_ENABLE void rgb_matrix_indicators_kb(void) diff --git a/keyboards/model01/leds.c b/keyboards/model01/leds.c index 0abc1f0da..b21c1a5c8 100644 --- a/keyboards/model01/leds.c +++ b/keyboards/model01/leds.c @@ -46,72 +46,35 @@ void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b) { #ifdef RGB_MATRIX_ENABLE __attribute__ ((weak)) -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0x73}, { 3, 35}, 4}, - {{0x72}, { 0, 26}, 4}, - {{0x71}, { 0, 17}, 4}, - {{0x70}, { 0, 6}, 4}, - {{0x60}, { 14, 5}, 4}, - {{0x61}, { 15, 16}, 4}, - {{0x62}, { 16, 25}, 4}, - {{0x63}, { 17, 34}, 4}, - {{0x53}, { 31, 29}, 4}, - {{0x52}, { 31, 19}, 4}, - {{0x51}, { 30, 11}, 4}, - {{0x50}, { 30, 1}, 4}, - {{0x40}, { 45, 0}, 4}, - {{0x41}, { 45, 8}, 4}, - {{0x42}, { 46, 17}, 4}, - {{0x43}, { 46, 27}, 4}, - {{0x33}, { 60, 27}, 4}, - {{0x32}, { 60, 18}, 4}, - {{0x31}, { 60, 9}, 4}, - {{0x30}, { 60, 0}, 4}, - {{0x20}, { 74, 2}, 4}, - {{0x21}, { 74, 11}, 4}, - {{0x22}, { 75, 20}, 4}, - {{0x23}, { 74, 28}, 4}, - {{0x12}, { 89, 30}, 4}, - {{0x11}, { 89, 19}, 4}, - {{0x10}, { 89, 7}, 4}, - {{0x00}, { 70, 38}, 1}, - {{0x01}, { 82, 41}, 1}, - {{0x02}, { 93, 45}, 1}, - {{0x03}, {104, 50}, 1}, - {{0x13}, { 74, 64}, 1}, - {{0x67}, {149, 64}, 1}, - {{0x77}, {119, 50}, 1}, - {{0x76}, {130, 45}, 1}, - {{0x75}, {141, 41}, 1}, - {{0x74}, {153, 38}, 1}, - {{0x64}, {134, 7}, 4}, - {{0x65}, {134, 19}, 4}, - {{0x66}, {134, 30}, 4}, - {{0x57}, {149, 28}, 4}, - {{0x56}, {148, 20}, 4}, - {{0x55}, {149, 11}, 4}, - {{0x54}, {149, 2}, 4}, - {{0x44}, {163, 0}, 4}, - {{0x45}, {163, 9}, 4}, - {{0x46}, {163, 18}, 4}, - {{0x47}, {163, 27}, 4}, - {{0x37}, {177, 27}, 4}, - {{0x36}, {177, 17}, 4}, - {{0x35}, {178, 8}, 4}, - {{0x34}, {178, 0}, 4}, - {{0x24}, {193, 1}, 4}, - {{0x25}, {193, 11}, 4}, - {{0x26}, {192, 19}, 4}, - {{0x27}, {192, 29}, 4}, - {{0x17}, {206, 34}, 4}, - {{0x16}, {207, 25}, 4}, - {{0x15}, {208, 16}, 4}, - {{0x14}, {209, 5}, 4}, - {{0x04}, {224, 6}, 4}, - {{0x05}, {223, 17}, 4}, - {{0x06}, {223, 26}, 4}, - {{0x07}, {220, 35}, 4}, -}; +led_config_t g_led_config = { { + { 27, 26, 20, 19, 12, 11, 4, 3 }, + { 28, 25, 21, 18, 13, 10, 5, 2 }, + { 29, 24, 22, 17, 14, 9, 6, 1 }, + { 30, 31, 23, 16, 15, 8, 7, 0 }, + { 60, 59, 52, 51, 44, 43, 37, 36 }, + { 61, 58, 53, 50, 45, 42, 38, 35 }, + { 62, 57, 54, 49, 46, 41, 39, 34 }, + { 63, 56, 55, 48, 47, 40, 32, 33 } +}, { + { 3, 35 }, { 0, 26 }, { 0, 17 }, { 0, 6 }, { 14, 5 }, { 15, 16 }, { 16, 25 }, { 17, 34 }, + { 31, 29 }, { 31, 19 }, { 30, 11 }, { 30, 1 }, { 45, 0 }, { 45, 8 }, { 46, 17 }, { 46, 27 }, + { 60, 27 }, { 60, 18 }, { 60, 9 }, { 60, 0 }, { 74, 2 }, { 74, 11 }, { 75, 20 }, { 74, 28 }, + { 89, 30 }, { 89, 19 }, { 89, 7 }, { 70, 38 }, { 82, 41 }, { 93, 45 }, { 104, 50 }, { 74, 64 }, + { 149, 64 }, { 119, 50 }, { 130, 45 }, { 141, 41 }, { 153, 38 }, { 134, 7 }, { 134, 19 }, { 134, 30 }, + { 149, 28 }, { 148, 20 }, { 149, 11 }, { 149, 2 }, { 163, 0 }, { 163, 9 }, { 163, 18 }, { 163, 27 }, + { 177, 27 }, { 177, 17 }, { 178, 8 }, { 178, 0 }, { 193, 1 }, { 193, 11 }, { 192, 19 }, { 192, 29 }, + { 206, 34 }, { 207, 25 }, { 208, 16 }, { 209, 5 }, { 224, 6 }, { 223, 17 }, { 223, 26 }, { 220, 35 } +}, { + 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, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 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 +} }; + static struct { uint8_t b; diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index 94f507189..3ad694c4a 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -79,63 +79,27 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - - /*{row | col << 4} - | {x=0..224, y=0..64} - | | flags - | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, - {{4|(0<<4)}, {20.36*6, 21.33*0}, 4}, - {{4|(1<<4)}, {20.36*7, 21.33*0}, 4}, - {{4|(2<<4)}, {20.36*8, 21.33*0}, 4}, - {{4|(3<<4)}, {20.36*9, 21.33*0}, 4}, - {{4|(4<<4)}, {20.36*10,21.33*0}, 4}, - {{4|(5<<4)}, {20.36*11,21.33*0}, 1}, - - {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, - {{5|(0<<4)}, {20.36*6, 21.33*1}, 4}, - {{5|(1<<4)}, {20.36*7, 21.33*1}, 4}, - {{5|(2<<4)}, {20.36*8, 21.33*1}, 4}, - {{5|(3<<4)}, {20.36*9, 21.33*1}, 4}, - {{5|(4<<4)}, {20.36*10,21.33*1}, 4}, - {{5|(5<<4)}, {20.36*11,21.33*1}, 1}, - - {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, - {{6|(0<<4)}, {20.36*6, 21.33*2}, 4}, - {{6|(1<<4)}, {20.36*7, 21.33*2}, 4}, - {{6|(2<<4)}, {20.36*8, 21.33*2}, 4}, - {{6|(3<<4)}, {20.36*9, 21.33*2}, 4}, - {{6|(4<<4)}, {20.36*10,21.33*2}, 4}, - {{6|(5<<4)}, {20.36*11,21.33*2}, 1}, - - {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, - {{3|(1<<4)}, {20.36*1, 21.33*3}, 1}, - {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, - {{7|(3<<4)}, {20.36*3, 21.33*3}, 1}, - {{7|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{7|(5<<4)}, {20.36*5.5,21.33*3}, 4}, - {{7|(0<<4)}, {20.36*7, 21.33*3}, 1}, - {{7|(1<<4)}, {20.36*8, 21.33*3}, 1}, - {{7|(2<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(3<<4)}, {20.36*10,21.33*3}, 1}, - {{3|(4<<4)}, {20.36*11,21.33*3}, 1} -}; +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5 }, + { 12, 13, 14, 15, 16, 17 }, + { 24, 25, 26, 27, 28, 29 }, + { 36, 37, 38, 45, 46, NO_LED }, + { 6, 7, 8, 9, 10, 11 }, + { 18, 19, 20, 21, 22, 23 }, + { 30, 31, 32, 33, 34, 35 }, + { 42, 43, 44, 39, 40, 41 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 111, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1 +} }; + void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/planck/keymaps/tom/keymap.c b/keyboards/planck/keymaps/tom/keymap.c index 5b7177c6c..0ffff4e69 100644 --- a/keyboards/planck/keymaps/tom/keymap.c +++ b/keyboards/planck/keymaps/tom/keymap.c @@ -224,14 +224,16 @@ bool music_mask_user(uint16_t keycode) { } } +#ifdef RGB_MATRIX_ENABLE +extern led_config_t g_led_config; +#endif + void rgb_matrix_indicators_user(void) { #ifdef RGB_MATRIX_ENABLE - rgb_led led; switch (biton32(layer_state)) { case _RAISE: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); } else { rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); @@ -241,8 +243,7 @@ void rgb_matrix_indicators_user(void) { case _LOWER: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); } else { rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c index 178d28274..896ec4458 100644 --- a/keyboards/planck/light/light.c +++ b/keyboards/planck/light/light.c @@ -77,65 +77,24 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_14, C8_14, C7_14} }; -rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - - /*{row | col << 4} - | {x=0..224, y=0..64} - | | flags - | | | */ - {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, - {{0|(2<<4)}, {20.36*2, 21.33*0}, 4}, - {{0|(3<<4)}, {20.36*3, 21.33*0}, 4}, - {{0|(4<<4)}, {20.36*4, 21.33*0}, 4}, - {{0|(5<<4)}, {20.36*5, 21.33*0}, 4}, - {{0|(6<<4)}, {20.36*6, 21.33*0}, 4}, - {{0|(7<<4)}, {20.36*7, 21.33*0}, 4}, - {{0|(8<<4)}, {20.36*8, 21.33*0}, 4}, - {{0|(9<<4)}, {20.36*9, 21.33*0}, 4}, - {{0|(10<<4)}, {20.36*10,21.33*0}, 4}, - {{0|(11<<4)}, {20.36*11,21.33*0}, 1}, - - {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, - {{1|(1<<4)}, {20.36*1, 21.33*1}, 4}, - {{1|(2<<4)}, {20.36*2, 21.33*1}, 4}, - {{1|(3<<4)}, {20.36*3, 21.33*1}, 4}, - {{1|(4<<4)}, {20.36*4, 21.33*1}, 4}, - {{1|(5<<4)}, {20.36*5, 21.33*1}, 4}, - {{1|(6<<4)}, {20.36*6, 21.33*1}, 4}, - {{1|(7<<4)}, {20.36*7, 21.33*1}, 4}, - {{1|(8<<4)}, {20.36*8, 21.33*1}, 4}, - {{1|(9<<4)}, {20.36*9, 21.33*1}, 4}, - {{1|(10<<4)}, {20.36*10,21.33*1}, 4}, - {{1|(11<<4)}, {20.36*11,21.33*1}, 1}, - - {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, - {{2|(1<<4)}, {20.36*1, 21.33*2}, 4}, - {{2|(2<<4)}, {20.36*2, 21.33*2}, 4}, - {{2|(3<<4)}, {20.36*3, 21.33*2}, 4}, - {{2|(4<<4)}, {20.36*4, 21.33*2}, 4}, - {{2|(5<<4)}, {20.36*5, 21.33*2}, 4}, - {{2|(6<<4)}, {20.36*6, 21.33*2}, 4}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, - {{2|(10<<4)}, {20.36*10,21.33*2}, 4}, - {{2|(11<<4)}, {20.36*11,21.33*2}, 1}, - - {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, - {{3|(1<<4)}, {20.36*1, 21.33*3}, 1}, - {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, - {{3|(3<<4)}, {20.36*3, 21.33*3}, 1}, - {{3|(4<<4)}, {20.36*4, 21.33*3}, 1}, - {{3|(5<<4)}, {20.36*5, 21.33*3}, 4}, - {{3|(5<<4)}, {20.36*5.5,21.33*3}, 4}, - {{3|(6<<4)}, {20.36*6, 21.33*3}, 4}, - {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, - {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, - {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, - {{3|(10<<4)}, {20.36*10,21.33*3}, 1}, - {{3|(11<<4)}, {20.36*11,21.33*3}, 1} -}; +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, + { 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }, + { 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48 } +}, { + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 21 }, { 20, 21 }, { 40, 21 }, { 61, 21 }, { 81, 21 }, { 101, 21 }, { 122, 21 }, { 142, 21 }, { 162, 21 }, { 183, 21 }, { 203, 21 }, { 223, 21 }, + { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, + { 0, 63 }, { 20, 63 }, { 40, 63 }, { 61, 63 }, { 81, 63 }, { 101, 63 }, { 111, 63 }, { 122, 63 }, { 142, 63 }, { 162, 63 }, { 183, 63 }, { 203, 63 }, + { 223, 63 } +}, { + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 1, + 1 +} }; void matrix_init_kb(void) { @@ -151,6 +110,16 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) return process_record_user(keycode, record); } +uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { + // Spacebar has 2 leds 41 & 42, so add 42 to the array here, and 41 will be added + // by the default lookup code that runs after this + if (row == 3 && column == 5) { + led_i[0] = 42; + return 1; + } + return 0; +} + void matrix_scan_kb(void) { matrix_scan_user(); diff --git a/keyboards/sol/rev1/rev1.c b/keyboards/sol/rev1/rev1.c index 23896860e..68e64af79 100644 --- a/keyboards/sol/rev1/rev1.c +++ b/keyboards/sol/rev1/rev1.c @@ -1,83 +1,46 @@ #include "quantum.h" #ifdef RGB_MATRIX_ENABLE - rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6 }, + { 7, 8, 9, 10, 11, 12, 13 }, + { 14, 15, 16, 17, 18, 19, 20 }, + { 21, 22, 23, 24, 25, 26, 27 }, + { 28, 29, 30, 31, 32, 33, 34 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 33, 34 }, + { 35, 36, 37, 38, 39, 40, 41 }, + { 42, 43, 44, 45, 46, 47, 48 }, + { 49, 50, 51, 52, 53, 54, 55 }, + { 56, 57, 58, 59, 60, 61, 62 }, + { 63, 64, 65, 66, 67, 68, 68 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 68, 68 } +}, { // Left Hand Mapped Left to Right - { { 0 | (0 << 4) }, { 0, 0 }, 1}, - { { 0 | (1 << 4) }, { 22, 0 }, 4}, - { { 0 | (2 << 4) }, { 37, 0 }, 4}, - { { 0 | (3 << 4) }, { 37, 0 }, 4}, - { { 0 | (4 << 4) }, { 67, 0 }, 4}, - { { 0 | (5 << 4) }, { 82, 0 }, 4}, - { { 0 | (6 << 4) }, { 104, 0 }, 1}, - { { 1 | (0 << 4) }, { 0, 16 }, 1}, - { { 1 | (1 << 4) }, { 22, 16 }, 4}, - { { 1 | (2 << 4) }, { 37, 16 }, 4}, - { { 1 | (3 << 4) }, { 37, 16 }, 4}, - { { 1 | (4 << 4) }, { 67, 16 }, 4}, - { { 1 | (5 << 4) }, { 82, 16 }, 4}, - { { 1 | (6 << 4) }, { 104, 16 }, 1}, - { { 2 | (0 << 4) }, { 0, 32 }, 1}, - { { 2 | (1 << 4) }, { 22, 32 }, 4}, - { { 2 | (2 << 4) }, { 37, 32 }, 4}, - { { 2 | (3 << 4) }, { 37, 32 }, 4}, - { { 2 | (4 << 4) }, { 67, 32 }, 4}, - { { 2 | (5 << 4) }, { 82, 32 }, 4}, - { { 2 | (6 << 4) }, { 104, 32 }, 1}, - { { 3 | (0 << 4) }, { 0, 48 }, 1}, - { { 3 | (1 << 4) }, { 22, 48 }, 4}, - { { 3 | (2 << 4) }, { 37, 48 }, 4}, - { { 3 | (3 << 4) }, { 37, 48 }, 4}, - { { 3 | (4 << 4) }, { 67, 48 }, 4}, - { { 3 | (5 << 4) }, { 82, 48 }, 4}, - { { 3 | (6 << 4) }, { 104, 48 }, 1}, - { { 4 | (0 << 4) }, { 0, 64 }, 1}, - { { 4 | (1 << 4) }, { 22, 64 }, 1}, - { { 4 | (2 << 4) }, { 37, 64 }, 1}, - { { 4 | (3 << 4) }, { 37, 64 }, 1}, - { { 4 | (4 << 4) }, { 67, 64 }, 1}, - // These two control the 4 LEDs in the thumb cluster - // Top keys are { 4 | (5 << 4) & { 4 | (6 << 4) - { { 5 | (5 << 4) }, { 89, 45 }, 1}, - { { 5 | (6 << 4) }, { 97, 55 }, 1}, + { 0, 0 }, { 22, 0 }, { 37, 0 }, { 37, 0 }, { 67, 0 }, { 82, 0 }, { 104, 0 }, + { 0, 16 }, { 22, 16 }, { 37, 16 }, { 37, 16 }, { 67, 16 }, { 82, 16 }, { 104, 16 }, + { 0, 32 }, { 22, 32 }, { 37, 32 }, { 37, 32 }, { 67, 32 }, { 82, 32 }, { 104, 32 }, + { 0, 48 }, { 22, 48 }, { 37, 48 }, { 37, 48 }, { 67, 48 }, { 82, 48 }, { 104, 48 }, + { 0, 64 }, { 22, 64 }, { 37, 64 }, { 37, 64 }, { 67, 64 }, { 89, 45 }, { 97, 55 }, // Left Hand Mapped Right to Left - { { 6 | (0 << 4) }, { 224, 0 }, 1}, - { { 6 | (1 << 4) }, { 202, 0 }, 4}, - { { 6 | (2 << 4) }, { 187, 0 }, 4}, - { { 6 | (3 << 4) }, { 172, 0 }, 4}, - { { 6 | (4 << 4) }, { 157, 0 }, 4}, - { { 6 | (5 << 4) }, { 142, 0 }, 4}, - { { 6 | (6 << 4) }, { 120, 0 }, 1}, - { { 7 | (0 << 4) }, { 224, 16 }, 1}, - { { 7 | (1 << 4) }, { 202, 16 }, 4}, - { { 7 | (2 << 4) }, { 187, 16 }, 4}, - { { 7 | (3 << 4) }, { 172, 16 }, 4}, - { { 7 | (4 << 4) }, { 157, 16 }, 4}, - { { 7 | (5 << 4) }, { 142, 16 }, 4}, - { { 7 | (6 << 4) }, { 120, 16 }, 1}, - { { 8 | (0 << 4) }, { 224, 32 }, 1}, - { { 8 | (1 << 4) }, { 202, 32 }, 4}, - { { 8 | (2 << 4) }, { 187, 32 }, 4}, - { { 8 | (3 << 4) }, { 172, 32 }, 4}, - { { 8 | (4 << 4) }, { 157, 32 }, 4}, - { { 8 | (5 << 4) }, { 142, 32 }, 4}, - { { 8 | (6 << 4) }, { 120, 32 }, 1}, - { { 9 | (0 << 4) }, { 224, 48 }, 1}, - { { 9 | (1 << 4) }, { 202, 48 }, 4}, - { { 9 | (2 << 4) }, { 187, 48 }, 4}, - { { 9 | (3 << 4) }, { 172, 48 }, 4}, - { { 9 | (4 << 4) }, { 157, 48 }, 4}, - { { 9 | (5 << 4) }, { 142, 48 }, 4}, - { { 9 | (6 << 4) }, { 120, 48 }, 1}, - { { 10 | (0 << 4) }, { 224, 64 }, 1}, - { { 10 | (1 << 4) }, { 202, 64 }, 1}, - { { 10 | (2 << 4) }, { 187, 64 }, 1}, - { { 10 | (3 << 4) }, { 172, 64 }, 1}, - { { 10 | (4 << 4) }, { 157, 64 }, 1}, - // These two control the 4 LEDs in the thumb cluster - // Top keys are { 10 | (5 << 4) & { 10 | (6 << 4) - { { 11 | (5 << 4) }, { 135, 45 }, 1}, - { { 11 | (6 << 4) }, { 127, 55 }, 1} - }; + { 224, 0 }, { 202, 0 }, { 187, 0 }, { 172, 0 }, { 157, 0 }, { 142, 0 }, { 120, 0 }, + { 224, 16 }, { 202, 16 }, { 187, 16 }, { 172, 16 }, { 157, 16 }, { 142, 16 }, { 120, 16 }, + { 224, 32 }, { 202, 32 }, { 187, 32 }, { 172, 32 }, { 157, 32 }, { 142, 32 }, { 120, 32 }, + { 224, 48 }, { 202, 48 }, { 187, 48 }, { 172, 48 }, { 157, 48 }, { 142, 48 }, { 120, 48 }, + { 224, 64 }, { 202, 64 }, { 187, 64 }, { 172, 64 }, { 157, 64 }, { 135, 45 }, { 127, 55 } +}, { + // Left Hand Mapped Left to Right + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, + // Left Hand Mapped Right to Left + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1 +} }; + #endif diff --git a/keyboards/sol/sol.c b/keyboards/sol/sol.c index a65d4c15f..5945cc60a 100644 --- a/keyboards/sol/sol.c +++ b/keyboards/sol/sol.c @@ -1,20 +1 @@ #include "sol.h" - -#if defined(RGB_MATRIX_ENABLE) -uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { - if (row == 4 && column == 5) { - led_i[0] = 33; - return 1; - } else if (row == 4 && column == 6) { - led_i[0] = 34; - return 1; - } else if (row == 10 && column == 5) { - led_i[0] = 68; - return 1; - } else if (row == 10 && column == 6) { - led_i[0] = 69; - return 1; - } - return 0; -} -#endif diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index eeb21501b..3cfce966b 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -403,11 +403,10 @@ void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } -void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { - rgb_led led; +extern led_config_t g_led_config; +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 5eef2e023..e8dc185a1 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -184,11 +184,10 @@ void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); } +extern led_config_t g_led_config; void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { - rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 5528a0834..edbcee9cd 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -105,6 +105,7 @@ bool g_suspend_state = false; +extern led_config_t g_led_config; rgb_config_t rgb_matrix_config; rgb_counters_t g_rgb_counters; @@ -150,14 +151,11 @@ uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t } uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { - // TODO: This is kinda expensive, fix this soonish uint8_t led_count = rgb_matrix_map_row_column_to_led_kb(row, column, led_i); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL && led_count < LED_HITS_TO_REMEMBER; i++) { - matrix_co_t matrix_co = g_rgb_leds[i].matrix_co; - if (row == matrix_co.row && column == matrix_co.col) { - led_i[led_count] = i; - led_count++; - } + uint8_t led_index = g_led_config.matrix_co[row][column]; + if (led_index != NO_LED) { + led_i[led_count] = led_index; + led_count++; } return led_count; } @@ -201,8 +199,8 @@ bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { for(uint8_t i = 0; i < led_count; i++) { uint8_t index = last_hit_buffer.count; - last_hit_buffer.x[index] = g_rgb_leds[led[i]].point.x; - last_hit_buffer.y[index] = g_rgb_leds[led[i]].point.y; + last_hit_buffer.x[index] = g_led_config.point[led[i]].x; + last_hit_buffer.y[index] = g_led_config.point[led[i]].y; last_hit_buffer.index[index] = led[i]; last_hit_buffer.tick[index] = 0; last_hit_buffer.count++; diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 33665ffff..365a92bbf 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -54,9 +54,7 @@ uint8_t max = DRIVER_LED_TOTAL; #endif -#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) continue - -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) continue typedef struct { diff --git a/quantum/rgb_matrix_animations/alpha_mods_anim.h b/quantum/rgb_matrix_animations/alpha_mods_anim.h index 4bd01c4fc..d7f6f4655 100644 --- a/quantum/rgb_matrix_animations/alpha_mods_anim.h +++ b/quantum/rgb_matrix_animations/alpha_mods_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; // alphas = color1, mods = color2 @@ -15,7 +15,7 @@ bool rgb_matrix_alphas_mods(effect_params_t* params) { for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - if (HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_MODIFIER)) { + if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); } else { rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h index 513dff128..e93798f90 100644 --- a/quantum/rgb_matrix_animations/cycle_all_anim.h +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_all(effect_params_t* params) { diff --git a/quantum/rgb_matrix_animations/cycle_left_right_anim.h b/quantum/rgb_matrix_animations/cycle_left_right_anim.h index 428adea22..4b09d5826 100644 --- a/quantum/rgb_matrix_animations/cycle_left_right_anim.h +++ b/quantum/rgb_matrix_animations/cycle_left_right_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_left_right(effect_params_t* params) { @@ -12,8 +12,7 @@ bool rgb_matrix_cycle_left_right(effect_params_t* params) { uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = point.x - time; + hsv.h = g_led_config.point[i].x - time; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/cycle_up_down_anim.h b/quantum/rgb_matrix_animations/cycle_up_down_anim.h index ea63095d2..403214bb7 100644 --- a/quantum/rgb_matrix_animations/cycle_up_down_anim.h +++ b/quantum/rgb_matrix_animations/cycle_up_down_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_cycle_up_down(effect_params_t* params) { @@ -12,8 +12,7 @@ bool rgb_matrix_cycle_up_down(effect_params_t* params) { uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = point.y - time; + hsv.h = g_led_config.point[i].y - time; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/dual_beacon_anim.h b/quantum/rgb_matrix_animations/dual_beacon_anim.h index 00f6e5088..dcb594029 100644 --- a/quantum/rgb_matrix_animations/dual_beacon_anim.h +++ b/quantum/rgb_matrix_animations/dual_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_dual_beacon(effect_params_t* params) { @@ -14,8 +14,7 @@ bool rgb_matrix_dual_beacon(effect_params_t* params) { int8_t sin_value = sin8(time) - 128; for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; + hsv.h = ((g_led_config.point[i].y - 32) * cos_value + (g_led_config.point[i].x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/gradient_up_down_anim.h b/quantum/rgb_matrix_animations/gradient_up_down_anim.h index 05117540a..7a6ed1421 100644 --- a/quantum/rgb_matrix_animations/gradient_up_down_anim.h +++ b/quantum/rgb_matrix_animations/gradient_up_down_anim.h @@ -1,7 +1,7 @@ #pragma once #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_gradient_up_down(effect_params_t* params) { @@ -11,10 +11,9 @@ bool rgb_matrix_gradient_up_down(effect_params_t* params) { uint8_t scale = scale8(64, rgb_matrix_config.speed); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; // The y range will be 0..64, map this to 0..4 // Relies on hue being 8-bit and wrapping - hsv.h = rgb_matrix_config.hue + scale * (point.y >> 4); + hsv.h = rgb_matrix_config.hue + scale * (g_led_config.point[i].y >> 4); RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h index dffa53264..5ea971435 100644 --- a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h @@ -2,11 +2,11 @@ #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; static void jellybean_raindrops_set_color(int i, effect_params_t* params) { - if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.val }; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); diff --git a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h index 89f6965c3..d46288073 100644 --- a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_beacon(effect_params_t* params) { @@ -14,8 +14,7 @@ bool rgb_matrix_rainbow_beacon(effect_params_t* params) { int16_t sin_value = 2 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; + hsv.h = ((g_led_config.point[i].y - 32) * cos_value + (g_led_config.point[i].x - 112) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h index 0d57aef57..3b7d9689f 100644 --- a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { @@ -12,8 +12,7 @@ bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = abs8(point.y - 32) + (point.x - time) + rgb_matrix_config.hue; + hsv.h = abs8(g_led_config.point[i].y - 32) + (g_led_config.point[i].x - time) + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h index 03652758c..e92f35176 100644 --- a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h @@ -2,7 +2,7 @@ #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS extern rgb_counters_t g_rgb_counters; -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { @@ -14,8 +14,7 @@ bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { int16_t sin_value = 3 * (sin8(time) - 128); for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); - point_t point = g_rgb_leds[i].point; - hsv.h = ((point.y - 32) * cos_value + (56 - abs8(point.x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; + hsv.h = ((g_led_config.point[i].y - 32) * cos_value + (56 - abs8(g_led_config.point[i].x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index 0e3a87864..4ce1d65e5 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h @@ -3,10 +3,11 @@ #include "rgb_matrix_types.h" extern rgb_counters_t g_rgb_counters; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; static void raindrops_set_color(int i, effect_params_t* params) { - if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; // Take the shortest path between hues diff --git a/quantum/rgb_matrix_animations/solid_color_anim.h b/quantum/rgb_matrix_animations/solid_color_anim.h index 033c1f933..ba2cea15e 100644 --- a/quantum/rgb_matrix_animations/solid_color_anim.h +++ b/quantum/rgb_matrix_animations/solid_color_anim.h @@ -1,5 +1,6 @@ #pragma once +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; bool rgb_matrix_solid_color(effect_params_t* params) { diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h index 82483653a..c3dba8a5a 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h @@ -2,6 +2,7 @@ #if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h index 1dec1886d..8858f71e6 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -13,11 +13,10 @@ static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_par uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { RGB_MATRIX_TEST_LED_FLAGS(); - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); int16_t dist2 = 16; uint8_t dist3; diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h index 8952a1e2b..c0e3c2450 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -13,11 +13,10 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { RGB_MATRIX_TEST_LED_FLAGS(); - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); int16_t dist2 = 8; uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h index 9fc4d527a..abc7e36a8 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h @@ -2,6 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h index d86cb1284..3d1d38e80 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -13,11 +13,10 @@ static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_para uint8_t count = g_last_hit_tracker.count; for (uint8_t i = led_min; i < led_max; i++) { hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { RGB_MATRIX_TEST_LED_FLAGS(); - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) + dist * 5; if (effect > 255) diff --git a/quantum/rgb_matrix_animations/solid_splash_anim.h b/quantum/rgb_matrix_animations/solid_splash_anim.h index 14312f33d..4e5565d0d 100644 --- a/quantum/rgb_matrix_animations/solid_splash_anim.h +++ b/quantum/rgb_matrix_animations/solid_splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -14,10 +14,9 @@ static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* p for (uint8_t i = led_min; i < led_max; i++) { RGB_MATRIX_TEST_LED_FLAGS(); hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; if (effect > 255) diff --git a/quantum/rgb_matrix_animations/splash_anim.h b/quantum/rgb_matrix_animations/splash_anim.h index 3c96d451e..fbe776111 100644 --- a/quantum/rgb_matrix_animations/splash_anim.h +++ b/quantum/rgb_matrix_animations/splash_anim.h @@ -2,7 +2,7 @@ #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) -extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +extern led_config_t g_led_config; extern rgb_config_t rgb_matrix_config; extern last_hit_t g_last_hit_tracker; @@ -15,10 +15,9 @@ static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) RGB_MATRIX_TEST_LED_FLAGS(); hsv.h = rgb_matrix_config.hue; hsv.v = 0; - point_t point = g_rgb_leds[i].point; for (uint8_t j = start; j < count; j++) { - int16_t dx = point.x - g_last_hit_tracker.x[j]; - int16_t dy = point.y - g_last_hit_tracker.y[j]; + int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; + int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; uint8_t dist = sqrt16(dx * dx + dy * dy); uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; if (effect > 255) diff --git a/quantum/rgb_matrix_types.h b/quantum/rgb_matrix_types.h index 7a3bc6714..f890edd94 100644 --- a/quantum/rgb_matrix_types.h +++ b/quantum/rgb_matrix_types.h @@ -59,14 +59,6 @@ typedef struct PACKED { uint8_t y; } point_t; -typedef union { - uint8_t raw; - struct { - uint8_t row:4; // 16 max - uint8_t col:4; // 16 max - }; -} matrix_co_t; - #define HAS_FLAGS(bits, flags) ((bits & flags) == flags) #define HAS_ANY_FLAGS(bits, flags) ((bits & flags) != 0x00) @@ -76,11 +68,13 @@ typedef union { #define LED_FLAG_UNDERGLOW 0x02 #define LED_FLAG_KEYLIGHT 0x04 +#define NO_LED 255 + typedef struct PACKED { - matrix_co_t matrix_co; - point_t point; - uint8_t flags; -} rgb_led; + uint8_t matrix_co[MATRIX_ROWS][MATRIX_COLS]; + point_t point[DRIVER_LED_TOTAL]; + uint8_t flags[DRIVER_LED_TOTAL]; +} led_config_t; typedef union { uint32_t raw; diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index a2eab1b56..ea067a743 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -431,6 +431,7 @@ static void led_run_pattern(led_setup_t *f, float* ro, float* go, float* bo, flo } } +extern led_config_t g_led_config; static void led_matrix_massdrop_config_override(int i) { float ro = 0; @@ -438,14 +439,14 @@ static void led_matrix_massdrop_config_override(int i) float bo = 0; float po = (led_animation_orientation) - ? (float)g_rgb_leds[i].point.y / 64.f * 100 - : (float)g_rgb_leds[i].point.x / 224.f * 100; + ? (float)g_led_config.point[i].y / 64.f * 100 + : (float)g_led_config.point[i].x / 224.f * 100; uint8_t highest_active_layer = biton32(layer_state); - if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { + if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { //Do not act on this LED - } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) { + } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { //Do not act on this LED } else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) { //Do not act on this LED (Only show indicators) -- cgit v1.2.3-70-g09d2