diff options
| author | Nick Brassel <nick@tzarc.org> | 2021-07-27 10:11:52 +1000 |
|---|---|---|
| committer | Nick Brassel <nick@tzarc.org> | 2021-07-27 10:11:52 +1000 |
| commit | 394272a2663692081ce6f5b74f6f761090111ad0 (patch) | |
| tree | 7971135837ced00c1628d26c3cf3d3156a1403ca | |
| parent | e0375c0b710c075780e7ffe1afe4c39fccd96929 (diff) | |
| parent | b1c5a53a68ca8a304e7739467f2793c223853f68 (diff) | |
| download | qmk_firmware-394272a2663692081ce6f5b74f6f761090111ad0.tar.gz qmk_firmware-394272a2663692081ce6f5b74f6f761090111ad0.zip | |
Merge remote-tracking branch 'upstream/master' into develop
26 files changed, 394 insertions, 559 deletions
diff --git a/keyboards/40percentclub/nein/info.json b/keyboards/40percentclub/nein/info.json index 2a28ffc00..4c4b2a384 100644 --- a/keyboards/40percentclub/nein/info.json +++ b/keyboards/40percentclub/nein/info.json | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | "width": 3, | 5 | "width": 3, |
| 6 | "height": 3, | 6 | "height": 3, |
| 7 | "layouts": { | 7 | "layouts": { |
| 8 | "LAYOUT": { | 8 | "LAYOUT_ortho_3x3": { |
| 9 | "layout": [ | 9 | "layout": [ |
| 10 | {"x":0, "y":0}, | 10 | {"x":0, "y":0}, |
| 11 | {"x":1, "y":0}, | 11 | {"x":1, "y":0}, |
diff --git a/keyboards/cannonkeys/ortho48/ortho48.h b/keyboards/cannonkeys/ortho48/ortho48.h index b0197c3cf..1e51c37af 100644 --- a/keyboards/cannonkeys/ortho48/ortho48.h +++ b/keyboards/cannonkeys/ortho48/ortho48.h | |||
| @@ -6,13 +6,13 @@ | |||
| 6 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ | 6 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ |
| 7 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ | 7 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ |
| 8 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ | 8 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ |
| 9 | k30, k31, k32, k33, k34, k36 , k37, k38, k39, k3a, k3b \ | 9 | k30, k31, k32, k33, k34, k35 , k37, k38, k39, k3a, k3b \ |
| 10 | ) \ | 10 | ) \ |
| 11 | { \ | 11 | { \ |
| 12 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ | 12 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ |
| 13 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ | 13 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ |
| 14 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ | 14 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ |
| 15 | { k30, k31, k32, k33, k34, KC_NO, k36, k37, k38, k39, k3a, k3b } \ | 15 | { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #define LAYOUT_ortho_4x12( \ | 18 | #define LAYOUT_ortho_4x12( \ |
diff --git a/keyboards/cannonkeys/ortho60/ortho60.h b/keyboards/cannonkeys/ortho60/ortho60.h index 2dcc00ddb..0f3ae127a 100644 --- a/keyboards/cannonkeys/ortho60/ortho60.h +++ b/keyboards/cannonkeys/ortho60/ortho60.h | |||
| @@ -7,14 +7,14 @@ | |||
| 7 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ | 7 | k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ |
| 8 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ | 8 | k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ |
| 9 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ | 9 | k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ |
| 10 | k40, k41, k42, k43, k44, k46 , k47, k48, k49, k4a, k4b \ | 10 | k40, k41, k42, k43, k44, k45 , k47, k48, k49, k4a, k4b \ |
| 11 | ) \ | 11 | ) \ |
| 12 | { \ | 12 | { \ |
| 13 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ | 13 | { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ |
| 14 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ | 14 | { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ |
| 15 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ | 15 | { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ |
| 16 | { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ | 16 | { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ |
| 17 | { k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k4a, k4b }, \ | 17 | { k40, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4a, k4b }, \ |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | #define LAYOUT_ortho_5x12( \ | 20 | #define LAYOUT_ortho_5x12( \ |
diff --git a/keyboards/dztech/dz60rgb/v2_1/rules.mk b/keyboards/dztech/dz60rgb/v2_1/rules.mk index ff6a24b93..d47b2692e 100644 --- a/keyboards/dztech/dz60rgb/v2_1/rules.mk +++ b/keyboards/dztech/dz60rgb/v2_1/rules.mk | |||
| @@ -3,6 +3,7 @@ MCU = atmega32u4 | |||
| 3 | 3 | ||
| 4 | # Bootloader selection | 4 | # Bootloader selection |
| 5 | BOOTLOADER = lufa-ms | 5 | BOOTLOADER = lufa-ms |
| 6 | BOOTLOADER_SIZE = 6144 | ||
| 6 | 7 | ||
| 7 | # Build Options | 8 | # Build Options |
| 8 | # change yes to no to disable | 9 | # change yes to no to disable |
diff --git a/keyboards/dztech/dz65rgb/v3/rules.mk b/keyboards/dztech/dz65rgb/v3/rules.mk index ace821a32..10a6be57f 100755 --- a/keyboards/dztech/dz65rgb/v3/rules.mk +++ b/keyboards/dztech/dz65rgb/v3/rules.mk | |||
| @@ -3,6 +3,7 @@ MCU = atmega32u4 | |||
| 3 | 3 | ||
| 4 | # Bootloader selection | 4 | # Bootloader selection |
| 5 | BOOTLOADER = lufa-ms | 5 | BOOTLOADER = lufa-ms |
| 6 | BOOTLOADER_SIZE = 6144 | ||
| 6 | 7 | ||
| 7 | # Build Options | 8 | # Build Options |
| 8 | # change yes to no to disable | 9 | # change yes to no to disable |
diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 4d3567521..47dd1b0cc 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c | |||
| @@ -44,29 +44,29 @@ extern inline void ergodox_led_all_set(uint8_t n); | |||
| 44 | 44 | ||
| 45 | keyboard_config_t keyboard_config; | 45 | keyboard_config_t keyboard_config; |
| 46 | 46 | ||
| 47 | bool i2c_initialized = 0; | 47 | bool i2c_initialized = 0; |
| 48 | i2c_status_t mcp23018_status = 0x20; | 48 | i2c_status_t mcp23018_status = 0x20; |
| 49 | 49 | ||
| 50 | void matrix_init_kb(void) { | 50 | void matrix_init_kb(void) { |
| 51 | // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") | 51 | // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") |
| 52 | TCCR1A = 0b10101001; // set and configure fast PWM | 52 | TCCR1A = 0b10101001; // set and configure fast PWM |
| 53 | TCCR1B = 0b00001001; // set and configure fast PWM | 53 | TCCR1B = 0b00001001; // set and configure fast PWM |
| 54 | 54 | ||
| 55 | // (tied to Vcc for hardware convenience) | 55 | // (tied to Vcc for hardware convenience) |
| 56 | DDRB &= ~(1<<4); // set B(4) as input | 56 | DDRB &= ~(1 << 4); // set B(4) as input |
| 57 | PORTB &= ~(1<<4); // set B(4) internal pull-up disabled | 57 | PORTB &= ~(1 << 4); // set B(4) internal pull-up disabled |
| 58 | 58 | ||
| 59 | // unused pins - C7, D4, D5, D7, E6 | 59 | // unused pins - C7, D4, D5, D7, E6 |
| 60 | // set as input with internal pull-up enabled | 60 | // set as input with internal pull-up enabled |
| 61 | DDRC &= ~(1<<7); | 61 | DDRC &= ~(1 << 7); |
| 62 | DDRD &= ~(1<<5 | 1<<4); | 62 | DDRD &= ~(1 << 5 | 1 << 4); |
| 63 | DDRE &= ~(1<<6); | 63 | DDRE &= ~(1 << 6); |
| 64 | PORTC |= (1<<7); | 64 | PORTC |= (1 << 7); |
| 65 | PORTD |= (1<<5 | 1<<4); | 65 | PORTD |= (1 << 5 | 1 << 4); |
| 66 | PORTE |= (1<<6); | 66 | PORTE |= (1 << 6); |
| 67 | 67 | ||
| 68 | keyboard_config.raw = eeconfig_read_kb(); | 68 | keyboard_config.raw = eeconfig_read_kb(); |
| 69 | ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4 ); | 69 | ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4); |
| 70 | #ifdef RGB_MATRIX_ENABLE | 70 | #ifdef RGB_MATRIX_ENABLE |
| 71 | if (keyboard_config.rgb_matrix_enable) { | 71 | if (keyboard_config.rgb_matrix_enable) { |
| 72 | rgb_matrix_set_flags(LED_FLAG_ALL); | 72 | rgb_matrix_set_flags(LED_FLAG_ALL); |
| @@ -80,8 +80,7 @@ void matrix_init_kb(void) { | |||
| 80 | matrix_init_user(); | 80 | matrix_init_user(); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | void ergodox_blink_all_leds(void) | 83 | void ergodox_blink_all_leds(void) { |
| 84 | { | ||
| 85 | ergodox_led_all_off(); | 84 | ergodox_led_all_off(); |
| 86 | ergodox_led_all_set(LED_BRIGHTNESS_DEFAULT); | 85 | ergodox_led_all_set(LED_BRIGHTNESS_DEFAULT); |
| 87 | ergodox_right_led_1_on(); | 86 | ergodox_right_led_1_on(); |
| @@ -94,17 +93,17 @@ void ergodox_blink_all_leds(void) | |||
| 94 | ergodox_left_led_1_on(); | 93 | ergodox_left_led_1_on(); |
| 95 | _delay_ms(50); | 94 | _delay_ms(50); |
| 96 | if (!mcp23018_status) { | 95 | if (!mcp23018_status) { |
| 97 | mcp23018_status = ergodox_left_leds_update(); | 96 | mcp23018_status = ergodox_left_leds_update(); |
| 98 | } | 97 | } |
| 99 | ergodox_left_led_2_on(); | 98 | ergodox_left_led_2_on(); |
| 100 | _delay_ms(50); | 99 | _delay_ms(50); |
| 101 | if (!mcp23018_status) { | 100 | if (!mcp23018_status) { |
| 102 | mcp23018_status = ergodox_left_leds_update(); | 101 | mcp23018_status = ergodox_left_leds_update(); |
| 103 | } | 102 | } |
| 104 | ergodox_left_led_3_on(); | 103 | ergodox_left_led_3_on(); |
| 105 | _delay_ms(50); | 104 | _delay_ms(50); |
| 106 | if (!mcp23018_status) { | 105 | if (!mcp23018_status) { |
| 107 | mcp23018_status = ergodox_left_leds_update(); | 106 | mcp23018_status = ergodox_left_leds_update(); |
| 108 | } | 107 | } |
| 109 | #endif | 108 | #endif |
| 110 | ergodox_right_led_1_off(); | 109 | ergodox_right_led_1_off(); |
| @@ -116,21 +115,21 @@ void ergodox_blink_all_leds(void) | |||
| 116 | _delay_ms(50); | 115 | _delay_ms(50); |
| 117 | ergodox_left_led_1_off(); | 116 | ergodox_left_led_1_off(); |
| 118 | if (!mcp23018_status) { | 117 | if (!mcp23018_status) { |
| 119 | mcp23018_status = ergodox_left_leds_update(); | 118 | mcp23018_status = ergodox_left_leds_update(); |
| 120 | } | 119 | } |
| 121 | _delay_ms(50); | 120 | _delay_ms(50); |
| 122 | ergodox_left_led_2_off(); | 121 | ergodox_left_led_2_off(); |
| 123 | if (!mcp23018_status) { | 122 | if (!mcp23018_status) { |
| 124 | mcp23018_status = ergodox_left_leds_update(); | 123 | mcp23018_status = ergodox_left_leds_update(); |
| 125 | } | 124 | } |
| 126 | _delay_ms(50); | 125 | _delay_ms(50); |
| 127 | ergodox_left_led_3_off(); | 126 | ergodox_left_led_3_off(); |
| 128 | if (!mcp23018_status) { | 127 | if (!mcp23018_status) { |
| 129 | mcp23018_status = ergodox_left_leds_update(); | 128 | mcp23018_status = ergodox_left_leds_update(); |
| 130 | } | 129 | } |
| 131 | #endif | 130 | #endif |
| 132 | 131 | ||
| 133 | //ergodox_led_all_on(); | 132 | // ergodox_led_all_on(); |
| 134 | //_delay_ms(333); | 133 | //_delay_ms(333); |
| 135 | ergodox_led_all_off(); | 134 | ergodox_led_all_off(); |
| 136 | } | 135 | } |
| @@ -156,27 +155,35 @@ uint8_t init_mcp23018(void) { | |||
| 156 | // - unused : input : 1 | 155 | // - unused : input : 1 |
| 157 | // - input : input : 1 | 156 | // - input : input : 1 |
| 158 | // - driving : output : 0 | 157 | // - driving : output : 0 |
| 159 | mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 158 | mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); |
| 160 | mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 159 | if (mcp23018_status) goto out; |
| 161 | mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 160 | mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); |
| 162 | mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 161 | if (mcp23018_status) goto out; |
| 162 | mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); | ||
| 163 | if (mcp23018_status) goto out; | ||
| 164 | mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); | ||
| 165 | if (mcp23018_status) goto out; | ||
| 163 | i2c_stop(); | 166 | i2c_stop(); |
| 164 | 167 | ||
| 165 | // set pull-up | 168 | // set pull-up |
| 166 | // - unused : on : 1 | 169 | // - unused : on : 1 |
| 167 | // - input : on : 1 | 170 | // - input : on : 1 |
| 168 | // - driving : off : 0 | 171 | // - driving : off : 0 |
| 169 | mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 172 | mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); |
| 170 | mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 173 | if (mcp23018_status) goto out; |
| 171 | mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 174 | mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); |
| 172 | mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; | 175 | if (mcp23018_status) goto out; |
| 176 | mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); | ||
| 177 | if (mcp23018_status) goto out; | ||
| 178 | mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); | ||
| 179 | if (mcp23018_status) goto out; | ||
| 173 | 180 | ||
| 174 | out: | 181 | out: |
| 175 | i2c_stop(); | 182 | i2c_stop(); |
| 176 | 183 | ||
| 177 | #ifdef LEFT_LEDS | 184 | #ifdef LEFT_LEDS |
| 178 | if (!mcp23018_status) mcp23018_status = ergodox_left_leds_update(); | 185 | if (!mcp23018_status) mcp23018_status = ergodox_left_leds_update(); |
| 179 | #endif // LEFT_LEDS | 186 | #endif // LEFT_LEDS |
| 180 | 187 | ||
| 181 | // SREG=sreg_prev; | 188 | // SREG=sreg_prev; |
| 182 | 189 | ||
| @@ -185,12 +192,12 @@ out: | |||
| 185 | 192 | ||
| 186 | #ifdef LEFT_LEDS | 193 | #ifdef LEFT_LEDS |
| 187 | uint8_t ergodox_left_leds_update(void) { | 194 | uint8_t ergodox_left_leds_update(void) { |
| 188 | if (mcp23018_status) { // if there was an error | 195 | if (mcp23018_status) { // if there was an error |
| 189 | return mcp23018_status; | 196 | return mcp23018_status; |
| 190 | } | 197 | } |
| 191 | #define LEFT_LED_1_SHIFT 7 // in MCP23018 port B | 198 | # define LEFT_LED_1_SHIFT 7 // in MCP23018 port B |
| 192 | #define LEFT_LED_2_SHIFT 6 // in MCP23018 port B | 199 | # define LEFT_LED_2_SHIFT 6 // in MCP23018 port B |
| 193 | #define LEFT_LED_3_SHIFT 7 // in MCP23018 port A | 200 | # define LEFT_LED_3_SHIFT 7 // in MCP23018 port A |
| 194 | 201 | ||
| 195 | // set logical value (doesn't matter on inputs) | 202 | // set logical value (doesn't matter on inputs) |
| 196 | // - unused : hi-Z : 1 | 203 | // - unused : hi-Z : 1 |
| @@ -200,47 +207,42 @@ uint8_t ergodox_left_leds_update(void) { | |||
| 200 | if (mcp23018_status) goto out; | 207 | if (mcp23018_status) goto out; |
| 201 | mcp23018_status = i2c_write(OLATA, ERGODOX_EZ_I2C_TIMEOUT); | 208 | mcp23018_status = i2c_write(OLATA, ERGODOX_EZ_I2C_TIMEOUT); |
| 202 | if (mcp23018_status) goto out; | 209 | if (mcp23018_status) goto out; |
| 203 | mcp23018_status = i2c_write(0b11111111 | 210 | mcp23018_status = i2c_write(0b11111111 & ~(ergodox_left_led_3 << LEFT_LED_3_SHIFT), ERGODOX_EZ_I2C_TIMEOUT); |
| 204 | & ~(ergodox_left_led_3<<LEFT_LED_3_SHIFT), | ||
| 205 | ERGODOX_EZ_I2C_TIMEOUT); | ||
| 206 | if (mcp23018_status) goto out; | 211 | if (mcp23018_status) goto out; |
| 207 | mcp23018_status = i2c_write(0b11111111 | 212 | mcp23018_status = i2c_write(0b11111111 & ~(ergodox_left_led_2 << LEFT_LED_2_SHIFT) & ~(ergodox_left_led_1 << LEFT_LED_1_SHIFT), ERGODOX_EZ_I2C_TIMEOUT); |
| 208 | & ~(ergodox_left_led_2<<LEFT_LED_2_SHIFT) | ||
| 209 | & ~(ergodox_left_led_1<<LEFT_LED_1_SHIFT), | ||
| 210 | ERGODOX_EZ_I2C_TIMEOUT); | ||
| 211 | if (mcp23018_status) goto out; | 213 | if (mcp23018_status) goto out; |
| 212 | 214 | ||
| 213 | out: | 215 | out: |
| 214 | i2c_stop(); | 216 | i2c_stop(); |
| 215 | return mcp23018_status; | 217 | return mcp23018_status; |
| 216 | } | 218 | } |
| 217 | #endif | 219 | #endif |
| 218 | 220 | ||
| 219 | |||
| 220 | #ifdef SWAP_HANDS_ENABLE | 221 | #ifdef SWAP_HANDS_ENABLE |
| 221 | __attribute__ ((weak)) | 222 | __attribute__((weak)) |
| 222 | // swap-hands action needs a matrix to define the swap | 223 | // swap-hands action needs a matrix to define the swap |
| 223 | const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { | 224 | const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { |
| 224 | /* Left hand, matrix positions */ | 225 | /* Left hand, matrix positions */ |
| 225 | {{0,13}, {1,13}, {2,13}, {3,13}, {4,13}, {5,13}}, | 226 | {{0, 13}, {1, 13}, {2, 13}, {3, 13}, {4, 13}, {5, 13}}, |
| 226 | {{0,12}, {1,12}, {2,12}, {3,12}, {4,12}, {5,12}}, | 227 | {{0, 12}, {1, 12}, {2, 12}, {3, 12}, {4, 12}, {5, 12}}, |
| 227 | {{0,11}, {1,11}, {2,11}, {3,11}, {4,11}, {5,11}}, | 228 | {{0, 11}, {1, 11}, {2, 11}, {3, 11}, {4, 11}, {5, 11}}, |
| 228 | {{0,10}, {1,10}, {2,10}, {3,10}, {4,10}, {5,10}}, | 229 | {{0, 10}, {1, 10}, {2, 10}, {3, 10}, {4, 10}, {5, 10}}, |
| 229 | {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, | 230 | {{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}, {5, 9}}, |
| 230 | {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, | 231 | {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}}, |
| 231 | {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, | 232 | {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}}, |
| 232 | /* Right hand, matrix positions */ | 233 | /* Right hand, matrix positions */ |
| 233 | {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, | 234 | {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}, |
| 234 | {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, | 235 | {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}}, |
| 235 | {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, | 236 | {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}}, |
| 236 | {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, | 237 | {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}, |
| 237 | {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, | 238 | {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}}, |
| 238 | {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, | 239 | {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}, |
| 239 | {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, | 240 | {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}}, |
| 240 | }; | 241 | }; |
| 241 | #endif | 242 | #endif |
| 242 | 243 | ||
| 243 | #ifdef RGB_MATRIX_ENABLE | 244 | #ifdef RGB_MATRIX_ENABLE |
| 245 | // clang-format off | ||
| 244 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | 246 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { |
| 245 | /* driver | 247 | /* driver |
| 246 | * | R location | 248 | * | R location |
| @@ -335,24 +337,14 @@ led_config_t g_led_config = { { | |||
| 335 | 4, 4, 4, 4, 4, 4, | 337 | 4, 4, 4, 4, 4, 4, |
| 336 | 4, 4, 1, 1, 1, 1 | 338 | 4, 4, 1, 1, 1, 1 |
| 337 | } }; | 339 | } }; |
| 340 | // clang-format on | ||
| 338 | 341 | ||
| 339 | void suspend_power_down_kb(void) { | 342 | # ifdef ORYX_CONFIGURATOR |
| 340 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 341 | rgb_matrix_set_suspend_state(true); | ||
| 342 | suspend_power_down_user(); | ||
| 343 | } | ||
| 344 | |||
| 345 | void suspend_wakeup_init_kb(void) { | ||
| 346 | rgb_matrix_set_suspend_state(false); | ||
| 347 | suspend_wakeup_init_user(); | ||
| 348 | } | ||
| 349 | |||
| 350 | #ifdef ORYX_CONFIGURATOR | ||
| 351 | void keyboard_post_init_kb(void) { | 343 | void keyboard_post_init_kb(void) { |
| 352 | rgb_matrix_enable_noeeprom(); | 344 | rgb_matrix_enable_noeeprom(); |
| 353 | keyboard_post_init_user(); | 345 | keyboard_post_init_user(); |
| 354 | } | 346 | } |
| 355 | #endif | 347 | # endif |
| 356 | #endif | 348 | #endif |
| 357 | 349 | ||
| 358 | #ifdef ORYX_CONFIGURATOR | 350 | #ifdef ORYX_CONFIGURATOR |
| @@ -360,51 +352,48 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |||
| 360 | switch (keycode) { | 352 | switch (keycode) { |
| 361 | case LED_LEVEL: | 353 | case LED_LEVEL: |
| 362 | if (record->event.pressed) { | 354 | if (record->event.pressed) { |
| 363 | keyboard_config.led_level++; | 355 | keyboard_config.led_level++; |
| 364 | if (keyboard_config.led_level > 4) { | 356 | if (keyboard_config.led_level > 4) { |
| 365 | keyboard_config.led_level = 0; | 357 | keyboard_config.led_level = 0; |
| 366 | } | 358 | } |
| 367 | ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4 ); | 359 | ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4); |
| 368 | eeconfig_update_kb(keyboard_config.raw); | 360 | eeconfig_update_kb(keyboard_config.raw); |
| 369 | layer_state_set_kb(layer_state); | 361 | layer_state_set_kb(layer_state); |
| 370 | } | 362 | } |
| 371 | break; | 363 | break; |
| 372 | #ifdef RGB_MATRIX_ENABLE | 364 | # ifdef RGB_MATRIX_ENABLE |
| 373 | case TOGGLE_LAYER_COLOR: | 365 | case TOGGLE_LAYER_COLOR: |
| 374 | if (record->event.pressed) { | 366 | if (record->event.pressed) { |
| 375 | keyboard_config.disable_layer_led ^= 1; | 367 | keyboard_config.disable_layer_led ^= 1; |
| 376 | if (keyboard_config.disable_layer_led) | 368 | if (keyboard_config.disable_layer_led) rgb_matrix_set_color_all(0, 0, 0); |
| 377 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 378 | eeconfig_update_kb(keyboard_config.raw); | 369 | eeconfig_update_kb(keyboard_config.raw); |
| 379 | } | 370 | } |
| 380 | break; | 371 | break; |
| 381 | case RGB_TOG: | 372 | case RGB_TOG: |
| 382 | if (record->event.pressed) { | 373 | if (record->event.pressed) { |
| 383 | switch (rgb_matrix_get_flags()) { | 374 | switch (rgb_matrix_get_flags()) { |
| 384 | case LED_FLAG_ALL: { | 375 | case LED_FLAG_ALL: { |
| 385 | rgb_matrix_set_flags(LED_FLAG_NONE); | 376 | rgb_matrix_set_flags(LED_FLAG_NONE); |
| 386 | keyboard_config.rgb_matrix_enable = false; | 377 | keyboard_config.rgb_matrix_enable = false; |
| 387 | rgb_matrix_set_color_all(0, 0, 0); | 378 | rgb_matrix_set_color_all(0, 0, 0); |
| 388 | } | 379 | } break; |
| 389 | break; | 380 | default: { |
| 390 | default: { | 381 | rgb_matrix_set_flags(LED_FLAG_ALL); |
| 391 | rgb_matrix_set_flags(LED_FLAG_ALL); | 382 | keyboard_config.rgb_matrix_enable = true; |
| 392 | keyboard_config.rgb_matrix_enable = true; | 383 | } break; |
| 393 | } | 384 | } |
| 394 | break; | 385 | eeconfig_update_kb(keyboard_config.raw); |
| 395 | } | ||
| 396 | eeconfig_update_kb(keyboard_config.raw); | ||
| 397 | } | 386 | } |
| 398 | return false; | 387 | return false; |
| 399 | #endif | 388 | # endif |
| 400 | } | 389 | } |
| 401 | return process_record_user(keycode, record); | 390 | return process_record_user(keycode, record); |
| 402 | } | 391 | } |
| 403 | #endif | 392 | #endif |
| 404 | 393 | ||
| 405 | void eeconfig_init_kb(void) { // EEPROM is getting reset! | 394 | void eeconfig_init_kb(void) { // EEPROM is getting reset! |
| 406 | keyboard_config.raw = 0; | 395 | keyboard_config.raw = 0; |
| 407 | keyboard_config.led_level = 4; | 396 | keyboard_config.led_level = 4; |
| 408 | keyboard_config.rgb_matrix_enable = true; | 397 | keyboard_config.rgb_matrix_enable = true; |
| 409 | eeconfig_update_kb(keyboard_config.raw); | 398 | eeconfig_update_kb(keyboard_config.raw); |
| 410 | eeconfig_init_user(); | 399 | eeconfig_init_user(); |
diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index 9079e48fc..3c0ef320a 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c | |||
| @@ -2,20 +2,20 @@ | |||
| 2 | #include "version.h" | 2 | #include "version.h" |
| 3 | 3 | ||
| 4 | enum layers { | 4 | enum layers { |
| 5 | BASE, // default layer | 5 | BASE, // default layer |
| 6 | SYMB, // symbols | 6 | SYMB, // symbols |
| 7 | MDIA, // media keys | 7 | MDIA, // media keys |
| 8 | }; | 8 | }; |
| 9 | 9 | ||
| 10 | enum custom_keycodes { | 10 | enum custom_keycodes { |
| 11 | #ifdef ORYX_CONFIGURATOR | 11 | #ifdef ORYX_CONFIGURATOR |
| 12 | VRSN = EZ_SAFE_RANGE, | 12 | VRSN = EZ_SAFE_RANGE, |
| 13 | #else | 13 | #else |
| 14 | VRSN = SAFE_RANGE, | 14 | VRSN = SAFE_RANGE, |
| 15 | #endif | 15 | #endif |
| 16 | RGB_SLD | ||
| 17 | }; | 16 | }; |
| 18 | 17 | ||
| 18 | // clang-format off | ||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 20 | /* Keymap 0: Basic layer | 20 | /* Keymap 0: Basic layer |
| 21 | * | 21 | * |
| @@ -77,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 77 | KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, | 77 | KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, |
| 78 | KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, | 78 | KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, |
| 79 | EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS, | 79 | EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS, |
| 80 | RGB_MOD, KC_TRNS, RGB_TOG, RGB_SLD, | 80 | RGB_MOD, KC_TRNS, RGB_TOG, RGB_M_P, |
| 81 | KC_TRNS, KC_TRNS, | 81 | KC_TRNS, KC_TRNS, |
| 82 | RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, RGB_HUD, RGB_HUI | 82 | RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, RGB_HUD, RGB_HUI |
| 83 | ), | 83 | ), |
| @@ -115,94 +115,90 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 115 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK | 115 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK |
| 116 | ), | 116 | ), |
| 117 | }; | 117 | }; |
| 118 | // clang-format on | ||
| 118 | 119 | ||
| 119 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 120 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 120 | if (record->event.pressed) { | 121 | if (record->event.pressed) { |
| 121 | switch (keycode) { | 122 | switch (keycode) { |
| 122 | case VRSN: | 123 | case VRSN: |
| 123 | SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); | 124 | SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); |
| 124 | return false; | 125 | return false; |
| 125 | #ifdef RGBLIGHT_ENABLE | 126 | } |
| 126 | case RGB_SLD: | ||
| 127 | rgblight_mode(1); | ||
| 128 | return false; | ||
| 129 | #endif | ||
| 130 | } | 127 | } |
| 131 | } | 128 | return true; |
| 132 | return true; | ||
| 133 | } | 129 | } |
| 134 | 130 | ||
| 135 | // Runs just one time when the keyboard initializes. | 131 | // Runs just one time when the keyboard initializes. |
| 136 | void keyboard_post_init_user(void) { | 132 | void keyboard_post_init_user(void) { |
| 137 | #ifdef RGBLIGHT_COLOR_LAYER_0 | 133 | #ifdef RGBLIGHT_COLOR_LAYER_0 |
| 138 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); | 134 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); |
| 139 | #endif | 135 | #endif |
| 140 | }; | 136 | }; |
| 141 | 137 | ||
| 142 | // Runs whenever there is a layer state change. | 138 | // Runs whenever there is a layer state change. |
| 143 | layer_state_t layer_state_set_user(layer_state_t state) { | 139 | layer_state_t layer_state_set_user(layer_state_t state) { |
| 144 | ergodox_board_led_off(); | 140 | ergodox_board_led_off(); |
| 145 | ergodox_right_led_1_off(); | 141 | ergodox_right_led_1_off(); |
| 146 | ergodox_right_led_2_off(); | 142 | ergodox_right_led_2_off(); |
| 147 | ergodox_right_led_3_off(); | 143 | ergodox_right_led_3_off(); |
| 148 | 144 | ||
| 149 | uint8_t layer = get_highest_layer(state); | 145 | uint8_t layer = get_highest_layer(state); |
| 150 | switch (layer) { | 146 | switch (layer) { |
| 151 | case 0: | 147 | case 0: |
| 152 | #ifdef RGBLIGHT_COLOR_LAYER_0 | 148 | #ifdef RGBLIGHT_COLOR_LAYER_0 |
| 153 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); | 149 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); |
| 154 | #endif | 150 | #endif |
| 155 | break; | 151 | break; |
| 156 | case 1: | 152 | case 1: |
| 157 | ergodox_right_led_1_on(); | 153 | ergodox_right_led_1_on(); |
| 158 | #ifdef RGBLIGHT_COLOR_LAYER_1 | 154 | #ifdef RGBLIGHT_COLOR_LAYER_1 |
| 159 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1); | 155 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1); |
| 160 | #endif | 156 | #endif |
| 161 | break; | 157 | break; |
| 162 | case 2: | 158 | case 2: |
| 163 | ergodox_right_led_2_on(); | 159 | ergodox_right_led_2_on(); |
| 164 | #ifdef RGBLIGHT_COLOR_LAYER_2 | 160 | #ifdef RGBLIGHT_COLOR_LAYER_2 |
| 165 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2); | 161 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2); |
| 166 | #endif | 162 | #endif |
| 167 | break; | 163 | break; |
| 168 | case 3: | 164 | case 3: |
| 169 | ergodox_right_led_3_on(); | 165 | ergodox_right_led_3_on(); |
| 170 | #ifdef RGBLIGHT_COLOR_LAYER_3 | 166 | #ifdef RGBLIGHT_COLOR_LAYER_3 |
| 171 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3); | 167 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3); |
| 172 | #endif | 168 | #endif |
| 173 | break; | 169 | break; |
| 174 | case 4: | 170 | case 4: |
| 175 | ergodox_right_led_1_on(); | 171 | ergodox_right_led_1_on(); |
| 176 | ergodox_right_led_2_on(); | 172 | ergodox_right_led_2_on(); |
| 177 | #ifdef RGBLIGHT_COLOR_LAYER_4 | 173 | #ifdef RGBLIGHT_COLOR_LAYER_4 |
| 178 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4); | 174 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4); |
| 179 | #endif | 175 | #endif |
| 180 | break; | 176 | break; |
| 181 | case 5: | 177 | case 5: |
| 182 | ergodox_right_led_1_on(); | 178 | ergodox_right_led_1_on(); |
| 183 | ergodox_right_led_3_on(); | 179 | ergodox_right_led_3_on(); |
| 184 | #ifdef RGBLIGHT_COLOR_LAYER_5 | 180 | #ifdef RGBLIGHT_COLOR_LAYER_5 |
| 185 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5); | 181 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5); |
| 186 | #endif | 182 | #endif |
| 187 | break; | 183 | break; |
| 188 | case 6: | 184 | case 6: |
| 189 | ergodox_right_led_2_on(); | 185 | ergodox_right_led_2_on(); |
| 190 | ergodox_right_led_3_on(); | 186 | ergodox_right_led_3_on(); |
| 191 | #ifdef RGBLIGHT_COLOR_LAYER_6 | 187 | #ifdef RGBLIGHT_COLOR_LAYER_6 |
| 192 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6); | 188 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6); |
| 193 | #endif | 189 | #endif |
| 194 | break; | 190 | break; |
| 195 | case 7: | 191 | case 7: |
| 196 | ergodox_right_led_1_on(); | 192 | ergodox_right_led_1_on(); |
| 197 | ergodox_right_led_2_on(); | 193 | ergodox_right_led_2_on(); |
| 198 | ergodox_right_led_3_on(); | 194 | ergodox_right_led_3_on(); |
| 199 | #ifdef RGBLIGHT_COLOR_LAYER_7 | 195 | #ifdef RGBLIGHT_COLOR_LAYER_7 |
| 200 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7); | 196 | rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7); |
| 201 | #endif | 197 | #endif |
| 202 | break; | 198 | break; |
| 203 | default: | 199 | default: |
| 204 | break; | 200 | break; |
| 205 | } | 201 | } |
| 206 | 202 | ||
| 207 | return state; | 203 | return state; |
| 208 | }; | 204 | }; |
diff --git a/keyboards/ergodox_ez/rules.mk b/keyboards/ergodox_ez/rules.mk index 7b189be45..4198486b3 100644 --- a/keyboards/ergodox_ez/rules.mk +++ b/keyboards/ergodox_ez/rules.mk | |||
| @@ -2,13 +2,6 @@ | |||
| 2 | MCU = atmega32u4 | 2 | MCU = atmega32u4 |
| 3 | 3 | ||
| 4 | # Bootloader selection | 4 | # Bootloader selection |
| 5 | # Teensy halfkay | ||
| 6 | # Pro Micro caterina | ||
| 7 | # Atmel DFU atmel-dfu | ||
| 8 | # LUFA DFU lufa-dfu | ||
| 9 | # QMK DFU qmk-dfu | ||
| 10 | # ATmega32A bootloadHID | ||
| 11 | # ATmega328P USBasp | ||
| 12 | BOOTLOADER = halfkay | 5 | BOOTLOADER = halfkay |
| 13 | 6 | ||
| 14 | # If you have Left LEDs (see | 7 | # If you have Left LEDs (see |
diff --git a/keyboards/melgeek/mj6xy/rev3/config.h b/keyboards/melgeek/mj6xy/rev3/config.h index 5024f7a3f..8ea2b7203 100755 --- a/keyboards/melgeek/mj6xy/rev3/config.h +++ b/keyboards/melgeek/mj6xy/rev3/config.h | |||
| @@ -42,6 +42,8 @@ | |||
| 42 | 42 | ||
| 43 | #ifdef RGB_DI_PIN | 43 | #ifdef RGB_DI_PIN |
| 44 | # define RGBLIGHT_ANIMATIONS | 44 | # define RGBLIGHT_ANIMATIONS |
| 45 | # define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_EFFECT_RAINBOW_MOOD + 6) | ||
| 46 | # define RGBLIGHT_DEFAULT_SPD 10 | ||
| 45 | # define RGBLED_NUM 16 | 47 | # define RGBLED_NUM 16 |
| 46 | # define RGBLIGHT_HUE_STEP 8 | 48 | # define RGBLIGHT_HUE_STEP 8 |
| 47 | # define RGBLIGHT_SAT_STEP 8 | 49 | # define RGBLIGHT_SAT_STEP 8 |
diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h index c1a139dc7..522cb0ab2 100644 --- a/keyboards/moonlander/config.h +++ b/keyboards/moonlander/config.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> | 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> |
| 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> |
| 3 | * Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) | 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/moonlander/keymaps/default/config.h b/keyboards/moonlander/keymaps/default/config.h index 576aae9f5..83ea2a1b5 100644 --- a/keyboards/moonlander/keymaps/default/config.h +++ b/keyboards/moonlander/keymaps/default/config.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> | 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> |
| 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> |
| 3 | * Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) | 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c index 6d98a8607..0cb7fa5d2 100644 --- a/keyboards/moonlander/keymaps/default/keymap.c +++ b/keyboards/moonlander/keymaps/default/keymap.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> | 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> |
| 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> |
| 3 | * Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) | 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/moonlander/matrix.c b/keyboards/moonlander/matrix.c index 566f8bb1b..dbd44d161 100644 --- a/keyboards/moonlander/matrix.c +++ b/keyboards/moonlander/matrix.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> | 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> |
| 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> |
| 3 | * Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) | 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/moonlander/moonlander.c b/keyboards/moonlander/moonlander.c index bc4047b84..d66b74d97 100644 --- a/keyboards/moonlander/moonlander.c +++ b/keyboards/moonlander/moonlander.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> | 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> |
| 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> |
| 3 | * Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) | 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
| @@ -340,15 +340,6 @@ led_config_t g_led_config = { { | |||
| 340 | } }; | 340 | } }; |
| 341 | // clang-format on | 341 | // clang-format on |
| 342 | 342 | ||
| 343 | void suspend_power_down_kb(void) { | ||
| 344 | rgb_matrix_set_suspend_state(true); | ||
| 345 | suspend_power_down_user(); | ||
| 346 | } | ||
| 347 | |||
| 348 | void suspend_wakeup_init_kb(void) { | ||
| 349 | rgb_matrix_set_suspend_state(false); | ||
| 350 | suspend_wakeup_init_user(); | ||
| 351 | } | ||
| 352 | #endif | 343 | #endif |
| 353 | 344 | ||
| 354 | #ifdef AUDIO_ENABLE | 345 | #ifdef AUDIO_ENABLE |
diff --git a/keyboards/moonlander/moonlander.h b/keyboards/moonlander/moonlander.h index 08bec5c07..859826021 100644 --- a/keyboards/moonlander/moonlander.h +++ b/keyboards/moonlander/moonlander.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> | 1 | /* Copyright 2020 ZSA Technology Labs, Inc <@zsa> |
| 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2020 Jack Humbert <jack.humb@gmail.com> |
| 3 | * Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) | 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/moonlander/readme.md b/keyboards/moonlander/readme.md index 7ddfdb84a..0ad2e4775 100644 --- a/keyboards/moonlander/readme.md +++ b/keyboards/moonlander/readme.md | |||
| @@ -19,7 +19,23 @@ Flashing example for this keyboard: | |||
| 19 | 19 | ||
| 20 | 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). | 20 | 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). |
| 21 | 21 | ||
| 22 | ## Oryx Configuation | 22 | |
| 23 | ## Moonlander Customization | ||
| 24 | |||
| 25 | ### Indicator LEDs | ||
| 26 | |||
| 27 | There are 6 functions for enabling and disabling the LEDs on the top of the boards. The functions are `ML_LED_1(bool)` through `ML_LED_6(bool)`, with the first LED being the left most LED on the left hand, and the sixth LED being the right most LED on the right side. | ||
| 28 | |||
| 29 | By default, the Indicator LEDs are used to indicate the layer state for the keyboard. If you wish to change this (and indicate caps/num/scroll lock status instead), then define `MOONLANDER_USER_LEDS` in your `config.h` file. | ||
| 30 | |||
| 31 | |||
| 32 | ### Oryx Configuration | ||
| 33 | |||
| 34 | To enable the features from Oryx (ZSA's Configurator), either compile the the `default` keymap, or add `#define ORYX_CONFIGURATOR` to your `config.h` file. | ||
| 35 | |||
| 36 | This enables the front Indicator LEDs, and the `TOGGLE_LAYER_COLOR` keycode. The `TOGGLE_LAYER_COLOR` keycode toggles the customized LED map configured on Oryx. | ||
| 37 | |||
| 38 | ### RGB Matrix Features | ||
| 23 | 39 | ||
| 24 | If you're using the Smart LED (layer indication) feature from the Oryx Configurator, you want to make sure that you enable these options by adding `#define ORYX_CONFIGURATOR` to your keymap's `config.h`. | 40 | If you're using the Smart LED (layer indication) feature from the Oryx Configurator, you want to make sure that you enable these options by adding `#define ORYX_CONFIGURATOR` to your keymap's `config.h`. |
| 25 | 41 | ||
diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h index 5317a5156..ffc2d14c6 100644 --- a/keyboards/planck/ez/config.h +++ b/keyboards/planck/ez/config.h | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* | 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> |
| 2 | * Copyright 2018 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2015 ZSA Technology Labs Inc (@zsa) |
| 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 3 | * | 4 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index 818dc6658..5c68726a0 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c | |||
| @@ -1,4 +1,6 @@ | |||
| 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> | 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> |
| 2 | * Copyright 2015 ZSA Technology Labs Inc (@zsa) | ||
| 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | * | 4 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/planck/ez/ez.h b/keyboards/planck/ez/ez.h index 14506dd72..19cc26eea 100644 --- a/keyboards/planck/ez/ez.h +++ b/keyboards/planck/ez/ez.h | |||
| @@ -1,4 +1,6 @@ | |||
| 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> | 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> |
| 2 | * Copyright 2015 ZSA Technology Labs Inc (@zsa) | ||
| 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 2 | * | 4 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/planck/ez/glow/config.h b/keyboards/planck/ez/glow/config.h index 21a339da2..55ce28901 100644 --- a/keyboards/planck/ez/glow/config.h +++ b/keyboards/planck/ez/glow/config.h | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* | 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> |
| 2 | * Copyright 2018 Jack Humbert <jack.humb@gmail.com> | 2 | * Copyright 2015 ZSA Technology Labs Inc (@zsa) |
| 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 3 | * | 4 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/keyboards/planck/ez/glow/glow.c b/keyboards/planck/ez/glow/glow.c index 1813ccae0..c6733bbe5 100644 --- a/keyboards/planck/ez/glow/glow.c +++ b/keyboards/planck/ez/glow/glow.c | |||
| @@ -1 +1,19 @@ | |||
| 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> | ||
| 2 | * Copyright 2015 ZSA Technology Labs Inc (@zsa) | ||
| 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 4 | * | ||
| 5 | * This program is free software: you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 1 | #include "glow.h" | 19 | #include "glow.h" |
diff --git a/keyboards/planck/ez/glow/glow.h b/keyboards/planck/ez/glow/glow.h index d8a01f435..cfc26b5e0 100644 --- a/keyboards/planck/ez/glow/glow.h +++ b/keyboards/planck/ez/glow/glow.h | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | /* Copyright 2018 Jack Humbert <jack.humb@gmail.com> | ||
| 2 | * Copyright 2015 ZSA Technology Labs Inc (@zsa) | ||
| 3 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 4 | * | ||
| 5 | * This program is free software: you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 1 | #pragma once | 19 | #pragma once |
| 2 | 20 | ||
| 3 | #include "ez.h" | 21 | #include "ez.h" |
diff --git a/keyboards/planck/ez/readme.md b/keyboards/planck/ez/readme.md index 247bf7448..f85ab5969 100644 --- a/keyboards/planck/ez/readme.md +++ b/keyboards/planck/ez/readme.md | |||
| @@ -4,24 +4,26 @@ | |||
| 4 | 4 | ||
| 5 | A variant of the Planck featuring a 2u spacebar and per-key RGB backlighting. | 5 | A variant of the Planck featuring a 2u spacebar and per-key RGB backlighting. |
| 6 | 6 | ||
| 7 | Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) | 7 | Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert), [Drashna Jael're](https://github.com/drashna) |
| 8 | Hardware Supported: Planck EZ | 8 | Hardware Supported: Planck EZ |
| 9 | Hardware Availability: [ergodox-ez.com](https://ergodox-ez.com/pages/planck) | 9 | Hardware Availability: [ZSA](https://www.zsa.io/planck/) |
| 10 | 10 | ||
| 11 | Make example for this keyboard (after setting up your build environment): | 11 | Make example for this keyboard (after setting up your build environment): |
| 12 | 12 | ||
| 13 | make planck/ez:default | 13 | make planck/ez:oryx |
| 14 | |||
| 15 | 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). | ||
| 16 | |||
| 17 | # Planck EZ Glow | ||
| 18 | 14 | ||
| 19 | For the per key RGB version of this keyboard, you want to use the "glow" subdirectory. For example: | 15 | For the per key RGB version of this keyboard, you want to use the "glow" subdirectory. For example: |
| 20 | 16 | ||
| 21 | make planck/ez/glow:default | 17 | make planck/ez/glow:oryx |
| 18 | |||
| 19 | 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). | ||
| 22 | 20 | ||
| 23 | ## Planck EZ Configuration (from Oryx) | 21 | ## Planck EZ Configuration (from Oryx) |
| 24 | 22 | ||
| 23 | To enable the features from Oryx (ZSA's Configurator), either compile the the `oryx` keymap, or add `#define ORYX_CONFIGURATOR` to your `config.h` file. | ||
| 24 | |||
| 25 | This enables the front Indicator LEDs, and the `TOGGLE_LAYER_COLOR`, and `LED_LEVEL` keycodes. The `TOGGLE_LAYER_COLOR` keycode toggles the customized LED map configured on Oryx. The `LED_LEVEL` cycles through the brightness levels for the front "teeth" LEDs. | ||
| 26 | |||
| 25 | ### Indicator LEDs | 27 | ### Indicator LEDs |
| 26 | 28 | ||
| 27 | The two front "teeth" LED indicators are PWM controlled. If you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h`, you can use the `LED_LEVEL` to cycle through preset vales (0, 25%, 50%, 75%, 100%), and will be saved to EEPROM (persistent storage) | 29 | The two front "teeth" LED indicators are PWM controlled. If you have `ORYX_CONFIGURATOR` defined in your keymap's `config.h`, you can use the `LED_LEVEL` to cycle through preset vales (0, 25%, 50%, 75%, 100%), and will be saved to EEPROM (persistent storage) |
diff --git a/keyboards/planck/keymaps/oryx/config.h b/keyboards/planck/keymaps/oryx/config.h index a9171bf53..e6250bb39 100644 --- a/keyboards/planck/keymaps/oryx/config.h +++ b/keyboards/planck/keymaps/oryx/config.h | |||
| @@ -1,16 +1,39 @@ | |||
| 1 | /* Copyright 2020 ZSA Technology Inc | ||
| 2 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
| 3 | * | ||
| 4 | * This program is free software: you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation, either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 1 | #pragma once | 18 | #pragma once |
| 2 | 19 | ||
| 3 | #ifdef AUDIO_ENABLE | 20 | #ifdef AUDIO_ENABLE |
| 4 | #define STARTUP_SONG SONG(PLANCK_SOUND) | 21 | # define STARTUP_SONG SONG(PLANCK_SOUND) |
| 5 | #endif | 22 | #endif |
| 6 | 23 | ||
| 7 | #define MIDI_BASIC | 24 | #define MIDI_BASIC |
| 8 | 25 | ||
| 9 | #define ENCODER_RESOLUTION 4 | 26 | #define ENCODER_RESOLUTION 4 |
| 10 | 27 | ||
| 11 | #define ORYX_CONFIGURATOR | ||
| 12 | |||
| 13 | /* | 28 | /* |
| 14 | Set any config.h overrides for your specific keymap here. | 29 | Set any config.h overrides for your specific keymap here. |
| 15 | See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file | 30 | See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file |
| 16 | */ | 31 | */ |
| 32 | #define ORYX_CONFIGURATOR | ||
| 33 | #define USB_SUSPEND_WAKEUP_DELAY 0 | ||
| 34 | #define FIRMWARE_VERSION u8"vAxxa/ZlQEV" | ||
| 35 | #define RGB_MATRIX_STARTUP_SPD 60 | ||
| 36 | |||
| 37 | #define PLANCK_EZ_LED_LOWER 1 | ||
| 38 | #define PLANCK_EZ_LED_RAISE 2 | ||
| 39 | #define PLANCK_EZ_LED_ADJUST 3 | ||
diff --git a/keyboards/planck/keymaps/oryx/keymap.c b/keyboards/planck/keymaps/oryx/keymap.c index 27387a81a..e84b9913a 100644 --- a/keyboards/planck/keymaps/oryx/keymap.c +++ b/keyboards/planck/keymaps/oryx/keymap.c | |||
| @@ -1,373 +1,151 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | /* Copyright 2020 ZSA Technology Inc |
| 2 | #include "muse.h" | 2 | * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> |
| 3 | #include "eeprom.h" | 3 | * |
| 4 | #include "keymap_german.h" | 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | #include "keymap_nordic.h" | 5 | * it under the terms of the GNU General Public License as published by |
| 6 | #include "keymap_french.h" | 6 | * the Free Software Foundation, either version 2 of the License, or |
| 7 | #include "keymap_spanish.h" | 7 | * (at your option) any later version. |
| 8 | #include "keymap_hungarian.h" | 8 | * |
| 9 | #include "keymap_swedish.h" | 9 | * This program is distributed in the hope that it will be useful, |
| 10 | //#include "keymap_br_abnt2.h" | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | #include "keymap_canadian_multilingual.h" | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | #include "keymap_german_ch.h" | 12 | * GNU General Public License for more details. |
| 13 | 13 | * | |
| 14 | #define KC_MAC_UNDO LGUI(KC_Z) | 14 | * You should have received a copy of the GNU General Public License |
| 15 | #define KC_MAC_CUT LGUI(KC_X) | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | #define KC_MAC_COPY LGUI(KC_C) | 16 | */ |
| 17 | #define KC_MAC_PASTE LGUI(KC_V) | ||
| 18 | #define KC_PC_UNDO LCTL(KC_Z) | ||
| 19 | #define KC_PC_CUT LCTL(KC_X) | ||
| 20 | #define KC_PC_COPY LCTL(KC_C) | ||
| 21 | #define KC_PC_PASTE LCTL(KC_V) | ||
| 22 | #define NO_TH ALGR(KC_T) | ||
| 23 | #define NO_ETH ALGR(KC_D) | ||
| 24 | 17 | ||
| 25 | enum planck_layers { | 18 | #include QMK_KEYBOARD_H |
| 26 | _QWERTY, | ||
| 27 | _COLEMAK, | ||
| 28 | _DVORAK, | ||
| 29 | _LOWER, | ||
| 30 | _RAISE, | ||
| 31 | _PLOVER, | ||
| 32 | _ADJUST | ||
| 33 | }; | ||
| 34 | 19 | ||
| 35 | enum planck_keycodes { | 20 | enum planck_keycodes { |
| 36 | QWERTY = EZ_SAFE_RANGE, | 21 | RGB_SLD = EZ_SAFE_RANGE, |
| 37 | COLEMAK, | ||
| 38 | DVORAK, | ||
| 39 | PLOVER, | ||
| 40 | BACKLIT, | ||
| 41 | EXT_PLV, | ||
| 42 | RGB_SLD | ||
| 43 | }; | 22 | }; |
| 44 | 23 | ||
| 45 | #define LOWER MO(_LOWER) | 24 | enum planck_layers { |
| 46 | #define RAISE MO(_RAISE) | 25 | _BASE, |
| 26 | _LOWER, | ||
| 27 | _RAISE, | ||
| 28 | _ADJUST, | ||
| 29 | }; | ||
| 47 | 30 | ||
| 31 | # define LOWER MO(_LOWER) | ||
| 32 | # define RAISE MO(_RAISE) | ||
| 48 | 33 | ||
| 34 | // clang-format off | ||
| 49 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 35 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 50 | 36 | [_BASE] = LAYOUT_planck_grid( | |
| 51 | /* Qwerty | 37 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPACE, |
| 52 | * ,-----------------------------------------------------------------------------------. | 38 | KC_ESCAPE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, |
| 53 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | | 39 | KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_ENTER, |
| 54 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 40 | WEBUSB_PAIR, KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPACE, KC_NO, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT |
| 55 | * | Esc | A | S | D | F | G | H | J | K | L | ; | " | | 41 | ), |
| 56 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 42 | |
| 57 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | 43 | [_LOWER] = LAYOUT_planck_grid( |
| 58 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 44 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, |
| 59 | * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | | 45 | KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, |
| 60 | * `-----------------------------------------------------------------------------------' | 46 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NONUS_BSLASH,KC_HOME, KC_END, _______, |
| 61 | */ | 47 | KC_COMMA, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_MEDIA_PLAY_PAUSE |
| 62 | [_QWERTY] = LAYOUT_planck_grid( | 48 | ), |
| 63 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | 49 | |
| 64 | KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | 50 | [_RAISE] = LAYOUT_planck_grid( |
| 65 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , | 51 | KC_GRAVE,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, |
| 66 | BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | 52 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINUS, KC_EQUAL, KC_LBRACKET, KC_RBRACKET, KC_BSLASH, |
| 67 | ), | 53 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NONUS_BSLASH,KC_PGUP, KC_PGDOWN, _______, |
| 68 | 54 | _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_MEDIA_PLAY_PAUSE | |
| 69 | /* Colemak | 55 | ), |
| 70 | * ,-----------------------------------------------------------------------------------. | 56 | |
| 71 | * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | | 57 | [_ADJUST] = LAYOUT_planck_grid( |
| 72 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 73 | * | Esc | A | R | S | T | D | H | N | E | I | O | " | | 59 | KC_DEL, _______, AU_ON, AU_OFF, AU_TOG, _______, _______, RGB_TOG, RGB_VAI, RGB_VAD, LED_LEVEL, RESET, |
| 74 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 60 | _______, _______, MU_ON, MU_OFF, MU_TOG, _______, _______, RGB_MOD, RGB_HUI, RGB_HUD, TOGGLE_LAYER_COLOR, _______, |
| 75 | * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | | 61 | _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______ |
| 76 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 62 | ), |
| 77 | * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | | ||
| 78 | * `-----------------------------------------------------------------------------------' | ||
| 79 | */ | ||
| 80 | [_COLEMAK] = LAYOUT_planck_grid( | ||
| 81 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, | ||
| 82 | KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, | ||
| 83 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , | ||
| 84 | BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 85 | ), | ||
| 86 | |||
| 87 | /* Dvorak | ||
| 88 | * ,-----------------------------------------------------------------------------------. | ||
| 89 | * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | | ||
| 90 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 91 | * | Esc | A | O | E | U | I | D | H | T | N | S | / | | ||
| 92 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 93 | * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | | ||
| 94 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 95 | * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | | ||
| 96 | * `-----------------------------------------------------------------------------------' | ||
| 97 | */ | ||
| 98 | [_DVORAK] = LAYOUT_planck_grid( | ||
| 99 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, | ||
| 100 | KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, | ||
| 101 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , | ||
| 102 | BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 103 | ), | ||
| 104 | |||
| 105 | /* Lower | ||
| 106 | * ,-----------------------------------------------------------------------------------. | ||
| 107 | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | ||
| 108 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 109 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | ||
| 110 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 111 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | | ||
| 112 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 113 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 114 | * `-----------------------------------------------------------------------------------' | ||
| 115 | */ | ||
| 116 | [_LOWER] = LAYOUT_planck_grid( | ||
| 117 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, | ||
| 118 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, | ||
| 119 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, | ||
| 120 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY | ||
| 121 | ), | ||
| 122 | |||
| 123 | /* Raise | ||
| 124 | * ,-----------------------------------------------------------------------------------. | ||
| 125 | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
| 126 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 127 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
| 128 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 129 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | | ||
| 130 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 131 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 132 | * `-----------------------------------------------------------------------------------' | ||
| 133 | */ | ||
| 134 | [_RAISE] = LAYOUT_planck_grid( | ||
| 135 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, | ||
| 136 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, | ||
| 137 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, | ||
| 138 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY | ||
| 139 | ), | ||
| 140 | |||
| 141 | /* Plover layer (http://opensteno.org) | ||
| 142 | * ,-----------------------------------------------------------------------------------. | ||
| 143 | * | # | # | # | # | # | # | # | # | # | # | # | # | | ||
| 144 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 145 | * | | S | T | P | H | * | * | F | P | L | T | D | | ||
| 146 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 147 | * | | S | K | W | R | * | * | R | B | G | S | Z | | ||
| 148 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 149 | * | Exit | | | A | O | | E | U | | | | | ||
| 150 | * `-----------------------------------------------------------------------------------' | ||
| 151 | */ | ||
| 152 | [_PLOVER] = LAYOUT_planck_grid( | ||
| 153 | KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , | ||
| 154 | XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, | ||
| 155 | XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
| 156 | EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX | ||
| 157 | ), | ||
| 158 | |||
| 159 | /* Adjust (Lower + Raise) | ||
| 160 | * v------------------------RGB CONTROL--------------------v | ||
| 161 | * ,----------------------------------------------------------------------------------- | ||
| 162 | * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | | ||
| 163 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 164 | * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | | ||
| 165 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 166 | * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | | ||
| 167 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 168 | * | | | | | | | | | | | | | ||
| 169 | * `-----------------------------------------------------------------------------------' | ||
| 170 | */ | ||
| 171 | [_ADJUST] = LAYOUT_planck_grid( | ||
| 172 | _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , | ||
| 173 | _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, | ||
| 174 | _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, TOGGLE_LAYER_COLOR, LED_LEVEL, _______, | ||
| 175 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 176 | ) | ||
| 177 | 63 | ||
| 178 | }; | 64 | }; |
| 179 | 65 | // clang-format on | |
| 180 | |||
| 181 | #ifdef AUDIO_ENABLE | ||
| 182 | float plover_song[][2] = SONG(PLOVER_SOUND); | ||
| 183 | float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); | ||
| 184 | #endif | ||
| 185 | |||
| 186 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 187 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); | ||
| 188 | } | ||
| 189 | 66 | ||
| 190 | const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { | 67 | const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { |
| 191 | [0] = { {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255}, {130,255,255} }, | 68 | [0] = {{42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {146, 224, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {42, 255, 255}, {32, 255, 234}, {32, 255, 234}, {32, 255, 234}, {32, 255, 234}}, |
| 192 | |||
| 193 | [1] = { {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {146,224,255}, {146,224,255}, {146,224,255}, {146,224,255}, {146,224,255}, {146,224,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {146,224,255}, {146,224,255}, {146,224,255}, {146,224,255}, {146,224,255}, {146,224,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {42,255,255}, {32,255,234}, {32,255,234}, {32,255,234}, {32,255,234} }, | ||
| 194 | 69 | ||
| 195 | [2] = { {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {169,120,255}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246}, {89,255,246} }, | 70 | [1] = {{89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {169, 120, 255}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}, {89, 255, 246}}, |
| 196 | 71 | ||
| 197 | [3] = { {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {249,228,255}, {249,228,255}, {249,228,255}, {216,255,255}, {216,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {216,255,255}, {14,255,255}, {216,255,255}, {216,255,255}, {249,228,255}, {249,228,255}, {249,228,255}, {216,255,255}, {216,255,255}, {105,255,255}, {105,255,255}, {105,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255}, {216,255,255} }, | 72 | [2] = {{216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {249, 228, 255}, {249, 228, 255}, {249, 228, 255}, {216, 255, 255}, {216, 255, 255}, {105, 255, 255}, {105, 255, 255}, {105, 255, 255}, {216, 255, 255}, {14, 255, 255}, {216, 255, 255}, {216, 255, 255}, {249, 228, 255}, {249, 228, 255}, {249, 228, 255}, {216, 255, 255}, {216, 255, 255}, {105, 255, 255}, {105, 255, 255}, {105, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}, {216, 255, 255}}, |
| 198 | 73 | ||
| 199 | }; | 74 | }; |
| 200 | 75 | ||
| 201 | void set_layer_color(int layer) { | 76 | void set_layer_color(int layer) { |
| 202 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | 77 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { |
| 203 | HSV hsv = { | 78 | HSV hsv = { |
| 204 | .h = pgm_read_byte(&ledmap[layer][i][0]), | 79 | .h = pgm_read_byte(&ledmap[layer][i][0]), |
| 205 | .s = pgm_read_byte(&ledmap[layer][i][1]), | 80 | .s = pgm_read_byte(&ledmap[layer][i][1]), |
| 206 | .v = pgm_read_byte(&ledmap[layer][i][2]), | 81 | .v = pgm_read_byte(&ledmap[layer][i][2]), |
| 207 | }; | 82 | }; |
| 208 | if (!hsv.h && !hsv.s && !hsv.v) { | 83 | if (!hsv.h && !hsv.s && !hsv.v) { |
| 209 | rgb_matrix_set_color( i, 0, 0, 0 ); | 84 | rgb_matrix_set_color(i, 0, 0, 0); |
| 210 | } else { | 85 | } else { |
| 211 | RGB rgb = hsv_to_rgb( hsv ); | 86 | RGB rgb = hsv_to_rgb(hsv); |
| 212 | float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; | 87 | float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; |
| 213 | rgb_matrix_set_color( i, f * rgb.r, f * rgb.g, f * rgb.b ); | 88 | rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b); |
| 89 | } | ||
| 214 | } | 90 | } |
| 215 | } | ||
| 216 | } | 91 | } |
| 217 | 92 | ||
| 218 | void rgb_matrix_indicators_user(void) { | 93 | void rgb_matrix_indicators_user(void) { |
| 219 | if (g_suspend_state || keyboard_config.disable_layer_led) { return; } | 94 | if (g_suspend_state || keyboard_config.disable_layer_led) { |
| 220 | switch (biton32(layer_state)) { | 95 | return; |
| 221 | case 0: | 96 | } |
| 222 | set_layer_color(0); | 97 | switch (biton32(layer_state)) { |
| 223 | break; | 98 | case 1: |
| 224 | case 3: | 99 | set_layer_color(0); |
| 225 | set_layer_color(1); | 100 | break; |
| 226 | break; | 101 | case 2: |
| 227 | case 4: | 102 | set_layer_color(1); |
| 228 | set_layer_color(2); | 103 | break; |
| 229 | break; | 104 | case 3: |
| 230 | case 6: | 105 | set_layer_color(2); |
| 231 | set_layer_color(3); | 106 | break; |
| 232 | break; | 107 | default: |
| 233 | default: | 108 | if (rgb_matrix_get_flags() == LED_FLAG_NONE) rgb_matrix_set_color_all(0, 0, 0); |
| 234 | if (rgb_matrix_get_flags() == LED_FLAG_NONE) | 109 | break; |
| 235 | rgb_matrix_set_color_all(0, 0, 0); | 110 | } |
| 236 | break; | ||
| 237 | } | ||
| 238 | } | 111 | } |
| 239 | 112 | ||
| 240 | |||
| 241 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 113 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 242 | switch (keycode) { | 114 | switch (keycode) { |
| 243 | case RGB_SLD: | 115 | case RGB_SLD: |
| 244 | if (record->event.pressed) { | 116 | if (record->event.pressed) { |
| 245 | rgblight_mode(1); | 117 | rgblight_mode(1); |
| 246 | } | 118 | } |
| 247 | return false; | 119 | return false; |
| 248 | case QWERTY: | 120 | } |
| 249 | if (record->event.pressed) { | 121 | return true; |
| 250 | print("mode just switched to qwerty and this is a huge string\n"); | ||
| 251 | set_single_persistent_default_layer(_QWERTY); | ||
| 252 | } | ||
| 253 | return false; | ||
| 254 | break; | ||
| 255 | case COLEMAK: | ||
| 256 | if (record->event.pressed) { | ||
| 257 | set_single_persistent_default_layer(_COLEMAK); | ||
| 258 | } | ||
| 259 | return false; | ||
| 260 | break; | ||
| 261 | case DVORAK: | ||
| 262 | if (record->event.pressed) { | ||
| 263 | set_single_persistent_default_layer(_DVORAK); | ||
| 264 | } | ||
| 265 | return false; | ||
| 266 | break; | ||
| 267 | case BACKLIT: | ||
| 268 | if (record->event.pressed) { | ||
| 269 | register_code(KC_RSFT); | ||
| 270 | #ifdef BACKLIGHT_ENABLE | ||
| 271 | backlight_step(); | ||
| 272 | #endif | ||
| 273 | #ifdef KEYBOARD_planck_rev5 | ||
| 274 | PORTE &= ~(1<<6); | ||
| 275 | #endif | ||
| 276 | } else { | ||
| 277 | unregister_code(KC_RSFT); | ||
| 278 | #ifdef KEYBOARD_planck_rev5 | ||
| 279 | PORTE |= (1<<6); | ||
| 280 | #endif | ||
| 281 | } | ||
| 282 | return false; | ||
| 283 | break; | ||
| 284 | case PLOVER: | ||
| 285 | if (record->event.pressed) { | ||
| 286 | #ifdef AUDIO_ENABLE | ||
| 287 | stop_all_notes(); | ||
| 288 | PLAY_SONG(plover_song); | ||
| 289 | #endif | ||
| 290 | layer_off(_RAISE); | ||
| 291 | layer_off(_LOWER); | ||
| 292 | layer_off(_ADJUST); | ||
| 293 | layer_on(_PLOVER); | ||
| 294 | if (!eeconfig_is_enabled()) { | ||
| 295 | eeconfig_init(); | ||
| 296 | } | ||
| 297 | keymap_config.raw = eeconfig_read_keymap(); | ||
| 298 | keymap_config.nkro = 1; | ||
| 299 | eeconfig_update_keymap(keymap_config.raw); | ||
| 300 | } | ||
| 301 | return false; | ||
| 302 | break; | ||
| 303 | case EXT_PLV: | ||
| 304 | if (record->event.pressed) { | ||
| 305 | #ifdef AUDIO_ENABLE | ||
| 306 | PLAY_SONG(plover_gb_song); | ||
| 307 | #endif | ||
| 308 | layer_off(_PLOVER); | ||
| 309 | } | ||
| 310 | return false; | ||
| 311 | break; | ||
| 312 | } | ||
| 313 | return true; | ||
| 314 | } | 122 | } |
| 315 | 123 | ||
| 316 | bool muse_mode = false; | ||
| 317 | uint8_t last_muse_note = 0; | ||
| 318 | uint16_t muse_counter = 0; | ||
| 319 | uint8_t muse_offset = 70; | ||
| 320 | uint16_t muse_tempo = 50; | ||
| 321 | |||
| 322 | bool encoder_update_user(uint8_t index, bool clockwise) { | 124 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 323 | if (muse_mode) { | 125 | if (clockwise) { |
| 324 | if (IS_LAYER_ON(_RAISE)) { | 126 | # ifdef MOUSEKEY_ENABLE |
| 325 | if (clockwise) { | 127 | tap_code(KC_MS_WH_DOWN); |
| 326 | muse_offset++; | 128 | # else |
| 327 | } else { | 129 | tap_code(KC_PGDN); |
| 328 | muse_offset--; | 130 | # endif |
| 329 | } | ||
| 330 | } else { | ||
| 331 | if (clockwise) { | ||
| 332 | muse_tempo+=1; | ||
| 333 | } else { | ||
| 334 | muse_tempo-=1; | ||
| 335 | } | ||
| 336 | } | ||
| 337 | } else { | 131 | } else { |
| 338 | if (clockwise) { | 132 | # ifdef MOUSEKEY_ENABLE |
| 339 | #ifdef MOUSEKEY_ENABLE | 133 | tap_code(KC_MS_WH_UP); |
| 340 | register_code(KC_MS_WH_DOWN); | 134 | # else |
| 341 | unregister_code(KC_MS_WH_DOWN); | 135 | tap_code(KC_PGUP); |
| 342 | #else | 136 | # endif |
| 343 | register_code(KC_PGDN); | ||
| 344 | unregister_code(KC_PGDN); | ||
| 345 | #endif | ||
| 346 | } else { | ||
| 347 | #ifdef MOUSEKEY_ENABLE | ||
| 348 | register_code(KC_MS_WH_UP); | ||
| 349 | unregister_code(KC_MS_WH_UP); | ||
| 350 | #else | ||
| 351 | register_code(KC_PGUP); | ||
| 352 | unregister_code(KC_PGUP); | ||
| 353 | #endif | ||
| 354 | } | ||
| 355 | } | 137 | } |
| 356 | return true; | 138 | return true; |
| 357 | } | 139 | } |
| 358 | 140 | ||
| 359 | void matrix_scan_user(void) { | 141 | bool music_mask_user(uint16_t keycode) { |
| 360 | #ifdef AUDIO_ENABLE | 142 | switch (keycode) { |
| 361 | if (muse_mode) { | 143 | case RAISE: |
| 362 | if (muse_counter == 0) { | 144 | case LOWER: |
| 363 | uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; | 145 | return false; |
| 364 | if (muse_note != last_muse_note) { | 146 | default: |
| 365 | stop_note(compute_freq_for_midi_note(last_muse_note)); | 147 | return true; |
| 366 | play_note(compute_freq_for_midi_note(muse_note), 0xF); | ||
| 367 | last_muse_note = muse_note; | ||
| 368 | } | ||
| 369 | } | ||
| 370 | muse_counter = (muse_counter + 1) % muse_tempo; | ||
| 371 | } | 148 | } |
| 372 | #endif | ||
| 373 | } | 149 | } |
| 150 | |||
| 151 | layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } | ||
diff --git a/keyboards/planck/keymaps/oryx/rules.mk b/keyboards/planck/keymaps/oryx/rules.mk index 7657a3043..1e29b5f21 100644 --- a/keyboards/planck/keymaps/oryx/rules.mk +++ b/keyboards/planck/keymaps/oryx/rules.mk | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | SRC += muse.c | ||
| 2 | # Set any rules.mk overrides for your specific keymap here. | 1 | # Set any rules.mk overrides for your specific keymap here. |
| 3 | # See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file | 2 | # See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file |
| 4 | LTO_ENABLE = yes | 3 | CONSOLE_ENABLE = no |
| 5 | COMMAND_ENABLE = no | 4 | COMMAND_ENABLE = no |
| 6 | MOUSEKEY_ENABLE = no | 5 | MOUSEKEY_ENABLE = no |
| 6 | WEBUSB_ENABLE = yes | ||
| 7 | ORYX_ENABLE = yes | ||
