aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/massdrop/alt/config_led.h37
-rw-r--r--keyboards/massdrop/alt/keymaps/default_md/keymap.c87
-rw-r--r--keyboards/massdrop/alt/keymaps/mac_md/keymap.c87
-rw-r--r--keyboards/massdrop/ctrl/config_led.h34
-rw-r--r--keyboards/massdrop/ctrl/keymaps/default_md/keymap.c91
-rw-r--r--keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c87
-rw-r--r--tmk_core/protocol/arm_atsam/md_rgb_matrix.c48
-rw-r--r--tmk_core/protocol/arm_atsam/md_rgb_matrix.h21
8 files changed, 430 insertions, 62 deletions
diff --git a/keyboards/massdrop/alt/config_led.h b/keyboards/massdrop/alt/config_led.h
index 82117b332..b600dd23b 100644
--- a/keyboards/massdrop/alt/config_led.h
+++ b/keyboards/massdrop/alt/config_led.h
@@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
58//swr: Matrix wiring SW Red row (1-12) 58//swr: Matrix wiring SW Red row (1-12)
59//swg: Matrix wiring SW Green row (1-12) 59//swg: Matrix wiring SW Green row (1-12)
60//swb: Matrix wiring SW Blue row (1-12) 60//swb: Matrix wiring SW Blue row (1-12)
61//scan: Associated key scancode if any 61//scan: Associated key matrix scancode (set 255 if none or 254 for LED to turn off in alternating mode)
62//Note: Origin 0,0 may be located anywhere as the software will do the final layout 62//Note: Origin 0,0 may be located anywhere as the software will do the final layout
63#define ISSI3733_LED_MAP { \ 63#define ISSI3733_LED_MAP { \
64 { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ 64 { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \
@@ -129,46 +129,45 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
129 { .id = 66, .x = 10.5, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 73 }, \ 129 { .id = 66, .x = 10.5, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 73 }, \
130 { .id = 67, .x = 11.25, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 74 }, \ 130 { .id = 67, .x = 11.25, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 74 }, \
131 { .id = 68, .x = -0.338, .y = -3.338, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 131 { .id = 68, .x = -0.338, .y = -3.338, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \
132 { .id = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 132 { .id = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
133 { .id = 70, .x = 1.263, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 133 { .id = 70, .x = 1.263, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
134 { .id = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 134 { .id = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
135 { .id = 72, .x = 3.008, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 135 { .id = 72, .x = 3.008, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
136 { .id = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 136 { .id = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
137 { .id = 74, .x = 4.753, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 137 { .id = 74, .x = 4.753, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
138 { .id = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 138 { .id = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
139 { .id = 76, .x = 6.497, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 139 { .id = 76, .x = 6.497, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \
140 { .id = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 140 { .id = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
141 { .id = 78, .x = 8.242, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 141 { .id = 78, .x = 8.242, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
142 { .id = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 142 { .id = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
143 { .id = 80, .x = 9.987, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 143 { .id = 80, .x = 9.987, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \
144 { .id = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 144 { .id = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
145 { .id = 82, .x = 11.588, .y = -3.338, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 145 { .id = 82, .x = 11.588, .y = -3.338, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \
146 { .id = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 146 { .id = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
147 { .id = 84, .x = 11.693, .y = -1.873, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 147 { .id = 84, .x = 11.693, .y = -1.873, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \
148 { .id = 85, .x = 11.693, .y = -1.123, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 148 { .id = 85, .x = 11.693, .y = -1.123, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \
149 { .id = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 149 { .id = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
150 { .id = 87, .x = 11.588, .y = 0.338, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 150 { .id = 87, .x = 11.588, .y = 0.338, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
151 { .id = 88, .x = 9.908, .y = 0.443, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 151 { .id = 88, .x = 9.908, .y = 0.443, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
152 { .id = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 152 { .id = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
153 { .id = 90, .x = 8.625, .y = 0.443, .adr = { .drv = 1, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 153 { .id = 90, .x = 8.625, .y = 0.443, .adr = { .drv = 1, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
154 { .id = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 154 { .id = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
155 { .id = 92, .x = 7.125, .y = 0.443, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 155 { .id = 92, .x = 7.125, .y = 0.443, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
156 { .id = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 156 { .id = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
157 { .id = 94, .x = 5.625, .y = 0.443, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 157 { .id = 94, .x = 5.625, .y = 0.443, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
158 { .id = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 158 { .id = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
159 { .id = 96, .x = 4.125, .y = 0.443, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 159 { .id = 96, .x = 4.125, .y = 0.443, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
160 { .id = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 160 { .id = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
161 { .id = 98, .x = 2.625, .y = 0.443, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 161 { .id = 98, .x = 2.625, .y = 0.443, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
162 { .id = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 162 { .id = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
163 { .id = 100, .x = 1.125, .y = 0.443, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 163 { .id = 100, .x = 1.125, .y = 0.443, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
164 { .id = 101, .x = -0.338, .y = 0.338, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 164 { .id = 101, .x = -0.338, .y = 0.338, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
165 { .id = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 165 { .id = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
166 { .id = 103, .x = -0.443, .y = -1.123, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 166 { .id = 103, .x = -0.443, .y = -1.123, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \
167 { .id = 104, .x = -0.443, .y = -1.873, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 167 { .id = 104, .x = -0.443, .y = -1.873, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \
168 { .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 168 { .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
169}; 169};
170 170
171
172#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality 171#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality
173#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) 172#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable)
174 #define USB_LED_NUM_LOCK_SCANCODE 255 173 #define USB_LED_NUM_LOCK_SCANCODE 255
diff --git a/keyboards/massdrop/alt/keymaps/default_md/keymap.c b/keyboards/massdrop/alt/keymaps/default_md/keymap.c
index 810585a3d..5bd543ed6 100644
--- a/keyboards/massdrop/alt/keymaps/default_md/keymap.c
+++ b/keyboards/massdrop/alt/keymaps/default_md/keymap.c
@@ -3,10 +3,15 @@
3enum alt_keycodes { 3enum alt_keycodes {
4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working 4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
5 L_BRD, //LED Brightness Decrease //Working 5 L_BRD, //LED Brightness Decrease //Working
6 L_EDG_I, //LED Edge Brightness Increase
7 L_EDG_D, //LED Edge Brightness Decrease
8 L_EDG_M, //LED Edge lighting mode
6 L_PTN, //LED Pattern Select Next //Working 9 L_PTN, //LED Pattern Select Next //Working
7 L_PTP, //LED Pattern Select Previous //Working 10 L_PTP, //LED Pattern Select Previous //Working
8 L_PSI, //LED Pattern Speed Increase //Working 11 L_PSI, //LED Pattern Speed Increase //Working
9 L_PSD, //LED Pattern Speed Decrease //Working 12 L_PSD, //LED Pattern Speed Decrease //Working
13 L_RATIOD,
14 L_RATIOI,
10 L_T_MD, //LED Toggle Mode //Working 15 L_T_MD, //LED Toggle Mode //Working
11 L_T_ONF, //LED Toggle On / Off //Broken 16 L_T_ONF, //LED Toggle On / Off //Broken
12 L_ON, //LED On //Broken 17 L_ON, //LED On //Broken
@@ -18,6 +23,7 @@ enum alt_keycodes {
18 DBG_MTRX, //DEBUG Toggle Matrix Prints // 23 DBG_MTRX, //DEBUG Toggle Matrix Prints //
19 DBG_KBD, //DEBUG Toggle Keyboard Prints // 24 DBG_KBD, //DEBUG Toggle Keyboard Prints //
20 DBG_MOU, //DEBUG Toggle Mouse Prints // 25 DBG_MOU, //DEBUG Toggle Mouse Prints //
26 DBG_FAC, //DEBUG Factory light testing (All on white)
21 MD_BOOT //Restart into bootloader after hold timeout //Working 27 MD_BOOT //Restart into bootloader after hold timeout //Working
22}; 28};
23 29
@@ -31,10 +37,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 ), 37 ),
32 [1] = LAYOUT( 38 [1] = LAYOUT(
33 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_MUTE, \ 39 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_MUTE, \
34 L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ 40 L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
35 L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ 41 L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
36 _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ 42 _______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
37 _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ 43 _______, _______, _______, DBG_FAC, _______, _______, KC_HOME, KC_PGDN, KC_END \
38 ), 44 ),
39 /* 45 /*
40 [X] = LAYOUT( 46 [X] = LAYOUT(
@@ -53,6 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
53 59
54bool process_record_user(uint16_t keycode, keyrecord_t *record) { 60bool process_record_user(uint16_t keycode, keyrecord_t *record) {
55 static uint32_t key_timer; 61 static uint32_t key_timer;
62 static uint8_t scroll_effect = 0;
56 63
57 switch (keycode) { 64 switch (keycode) {
58 case L_BRI: 65 case L_BRI:
@@ -69,6 +76,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
69 if (led_animation_breathing) gcr_breathe = gcr_desired; 76 if (led_animation_breathing) gcr_breathe = gcr_desired;
70 } 77 }
71 return false; 78 return false;
79 case L_EDG_M:
80 if (record->event.pressed) {
81 led_edge_mode++;
82 if (led_edge_mode > LED_EDGE_MODE_MAX) {
83 led_edge_mode = LED_EDGE_MODE_ALL;
84 }
85 }
86 return false;
87 case L_EDG_I:
88 if (record->event.pressed) {
89 led_edge_brightness += 0.1;
90 if (led_edge_brightness > 1) { led_edge_brightness = 1; }
91 }
92 return false;
93 case L_EDG_D:
94 if (record->event.pressed) {
95 led_edge_brightness -= 0.1;
96 if (led_edge_brightness < 0) { led_edge_brightness = 0; }
97 }
98 return false;
99 case L_RATIOI:
100 if (record->event.pressed) {
101 led_ratio_brightness += 0.2;
102 if (led_ratio_brightness > 2.0) { led_ratio_brightness = 2.0; }
103 }
104 return false;
105 case L_RATIOD:
106 if (record->event.pressed) {
107 led_ratio_brightness -= 0.2;
108 if (led_ratio_brightness < 0.0) { led_ratio_brightness = 0.0; }
109 }
110 return false;
72 case L_PTN: 111 case L_PTN:
73 if (record->event.pressed) { 112 if (record->event.pressed) {
74 if (led_animation_id == led_setups_count - 1) led_animation_id = 0; 113 if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -128,7 +167,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
128 return false; 167 return false;
129 case L_T_PTD: 168 case L_T_PTD:
130 if (record->event.pressed) { 169 if (record->event.pressed) {
131 led_animation_direction = !led_animation_direction; 170 scroll_effect++;
171 if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
172 led_animation_direction = 1;
173 led_animation_orientation = 0;
174 led_animation_circular = 0;
175 } else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
176 led_animation_direction = 1;
177 led_animation_orientation = 1;
178 led_animation_circular = 0;
179 } else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
180 led_animation_direction = 0;
181 led_animation_orientation = 1;
182 led_animation_circular = 0;
183 } else if (scroll_effect == 4) { //Patterns with scroll explode from center
184 led_animation_direction = 0;
185 led_animation_orientation = 0;
186 led_animation_circular = 1;
187 } else if (scroll_effect == 5) { //Patterns with scroll implode on center
188 led_animation_direction = 1;
189 led_animation_orientation = 0;
190 led_animation_circular = 1;
191 } else { //Patterns with scroll move horizontal (Left to right)
192 scroll_effect = 0;
193 led_animation_direction = 0;
194 led_animation_orientation = 0;
195 led_animation_circular = 0;
196 }
132 } 197 }
133 return false; 198 return false;
134 case U_T_AGCR: 199 case U_T_AGCR:
@@ -136,6 +201,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
136 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); 201 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
137 } 202 }
138 return false; 203 return false;
204 case DBG_FAC:
205 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
206 led_lighting_mode = LED_MODE_NORMAL;
207 led_edge_brightness = 1;
208 led_edge_mode = LED_EDGE_MODE_ALL;
209 led_animation_breathing = 0;
210 led_animation_id = 7; //led_programs.c led_setups leds_white index
211 gcr_desired = LED_GCR_MAX;
212 led_enabled = 1;
213 I2C3733_Control_Set(led_enabled);
214 }
215 return false;
139 case DBG_TOG: 216 case DBG_TOG:
140 if (record->event.pressed) { 217 if (record->event.pressed) {
141 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); 218 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
diff --git a/keyboards/massdrop/alt/keymaps/mac_md/keymap.c b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c
index b3626c1b6..bfcadf890 100644
--- a/keyboards/massdrop/alt/keymaps/mac_md/keymap.c
+++ b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c
@@ -3,10 +3,15 @@
3enum alt_keycodes { 3enum alt_keycodes {
4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working 4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
5 L_BRD, //LED Brightness Decrease //Working 5 L_BRD, //LED Brightness Decrease //Working
6 L_EDG_I, //LED Edge Brightness Increase
7 L_EDG_D, //LED Edge Brightness Decrease
8 L_EDG_M, //LED Edge lighting mode
6 L_PTN, //LED Pattern Select Next //Working 9 L_PTN, //LED Pattern Select Next //Working
7 L_PTP, //LED Pattern Select Previous //Working 10 L_PTP, //LED Pattern Select Previous //Working
8 L_PSI, //LED Pattern Speed Increase //Working 11 L_PSI, //LED Pattern Speed Increase //Working
9 L_PSD, //LED Pattern Speed Decrease //Working 12 L_PSD, //LED Pattern Speed Decrease //Working
13 L_RATIOD,
14 L_RATIOI,
10 L_T_MD, //LED Toggle Mode //Working 15 L_T_MD, //LED Toggle Mode //Working
11 L_T_ONF, //LED Toggle On / Off //Broken 16 L_T_ONF, //LED Toggle On / Off //Broken
12 L_ON, //LED On //Broken 17 L_ON, //LED On //Broken
@@ -18,6 +23,7 @@ enum alt_keycodes {
18 DBG_MTRX, //DEBUG Toggle Matrix Prints // 23 DBG_MTRX, //DEBUG Toggle Matrix Prints //
19 DBG_KBD, //DEBUG Toggle Keyboard Prints // 24 DBG_KBD, //DEBUG Toggle Keyboard Prints //
20 DBG_MOU, //DEBUG Toggle Mouse Prints // 25 DBG_MOU, //DEBUG Toggle Mouse Prints //
26 DBG_FAC, //DEBUG Factory light testing (All on white)
21 MD_BOOT //Restart into bootloader after hold timeout //Working 27 MD_BOOT //Restart into bootloader after hold timeout //Working
22}; 28};
23 29
@@ -31,10 +37,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 ), 37 ),
32 [1] = LAYOUT( 38 [1] = LAYOUT(
33 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_MUTE, \ 39 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_MUTE, \
34 L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ 40 L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
35 L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ 41 L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
36 _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \ 42 _______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
37 _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ 43 _______, _______, _______, DBG_FAC, _______, _______, KC_HOME, KC_PGDN, KC_END \
38 ), 44 ),
39 /* 45 /*
40 [X] = LAYOUT( 46 [X] = LAYOUT(
@@ -53,6 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
53 59
54bool process_record_user(uint16_t keycode, keyrecord_t *record) { 60bool process_record_user(uint16_t keycode, keyrecord_t *record) {
55 static uint32_t key_timer; 61 static uint32_t key_timer;
62 static uint8_t scroll_effect = 0;
56 63
57 switch (keycode) { 64 switch (keycode) {
58 case L_BRI: 65 case L_BRI:
@@ -69,6 +76,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
69 if (led_animation_breathing) gcr_breathe = gcr_desired; 76 if (led_animation_breathing) gcr_breathe = gcr_desired;
70 } 77 }
71 return false; 78 return false;
79 case L_EDG_M:
80 if (record->event.pressed) {
81 led_edge_mode++;
82 if (led_edge_mode > LED_EDGE_MODE_MAX) {
83 led_edge_mode = LED_EDGE_MODE_ALL;
84 }
85 }
86 return false;
87 case L_EDG_I:
88 if (record->event.pressed) {
89 led_edge_brightness += 0.1;
90 if (led_edge_brightness > 1) { led_edge_brightness = 1; }
91 }
92 return false;
93 case L_EDG_D:
94 if (record->event.pressed) {
95 led_edge_brightness -= 0.1;
96 if (led_edge_brightness < 0) { led_edge_brightness = 0; }
97 }
98 return false;
99 case L_RATIOI:
100 if (record->event.pressed) {
101 led_ratio_brightness += 0.2;
102 if (led_ratio_brightness > 2.0) { led_ratio_brightness = 2.0; }
103 }
104 return false;
105 case L_RATIOD:
106 if (record->event.pressed) {
107 led_ratio_brightness -= 0.2;
108 if (led_ratio_brightness < 0.0) { led_ratio_brightness = 0.0; }
109 }
110 return false;
72 case L_PTN: 111 case L_PTN:
73 if (record->event.pressed) { 112 if (record->event.pressed) {
74 if (led_animation_id == led_setups_count - 1) led_animation_id = 0; 113 if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -128,7 +167,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
128 return false; 167 return false;
129 case L_T_PTD: 168 case L_T_PTD:
130 if (record->event.pressed) { 169 if (record->event.pressed) {
131 led_animation_direction = !led_animation_direction; 170 scroll_effect++;
171 if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
172 led_animation_direction = 1;
173 led_animation_orientation = 0;
174 led_animation_circular = 0;
175 } else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
176 led_animation_direction = 1;
177 led_animation_orientation = 1;
178 led_animation_circular = 0;
179 } else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
180 led_animation_direction = 0;
181 led_animation_orientation = 1;
182 led_animation_circular = 0;
183 } else if (scroll_effect == 4) { //Patterns with scroll explode from center
184 led_animation_direction = 0;
185 led_animation_orientation = 0;
186 led_animation_circular = 1;
187 } else if (scroll_effect == 5) { //Patterns with scroll implode on center
188 led_animation_direction = 1;
189 led_animation_orientation = 0;
190 led_animation_circular = 1;
191 } else { //Patterns with scroll move horizontal (Left to right)
192 scroll_effect = 0;
193 led_animation_direction = 0;
194 led_animation_orientation = 0;
195 led_animation_circular = 0;
196 }
132 } 197 }
133 return false; 198 return false;
134 case U_T_AGCR: 199 case U_T_AGCR:
@@ -136,6 +201,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
136 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); 201 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
137 } 202 }
138 return false; 203 return false;
204 case DBG_FAC:
205 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
206 led_lighting_mode = LED_MODE_NORMAL;
207 led_edge_brightness = 1;
208 led_edge_mode = LED_EDGE_MODE_ALL;
209 led_animation_breathing = 0;
210 led_animation_id = 7; //led_programs.c led_setups leds_white index
211 gcr_desired = LED_GCR_MAX;
212 led_enabled = 1;
213 I2C3733_Control_Set(led_enabled);
214 }
215 return false;
139 case DBG_TOG: 216 case DBG_TOG:
140 if (record->event.pressed) { 217 if (record->event.pressed) {
141 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); 218 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
diff --git a/keyboards/massdrop/ctrl/config_led.h b/keyboards/massdrop/ctrl/config_led.h
index 0c91a0c80..de897ce1b 100644
--- a/keyboards/massdrop/ctrl/config_led.h
+++ b/keyboards/massdrop/ctrl/config_led.h
@@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
58//swr: Matrix wiring SW Red row (1-12) 58//swr: Matrix wiring SW Red row (1-12)
59//swg: Matrix wiring SW Green row (1-12) 59//swg: Matrix wiring SW Green row (1-12)
60//swb: Matrix wiring SW Blue row (1-12) 60//swb: Matrix wiring SW Blue row (1-12)
61//scan: Associated key scancode if any 61//scan: Associated key matrix scancode (set 255 if none or 254 for LED to turn off in alternating mode)
62//Note: Origin 0,0 may be located anywhere as the software will do the final layout 62//Note: Origin 0,0 may be located anywhere as the software will do the final layout
63#define ISSI3733_LED_MAP { \ 63#define ISSI3733_LED_MAP { \
64 { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ 64 { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \
@@ -149,37 +149,37 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
149 { .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 85 }, \ 149 { .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 85 }, \
150 { .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 86 }, \ 150 { .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 86 }, \
151 { .id = 88, .x = 13.433, .y = -4.43, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 151 { .id = 88, .x = 13.433, .y = -4.43, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
152 { .id = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 152 { .id = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
153 { .id = 90, .x = 11.14, .y = -4.535, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 153 { .id = 90, .x = 11.14, .y = -4.535, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
154 { .id = 91, .x = 9.995, .y = -4.535, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 154 { .id = 91, .x = 9.995, .y = -4.535, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
155 { .id = 92, .x = 8.85, .y = -4.535, .adr = { .drv = 1, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 155 { .id = 92, .x = 8.85, .y = -4.535, .adr = { .drv = 1, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
156 { .id = 93, .x = 7.705, .y = -4.535, .adr = { .drv = 1, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 156 { .id = 93, .x = 7.705, .y = -4.535, .adr = { .drv = 1, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
157 { .id = 94, .x = 6.56, .y = -4.535, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 157 { .id = 94, .x = 6.56, .y = -4.535, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
158 { .id = 95, .x = 5.415, .y = -4.535, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 158 { .id = 95, .x = 5.415, .y = -4.535, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
159 { .id = 96, .x = 4.27, .y = -4.535, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 159 { .id = 96, .x = 4.27, .y = -4.535, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
160 { .id = 97, .x = 3.125, .y = -4.535, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 160 { .id = 97, .x = 3.125, .y = -4.535, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
161 { .id = 98, .x = 1.98, .y = -4.535, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 161 { .id = 98, .x = 1.98, .y = -4.535, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
162 { .id = 99, .x = 0.835, .y = -4.535, .adr = { .drv = 2, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 162 { .id = 99, .x = 0.835, .y = -4.535, .adr = { .drv = 2, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
163 { .id = 100, .x = -0.307, .y = -4.43, .adr = { .drv = 2, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 163 { .id = 100, .x = -0.307, .y = -4.43, .adr = { .drv = 2, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
164 { .id = 101, .x = -0.41, .y = -3.245, .adr = { .drv = 2, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 164 { .id = 101, .x = -0.41, .y = -3.245, .adr = { .drv = 2, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
165 { .id = 102, .x = -0.41, .y = -2.06, .adr = { .drv = 2, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 165 { .id = 102, .x = -0.41, .y = -2.06, .adr = { .drv = 2, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
166 { .id = 103, .x = -0.41, .y = -0.875, .adr = { .drv = 2, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 166 { .id = 103, .x = -0.41, .y = -0.875, .adr = { .drv = 2, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
167 { .id = 104, .x = -0.308, .y = 0.31, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 167 { .id = 104, .x = -0.308, .y = 0.31, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
168 { .id = 105, .x = 0.835, .y = 0.415, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 168 { .id = 105, .x = 0.835, .y = 0.415, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
169 { .id = 106, .x = 1.98, .y = 0.415, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 169 { .id = 106, .x = 1.98, .y = 0.415, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
170 { .id = 107, .x = 3.125, .y = 0.415, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 170 { .id = 107, .x = 3.125, .y = 0.415, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
171 { .id = 108, .x = 4.27, .y = 0.415, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 171 { .id = 108, .x = 4.27, .y = 0.415, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
172 { .id = 109, .x = 5.415, .y = 0.415, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 172 { .id = 109, .x = 5.415, .y = 0.415, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
173 { .id = 110, .x = 6.56, .y = 0.415, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 173 { .id = 110, .x = 6.56, .y = 0.415, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
174 { .id = 111, .x = 7.705, .y = 0.415, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 174 { .id = 111, .x = 7.705, .y = 0.415, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
175 { .id = 112, .x = 8.85, .y = 0.415, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 175 { .id = 112, .x = 8.85, .y = 0.415, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
176 { .id = 113, .x = 9.995, .y = 0.415, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 176 { .id = 113, .x = 9.995, .y = 0.415, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
177 { .id = 114, .x = 11.14, .y = 0.415, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 177 { .id = 114, .x = 11.14, .y = 0.415, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
178 { .id = 115, .x = 12.285, .y = 0.415, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 178 { .id = 115, .x = 12.285, .y = 0.415, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
179 { .id = 116, .x = 13.432, .y = 0.31, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ 179 { .id = 116, .x = 13.432, .y = 0.31, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \
180 { .id = 117, .x = 13.535, .y = -0.875, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ 180 { .id = 117, .x = 13.535, .y = -0.875, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
181 { .id = 118, .x = 13.535, .y = -2.06, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ 181 { .id = 118, .x = 13.535, .y = -2.06, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \
182 { .id = 119, .x = 13.535, .y = -3.245, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ 182 { .id = 119, .x = 13.535, .y = -3.245, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
183}; 183};
184 184
185#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality 185#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality
diff --git a/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c b/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c
index 1083571ef..cf4eea646 100644
--- a/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c
+++ b/keyboards/massdrop/ctrl/keymaps/default_md/keymap.c
@@ -3,10 +3,15 @@
3enum ctrl_keycodes { 3enum ctrl_keycodes {
4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working 4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
5 L_BRD, //LED Brightness Decrease //Working 5 L_BRD, //LED Brightness Decrease //Working
6 L_EDG_I, //LED Edge Brightness Increase
7 L_EDG_D, //LED Edge Brightness Decrease
8 L_EDG_M, //LED Edge lighting mode
6 L_PTN, //LED Pattern Select Next //Working 9 L_PTN, //LED Pattern Select Next //Working
7 L_PTP, //LED Pattern Select Previous //Working 10 L_PTP, //LED Pattern Select Previous //Working
8 L_PSI, //LED Pattern Speed Increase //Working 11 L_PSI, //LED Pattern Speed Increase //Working
9 L_PSD, //LED Pattern Speed Decrease //Working 12 L_PSD, //LED Pattern Speed Decrease //Working
13 L_RATIOD,
14 L_RATIOI,
10 L_T_MD, //LED Toggle Mode //Working 15 L_T_MD, //LED Toggle Mode //Working
11 L_T_ONF, //LED Toggle On / Off //Broken 16 L_T_ONF, //LED Toggle On / Off //Broken
12 L_ON, //LED On //Broken 17 L_ON, //LED On //Broken
@@ -18,6 +23,7 @@ enum ctrl_keycodes {
18 DBG_MTRX, //DEBUG Toggle Matrix Prints // 23 DBG_MTRX, //DEBUG Toggle Matrix Prints //
19 DBG_KBD, //DEBUG Toggle Keyboard Prints // 24 DBG_KBD, //DEBUG Toggle Keyboard Prints //
20 DBG_MOU, //DEBUG Toggle Mouse Prints // 25 DBG_MOU, //DEBUG Toggle Mouse Prints //
26 DBG_FAC, //DEBUG Factory light testing (All on white)
21 MD_BOOT //Restart into bootloader after hold timeout //Working 27 MD_BOOT //Restart into bootloader after hold timeout //Working
22}; 28};
23 29
@@ -33,10 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33 [1] = LAYOUT( 39 [1] = LAYOUT(
34 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ 40 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \
35 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ 41 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
36 L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ 42 L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
37 L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 43 L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, \
38 _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, \ 44 _______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, \
39 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ 45 _______, _______, _______, DBG_FAC, _______, _______, _______, _______, _______, _______, _______ \
40 ), 46 ),
41 /* 47 /*
42 [X] = LAYOUT( 48 [X] = LAYOUT(
@@ -56,6 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
56 62
57bool process_record_user(uint16_t keycode, keyrecord_t *record) { 63bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 static uint32_t key_timer; 64 static uint32_t key_timer;
65 static uint8_t scroll_effect = 0;
59 66
60 switch (keycode) { 67 switch (keycode) {
61 case L_BRI: 68 case L_BRI:
@@ -72,6 +79,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
72 if (led_animation_breathing) gcr_breathe = gcr_desired; 79 if (led_animation_breathing) gcr_breathe = gcr_desired;
73 } 80 }
74 return false; 81 return false;
82 case L_EDG_M:
83 if (record->event.pressed) {
84 led_edge_mode++;
85 if (led_edge_mode > LED_EDGE_MODE_MAX) {
86 led_edge_mode = LED_EDGE_MODE_ALL;
87 }
88 }
89 return false;
90 case L_EDG_I:
91 if (record->event.pressed) {
92 led_edge_brightness += 0.1;
93 if (led_edge_brightness > 1) { led_edge_brightness = 1; }
94 }
95 return false;
96 case L_EDG_D:
97 if (record->event.pressed) {
98 led_edge_brightness -= 0.1;
99 if (led_edge_brightness < 0) { led_edge_brightness = 0; }
100 }
101 return false;
102 case L_RATIOI:
103 if (record->event.pressed) {
104 led_ratio_brightness += 0.2;
105 if (led_ratio_brightness > 2.0) { led_ratio_brightness = 2.0; }
106 }
107 return false;
108 case L_RATIOD:
109 if (record->event.pressed) {
110 led_ratio_brightness -= 0.2;
111 if (led_ratio_brightness < 0.0) { led_ratio_brightness = 0.0; }
112 }
113 return false;
75 case L_PTN: 114 case L_PTN:
76 if (record->event.pressed) { 115 if (record->event.pressed) {
77 if (led_animation_id == led_setups_count - 1) led_animation_id = 0; 116 if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -131,7 +170,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
131 return false; 170 return false;
132 case L_T_PTD: 171 case L_T_PTD:
133 if (record->event.pressed) { 172 if (record->event.pressed) {
134 led_animation_direction = !led_animation_direction; 173 scroll_effect++;
174 if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
175 led_animation_direction = 1;
176 led_animation_orientation = 0;
177 led_animation_circular = 0;
178 } else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
179 led_animation_direction = 1;
180 led_animation_orientation = 1;
181 led_animation_circular = 0;
182 } else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
183 led_animation_direction = 0;
184 led_animation_orientation = 1;
185 led_animation_circular = 0;
186 } else if (scroll_effect == 4) { //Patterns with scroll explode from center
187 led_animation_direction = 0;
188 led_animation_orientation = 0;
189 led_animation_circular = 1;
190 } else if (scroll_effect == 5) { //Patterns with scroll implode on center
191 led_animation_direction = 1;
192 led_animation_orientation = 0;
193 led_animation_circular = 1;
194 } else { //Patterns with scroll move horizontal (Left to right)
195 scroll_effect = 0;
196 led_animation_direction = 0;
197 led_animation_orientation = 0;
198 led_animation_circular = 0;
199 }
135 } 200 }
136 return false; 201 return false;
137 case U_T_AGCR: 202 case U_T_AGCR:
@@ -139,6 +204,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
139 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); 204 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
140 } 205 }
141 return false; 206 return false;
207 case DBG_FAC:
208 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
209 led_lighting_mode = LED_MODE_NORMAL;
210 led_edge_brightness = 1;
211 led_edge_mode = LED_EDGE_MODE_ALL;
212 led_animation_breathing = 0;
213 led_animation_id = 7; //led_programs.c led_setups leds_white index
214 gcr_desired = LED_GCR_MAX;
215 led_enabled = 1;
216 I2C3733_Control_Set(led_enabled);
217 }
218 return false;
142 case DBG_TOG: 219 case DBG_TOG:
143 if (record->event.pressed) { 220 if (record->event.pressed) {
144 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); 221 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
@@ -179,7 +256,7 @@ led_instruction_t led_instructions[] = {
179 //Flags can be found in tmk_core/protocol/arm_atsam/md_rgb_matrix.h (prefixed with LED_FLAG_) 256 //Flags can be found in tmk_core/protocol/arm_atsam/md_rgb_matrix.h (prefixed with LED_FLAG_)
180 //LED IDs can be found in config_led.h in the keyboard's directory 257 //LED IDs can be found in config_led.h in the keyboard's directory
181 //Examples are below 258 //Examples are below
182 259
183 //All LEDs use the user's selected pattern (this is the factory default) 260 //All LEDs use the user's selected pattern (this is the factory default)
184 { .flags = LED_FLAG_USE_ROTATE_PATTERN }, 261 { .flags = LED_FLAG_USE_ROTATE_PATTERN },
185 262
@@ -188,7 +265,7 @@ led_instruction_t led_instructions[] = {
188 265
189 //Specific LEDs use specified RGB values while all others are off 266 //Specific LEDs use specified RGB values while all others are off
190 // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 }, 267 // { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 },
191 268
192 //All LEDs use the user's selected pattern 269 //All LEDs use the user's selected pattern
193 //On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green 270 //On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green
194 //When layer 1 is active, key LEDs use red (id0 32 - 17: 1111 1111 1111 1111 0000 0000 0000 0000 = 0xFFFF0000) (except top row 16 - 1) 271 //When layer 1 is active, key LEDs use red (id0 32 - 17: 1111 1111 1111 1111 0000 0000 0000 0000 = 0xFFFF0000) (except top row 16 - 1)
diff --git a/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c
index ba02d5e50..4a85b375b 100644
--- a/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c
+++ b/keyboards/massdrop/ctrl/keymaps/mac_md/keymap.c
@@ -3,10 +3,15 @@
3enum ctrl_keycodes { 3enum ctrl_keycodes {
4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working 4 L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
5 L_BRD, //LED Brightness Decrease //Working 5 L_BRD, //LED Brightness Decrease //Working
6 L_EDG_I, //LED Edge Brightness Increase
7 L_EDG_D, //LED Edge Brightness Decrease
8 L_EDG_M, //LED Edge lighting mode
6 L_PTN, //LED Pattern Select Next //Working 9 L_PTN, //LED Pattern Select Next //Working
7 L_PTP, //LED Pattern Select Previous //Working 10 L_PTP, //LED Pattern Select Previous //Working
8 L_PSI, //LED Pattern Speed Increase //Working 11 L_PSI, //LED Pattern Speed Increase //Working
9 L_PSD, //LED Pattern Speed Decrease //Working 12 L_PSD, //LED Pattern Speed Decrease //Working
13 L_RATIOD,
14 L_RATIOI,
10 L_T_MD, //LED Toggle Mode //Working 15 L_T_MD, //LED Toggle Mode //Working
11 L_T_ONF, //LED Toggle On / Off //Broken 16 L_T_ONF, //LED Toggle On / Off //Broken
12 L_ON, //LED On //Broken 17 L_ON, //LED On //Broken
@@ -18,6 +23,7 @@ enum ctrl_keycodes {
18 DBG_MTRX, //DEBUG Toggle Matrix Prints // 23 DBG_MTRX, //DEBUG Toggle Matrix Prints //
19 DBG_KBD, //DEBUG Toggle Keyboard Prints // 24 DBG_KBD, //DEBUG Toggle Keyboard Prints //
20 DBG_MOU, //DEBUG Toggle Mouse Prints // 25 DBG_MOU, //DEBUG Toggle Mouse Prints //
26 DBG_FAC, //DEBUG Factory light testing (All on white)
21 MD_BOOT //Restart into bootloader after hold timeout //Working 27 MD_BOOT //Restart into bootloader after hold timeout //Working
22}; 28};
23 29
@@ -33,10 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33 [1] = LAYOUT( 39 [1] = LAYOUT(
34 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \ 40 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \
35 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \ 41 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
36 L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ 42 L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
37 L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 43 L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, \
38 _______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, \ 44 _______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, \
39 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ 45 _______, _______, _______, DBG_FAC, _______, _______, _______, _______, _______, _______, _______ \
40 ), 46 ),
41 /* 47 /*
42 [X] = LAYOUT( 48 [X] = LAYOUT(
@@ -64,6 +70,7 @@ void matrix_scan_user(void) {
64 70
65bool process_record_user(uint16_t keycode, keyrecord_t *record) { 71bool process_record_user(uint16_t keycode, keyrecord_t *record) {
66 static uint32_t key_timer; 72 static uint32_t key_timer;
73 static uint8_t scroll_effect = 0;
67 74
68 switch (keycode) { 75 switch (keycode) {
69 case L_BRI: 76 case L_BRI:
@@ -80,6 +87,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
80 if (led_animation_breathing) gcr_breathe = gcr_desired; 87 if (led_animation_breathing) gcr_breathe = gcr_desired;
81 } 88 }
82 return false; 89 return false;
90 case L_EDG_M:
91 if (record->event.pressed) {
92 led_edge_mode++;
93 if (led_edge_mode > LED_EDGE_MODE_MAX) {
94 led_edge_mode = LED_EDGE_MODE_ALL;
95 }
96 }
97 return false;
98 case L_EDG_I:
99 if (record->event.pressed) {
100 led_edge_brightness += 0.1;
101 if (led_edge_brightness > 1) { led_edge_brightness = 1; }
102 }
103 return false;
104 case L_EDG_D:
105 if (record->event.pressed) {
106 led_edge_brightness -= 0.1;
107 if (led_edge_brightness < 0) { led_edge_brightness = 0; }
108 }
109 return false;
110 case L_RATIOI:
111 if (record->event.pressed) {
112 led_ratio_brightness += 0.2;
113 if (led_ratio_brightness > 2.0) { led_ratio_brightness = 2.0; }
114 }
115 return false;
116 case L_RATIOD:
117 if (record->event.pressed) {
118 led_ratio_brightness -= 0.2;
119 if (led_ratio_brightness < 0.0) { led_ratio_brightness = 0.0; }
120 }
121 return false;
83 case L_PTN: 122 case L_PTN:
84 if (record->event.pressed) { 123 if (record->event.pressed) {
85 if (led_animation_id == led_setups_count - 1) led_animation_id = 0; 124 if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -139,7 +178,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
139 return false; 178 return false;
140 case L_T_PTD: 179 case L_T_PTD:
141 if (record->event.pressed) { 180 if (record->event.pressed) {
142 led_animation_direction = !led_animation_direction; 181 scroll_effect++;
182 if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
183 led_animation_direction = 1;
184 led_animation_orientation = 0;
185 led_animation_circular = 0;
186 } else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
187 led_animation_direction = 1;
188 led_animation_orientation = 1;
189 led_animation_circular = 0;
190 } else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
191 led_animation_direction = 0;
192 led_animation_orientation = 1;
193 led_animation_circular = 0;
194 } else if (scroll_effect == 4) { //Patterns with scroll explode from center
195 led_animation_direction = 0;
196 led_animation_orientation = 0;
197 led_animation_circular = 1;
198 } else if (scroll_effect == 5) { //Patterns with scroll implode on center
199 led_animation_direction = 1;
200 led_animation_orientation = 0;
201 led_animation_circular = 1;
202 } else { //Patterns with scroll move horizontal (Left to right)
203 scroll_effect = 0;
204 led_animation_direction = 0;
205 led_animation_orientation = 0;
206 led_animation_circular = 0;
207 }
143 } 208 }
144 return false; 209 return false;
145 case U_T_AGCR: 210 case U_T_AGCR:
@@ -147,6 +212,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
147 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); 212 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
148 } 213 }
149 return false; 214 return false;
215 case DBG_FAC:
216 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
217 led_lighting_mode = LED_MODE_NORMAL;
218 led_edge_brightness = 1;
219 led_edge_mode = LED_EDGE_MODE_ALL;
220 led_animation_breathing = 0;
221 led_animation_id = 7; //led_programs.c led_setups leds_white index
222 gcr_desired = LED_GCR_MAX;
223 led_enabled = 1;
224 I2C3733_Control_Set(led_enabled);
225 }
226 return false;
150 case DBG_TOG: 227 case DBG_TOG:
151 if (record->event.pressed) { 228 if (record->event.pressed) {
152 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); 229 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
index 98967aac8..43d9f2ee6 100644
--- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
+++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
@@ -341,6 +341,10 @@ uint8_t led_lighting_mode = LED_MODE_NORMAL;
341uint8_t led_enabled = 1; 341uint8_t led_enabled = 1;
342uint8_t led_animation_breathe_cur = BREATHE_MIN_STEP; 342uint8_t led_animation_breathe_cur = BREATHE_MIN_STEP;
343uint8_t breathe_dir = 1; 343uint8_t breathe_dir = 1;
344uint8_t led_animation_circular = 0;
345float led_edge_brightness = 1.0f;
346float led_ratio_brightness = 1.0f;
347uint8_t led_edge_mode = LED_EDGE_MODE_ALL;
344 348
345static void led_run_pattern(led_setup_t* f, float* ro, float* go, float* bo, float pos) { 349static void led_run_pattern(led_setup_t* f, float* ro, float* go, float* bo, float pos) {
346 float po; 350 float po;
@@ -398,16 +402,32 @@ static void led_run_pattern(led_setup_t* f, float* ro, float* go, float* bo, flo
398 } 402 }
399} 403}
400 404
405# define RGB_MAX_DISTANCE 232.9635f
406
401static void md_rgb_matrix_config_override(int i) { 407static void md_rgb_matrix_config_override(int i) {
402 float ro = 0; 408 float ro = 0;
403 float go = 0; 409 float go = 0;
404 float bo = 0; 410 float bo = 0;
405 411 float po;
406 float po = (led_animation_orientation) ? (float)g_led_config.point[i].y / 64.f * 100 : (float)g_led_config.point[i].x / 224.f * 100;
407 412
408 uint8_t highest_active_layer = biton32(layer_state); 413 uint8_t highest_active_layer = biton32(layer_state);
409 414
410 if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { 415 if (led_animation_circular) {
416 // TODO: should use min/max values from LED configuration instead of
417 // hard-coded 224, 64
418 // po = sqrtf((powf(fabsf((disp.width / 2) - (led_cur->x - disp.left)), 2) + powf(fabsf((disp.height / 2) - (led_cur->y - disp.bottom)), 2))) / disp.max_distance * 100;
419 po = sqrtf((powf(fabsf((224 / 2) - (float)g_led_config.point[i].x), 2) + powf(fabsf((64 / 2) - (float)g_led_config.point[i].y), 2))) / RGB_MAX_DISTANCE * 100;
420 } else {
421 if (led_animation_orientation) {
422 po = (float)g_led_config.point[i].y / 64.f * 100;
423 } else {
424 po = (float)g_led_config.point[i].x / 224.f * 100;
425 }
426 }
427
428 if (led_edge_mode == LED_EDGE_MODE_ALTERNATE && LED_IS_EDGE_ALT(led_map[i].scan)) {
429 // Do not act on this LED (Edge alternate lighting mode)
430 } else if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) {
411 // Do not act on this LED 431 // Do not act on this LED
412 } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) { 432 } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) {
413 // Do not act on this LED 433 // Do not act on this LED
@@ -465,10 +485,30 @@ static void md_rgb_matrix_config_override(int i) {
465 } 485 }
466 } 486 }
467 487
488 // Adjust edge LED brightness
489 if (led_edge_brightness != 1 && LED_IS_EDGE(led_map[i].scan)) {
490 ro *= led_edge_brightness;
491 go *= led_edge_brightness;
492 bo *= led_edge_brightness;
493 }
494
495 // Adjust ratio of key vs. underglow (edge) LED brightness
496 if (LED_IS_EDGE(led_map[i].scan) && led_ratio_brightness > 1.0) {
497 // Decrease edge (underglow) LEDs
498 ro *= (2.0 - led_ratio_brightness);
499 go *= (2.0 - led_ratio_brightness);
500 bo *= (2.0 - led_ratio_brightness);
501 } else if (LED_IS_KEY(led_map[i].scan) && led_ratio_brightness < 1.0) {
502 // Decrease KEY LEDs
503 ro *= led_ratio_brightness;
504 go *= led_ratio_brightness;
505 bo *= led_ratio_brightness;
506 }
507
468 led_buffer[i].r = (uint8_t)ro; 508 led_buffer[i].r = (uint8_t)ro;
469 led_buffer[i].g = (uint8_t)go; 509 led_buffer[i].g = (uint8_t)go;
470 led_buffer[i].b = (uint8_t)bo; 510 led_buffer[i].b = (uint8_t)bo;
471} 511}
472 512
473# endif // USE_MASSDROP_CONFIGURATOR 513# endif // USE_MASSDROP_CONFIGURATOR
474#endif // RGB_MATRIX_ENABLE \ No newline at end of file 514#endif // RGB_MATRIX_ENABLE
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.h b/tmk_core/protocol/arm_atsam/md_rgb_matrix.h
index 76ccaa678..f72dca298 100644
--- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.h
+++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.h
@@ -128,6 +128,8 @@ typedef struct led_instruction_s {
128 uint32_t id1; // Bitwise id, IDs 32-63 128 uint32_t id1; // Bitwise id, IDs 32-63
129 uint32_t id2; // Bitwise id, IDs 64-95 129 uint32_t id2; // Bitwise id, IDs 64-95
130 uint32_t id3; // Bitwise id, IDs 96-127 130 uint32_t id3; // Bitwise id, IDs 96-127
131 uint32_t id4; // Bitwise id, IDs 128-159
132 uint32_t id5; // Bitwise id, IDs 160-191
131 uint8_t layer; 133 uint8_t layer;
132 uint8_t r; 134 uint8_t r;
133 uint8_t g; 135 uint8_t g;
@@ -146,6 +148,11 @@ extern uint8_t led_enabled;
146extern uint8_t led_animation_breathe_cur; 148extern uint8_t led_animation_breathe_cur;
147extern uint8_t led_animation_direction; 149extern uint8_t led_animation_direction;
148extern uint8_t breathe_dir; 150extern uint8_t breathe_dir;
151extern uint8_t led_animation_orientation;
152extern uint8_t led_animation_circular;
153extern float led_edge_brightness;
154extern float led_ratio_brightness;
155extern uint8_t led_edge_mode;
149 156
150# define LED_MODE_NORMAL 0 // Must be 0 157# define LED_MODE_NORMAL 0 // Must be 0
151# define LED_MODE_KEYS_ONLY 1 158# define LED_MODE_KEYS_ONLY 1
@@ -153,6 +160,20 @@ extern uint8_t breathe_dir;
153# define LED_MODE_INDICATORS_ONLY 3 160# define LED_MODE_INDICATORS_ONLY 3
154# define LED_MODE_MAX_INDEX LED_MODE_INDICATORS_ONLY // Must be highest value 161# define LED_MODE_MAX_INDEX LED_MODE_INDICATORS_ONLY // Must be highest value
155 162
163# define LED_EDGE_MODE_ALL 0 // All edge LEDs are active (Must be 0)
164# define LED_EDGE_MODE_ALTERNATE 1 // Alternate mode of edge LEDs are active (Intention is for 'only every other edge LED' to be active)
165# define LED_EDGE_MODE_MAX LED_EDGE_MODE_ALTERNATE // Must be the highest valued LED edge mode
166
167# define LED_EDGE_FULL_MODE 255 // LEDs configured with this scan code will always be on for edge lighting modes
168# define LED_EDGE_ALT_MODE 254 // LEDs configured with this scan code will turn off in edge alternating mode
169# define LED_EDGE_MIN_SCAN 254 // LEDs configured with scan code >= to this are assigned as edge LEDs
170# define LED_INDICATOR_SCAN 253 // LEDs configured as dedicated indicators
171
172# define LED_IS_KEY(scan) (scan < LED_INDICATOR_SCAN) // Return true if an LED's scan value indicates it is a key LED
173# define LED_IS_EDGE(scan) (scan >= LED_EDGE_MIN_SCAN) // Return true if an LED's scan value indicates an edge LED
174# define LED_IS_EDGE_ALT(scan) (scan == LED_EDGE_ALT_MODE) // Return true if an LED's scan value indicates an alternate edge mode LED
175# define LED_IS_INDICATOR(scan) (scan == LED_INDICATOR_SCAN) // Return true if an LED's scan value indicates it is a dedicated Indicator
176
156#endif // USE_MASSDROP_CONFIGURATOR 177#endif // USE_MASSDROP_CONFIGURATOR
157 178
158#endif //_LED_MATRIX_H_ 179#endif //_LED_MATRIX_H_