Merge remote-tracking branch 'upstream/master' into develop

This commit is contained in:
Nick Brassel 2021-07-27 10:11:52 +10:00
commit 394272a266
26 changed files with 394 additions and 559 deletions

View File

@ -5,7 +5,7 @@
"width": 3, "width": 3,
"height": 3, "height": 3,
"layouts": { "layouts": {
"LAYOUT": { "LAYOUT_ortho_3x3": {
"layout": [ "layout": [
{"x":0, "y":0}, {"x":0, "y":0},
{"x":1, "y":0}, {"x":1, "y":0},

View File

@ -6,13 +6,13 @@
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k36 , k37, k38, k39, k3a, k3b \ k30, k31, k32, k33, k34, k35 , k37, k38, k39, k3a, k3b \
) \ ) \
{ \ { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, KC_NO, k36, k37, k38, k39, k3a, k3b } \ { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \
} }
#define LAYOUT_ortho_4x12( \ #define LAYOUT_ortho_4x12( \

View File

@ -7,14 +7,14 @@
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \
k40, k41, k42, k43, k44, k46 , k47, k48, k49, k4a, k4b \ k40, k41, k42, k43, k44, k45 , k47, k48, k49, k4a, k4b \
) \ ) \
{ \ { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \
{ k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k4a, k4b }, \ { k40, k41, k42, k43, k44, k45, KC_NO, k47, k48, k49, k4a, k4b }, \
} }
#define LAYOUT_ortho_5x12( \ #define LAYOUT_ortho_5x12( \

View File

@ -3,6 +3,7 @@ MCU = atmega32u4
# Bootloader selection # Bootloader selection
BOOTLOADER = lufa-ms BOOTLOADER = lufa-ms
BOOTLOADER_SIZE = 6144
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable

View File

@ -3,6 +3,7 @@ MCU = atmega32u4
# Bootloader selection # Bootloader selection
BOOTLOADER = lufa-ms BOOTLOADER = lufa-ms
BOOTLOADER_SIZE = 6144
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable

View File

@ -44,29 +44,29 @@ extern inline void ergodox_led_all_set(uint8_t n);
keyboard_config_t keyboard_config; keyboard_config_t keyboard_config;
bool i2c_initialized = 0; bool i2c_initialized = 0;
i2c_status_t mcp23018_status = 0x20; i2c_status_t mcp23018_status = 0x20;
void matrix_init_kb(void) { void matrix_init_kb(void) {
// keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md")
TCCR1A = 0b10101001; // set and configure fast PWM TCCR1A = 0b10101001; // set and configure fast PWM
TCCR1B = 0b00001001; // set and configure fast PWM TCCR1B = 0b00001001; // set and configure fast PWM
// (tied to Vcc for hardware convenience) // (tied to Vcc for hardware convenience)
DDRB &= ~(1<<4); // set B(4) as input DDRB &= ~(1 << 4); // set B(4) as input
PORTB &= ~(1<<4); // set B(4) internal pull-up disabled PORTB &= ~(1 << 4); // set B(4) internal pull-up disabled
// unused pins - C7, D4, D5, D7, E6 // unused pins - C7, D4, D5, D7, E6
// set as input with internal pull-up enabled // set as input with internal pull-up enabled
DDRC &= ~(1<<7); DDRC &= ~(1 << 7);
DDRD &= ~(1<<5 | 1<<4); DDRD &= ~(1 << 5 | 1 << 4);
DDRE &= ~(1<<6); DDRE &= ~(1 << 6);
PORTC |= (1<<7); PORTC |= (1 << 7);
PORTD |= (1<<5 | 1<<4); PORTD |= (1 << 5 | 1 << 4);
PORTE |= (1<<6); PORTE |= (1 << 6);
keyboard_config.raw = eeconfig_read_kb(); keyboard_config.raw = eeconfig_read_kb();
ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4 ); ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4);
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
if (keyboard_config.rgb_matrix_enable) { if (keyboard_config.rgb_matrix_enable) {
rgb_matrix_set_flags(LED_FLAG_ALL); rgb_matrix_set_flags(LED_FLAG_ALL);
@ -80,8 +80,7 @@ void matrix_init_kb(void) {
matrix_init_user(); matrix_init_user();
} }
void ergodox_blink_all_leds(void) void ergodox_blink_all_leds(void) {
{
ergodox_led_all_off(); ergodox_led_all_off();
ergodox_led_all_set(LED_BRIGHTNESS_DEFAULT); ergodox_led_all_set(LED_BRIGHTNESS_DEFAULT);
ergodox_right_led_1_on(); ergodox_right_led_1_on();
@ -94,17 +93,17 @@ void ergodox_blink_all_leds(void)
ergodox_left_led_1_on(); ergodox_left_led_1_on();
_delay_ms(50); _delay_ms(50);
if (!mcp23018_status) { if (!mcp23018_status) {
mcp23018_status = ergodox_left_leds_update(); mcp23018_status = ergodox_left_leds_update();
} }
ergodox_left_led_2_on(); ergodox_left_led_2_on();
_delay_ms(50); _delay_ms(50);
if (!mcp23018_status) { if (!mcp23018_status) {
mcp23018_status = ergodox_left_leds_update(); mcp23018_status = ergodox_left_leds_update();
} }
ergodox_left_led_3_on(); ergodox_left_led_3_on();
_delay_ms(50); _delay_ms(50);
if (!mcp23018_status) { if (!mcp23018_status) {
mcp23018_status = ergodox_left_leds_update(); mcp23018_status = ergodox_left_leds_update();
} }
#endif #endif
ergodox_right_led_1_off(); ergodox_right_led_1_off();
@ -116,21 +115,21 @@ void ergodox_blink_all_leds(void)
_delay_ms(50); _delay_ms(50);
ergodox_left_led_1_off(); ergodox_left_led_1_off();
if (!mcp23018_status) { if (!mcp23018_status) {
mcp23018_status = ergodox_left_leds_update(); mcp23018_status = ergodox_left_leds_update();
} }
_delay_ms(50); _delay_ms(50);
ergodox_left_led_2_off(); ergodox_left_led_2_off();
if (!mcp23018_status) { if (!mcp23018_status) {
mcp23018_status = ergodox_left_leds_update(); mcp23018_status = ergodox_left_leds_update();
} }
_delay_ms(50); _delay_ms(50);
ergodox_left_led_3_off(); ergodox_left_led_3_off();
if (!mcp23018_status) { if (!mcp23018_status) {
mcp23018_status = ergodox_left_leds_update(); mcp23018_status = ergodox_left_leds_update();
} }
#endif #endif
//ergodox_led_all_on(); // ergodox_led_all_on();
//_delay_ms(333); //_delay_ms(333);
ergodox_led_all_off(); ergodox_led_all_off();
} }
@ -156,27 +155,35 @@ uint8_t init_mcp23018(void) {
// - unused : input : 1 // - unused : input : 1
// - input : input : 1 // - input : input : 1
// - driving : output : 0 // - driving : output : 0
mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT);
mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT);
mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT);
if (mcp23018_status) goto out;
i2c_stop(); i2c_stop();
// set pull-up // set pull-up
// - unused : on : 1 // - unused : on : 1
// - input : on : 1 // - input : on : 1
// - driving : off : 0 // - driving : off : 0
mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT);
mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT);
mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b00000000, ERGODOX_EZ_I2C_TIMEOUT);
if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b00111111, ERGODOX_EZ_I2C_TIMEOUT);
if (mcp23018_status) goto out;
out: out:
i2c_stop(); i2c_stop();
#ifdef LEFT_LEDS #ifdef LEFT_LEDS
if (!mcp23018_status) mcp23018_status = ergodox_left_leds_update(); if (!mcp23018_status) mcp23018_status = ergodox_left_leds_update();
#endif // LEFT_LEDS #endif // LEFT_LEDS
// SREG=sreg_prev; // SREG=sreg_prev;
@ -185,12 +192,12 @@ out:
#ifdef LEFT_LEDS #ifdef LEFT_LEDS
uint8_t ergodox_left_leds_update(void) { uint8_t ergodox_left_leds_update(void) {
if (mcp23018_status) { // if there was an error if (mcp23018_status) { // if there was an error
return mcp23018_status; return mcp23018_status;
} }
#define LEFT_LED_1_SHIFT 7 // in MCP23018 port B # define LEFT_LED_1_SHIFT 7 // in MCP23018 port B
#define LEFT_LED_2_SHIFT 6 // in MCP23018 port B # define LEFT_LED_2_SHIFT 6 // in MCP23018 port B
#define LEFT_LED_3_SHIFT 7 // in MCP23018 port A # define LEFT_LED_3_SHIFT 7 // in MCP23018 port A
// set logical value (doesn't matter on inputs) // set logical value (doesn't matter on inputs)
// - unused : hi-Z : 1 // - unused : hi-Z : 1
@ -200,47 +207,42 @@ uint8_t ergodox_left_leds_update(void) {
if (mcp23018_status) goto out; if (mcp23018_status) goto out;
mcp23018_status = i2c_write(OLATA, ERGODOX_EZ_I2C_TIMEOUT); mcp23018_status = i2c_write(OLATA, ERGODOX_EZ_I2C_TIMEOUT);
if (mcp23018_status) goto out; if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b11111111 mcp23018_status = i2c_write(0b11111111 & ~(ergodox_left_led_3 << LEFT_LED_3_SHIFT), ERGODOX_EZ_I2C_TIMEOUT);
& ~(ergodox_left_led_3<<LEFT_LED_3_SHIFT),
ERGODOX_EZ_I2C_TIMEOUT);
if (mcp23018_status) goto out; if (mcp23018_status) goto out;
mcp23018_status = i2c_write(0b11111111 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);
& ~(ergodox_left_led_2<<LEFT_LED_2_SHIFT)
& ~(ergodox_left_led_1<<LEFT_LED_1_SHIFT),
ERGODOX_EZ_I2C_TIMEOUT);
if (mcp23018_status) goto out; if (mcp23018_status) goto out;
out: out:
i2c_stop(); i2c_stop();
return mcp23018_status; return mcp23018_status;
} }
#endif #endif
#ifdef SWAP_HANDS_ENABLE #ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak)) __attribute__((weak))
// swap-hands action needs a matrix to define the swap // swap-hands action needs a matrix to define the swap
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */ /* Left hand, matrix positions */
{{0,13}, {1,13}, {2,13}, {3,13}, {4,13}, {5,13}}, {{0, 13}, {1, 13}, {2, 13}, {3, 13}, {4, 13}, {5, 13}},
{{0,12}, {1,12}, {2,12}, {3,12}, {4,12}, {5,12}}, {{0, 12}, {1, 12}, {2, 12}, {3, 12}, {4, 12}, {5, 12}},
{{0,11}, {1,11}, {2,11}, {3,11}, {4,11}, {5,11}}, {{0, 11}, {1, 11}, {2, 11}, {3, 11}, {4, 11}, {5, 11}},
{{0,10}, {1,10}, {2,10}, {3,10}, {4,10}, {5,10}}, {{0, 10}, {1, 10}, {2, 10}, {3, 10}, {4, 10}, {5, 10}},
{{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, {{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}, {5, 9}},
{{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}},
{{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}},
/* Right hand, matrix positions */ /* Right hand, matrix positions */
{{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}},
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}},
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}},
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}},
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}},
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}},
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}},
}; };
#endif #endif
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
// clang-format off
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
/* driver /* driver
* | R location * | R location
@ -335,24 +337,14 @@ led_config_t g_led_config = { {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 1, 1, 1, 1 4, 4, 1, 1, 1, 1
} }; } };
// clang-format on
void suspend_power_down_kb(void) { # ifdef ORYX_CONFIGURATOR
rgb_matrix_set_color_all(0, 0, 0);
rgb_matrix_set_suspend_state(true);
suspend_power_down_user();
}
void suspend_wakeup_init_kb(void) {
rgb_matrix_set_suspend_state(false);
suspend_wakeup_init_user();
}
#ifdef ORYX_CONFIGURATOR
void keyboard_post_init_kb(void) { void keyboard_post_init_kb(void) {
rgb_matrix_enable_noeeprom(); rgb_matrix_enable_noeeprom();
keyboard_post_init_user(); keyboard_post_init_user();
} }
#endif # endif
#endif #endif
#ifdef ORYX_CONFIGURATOR #ifdef ORYX_CONFIGURATOR
@ -360,51 +352,48 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case LED_LEVEL: case LED_LEVEL:
if (record->event.pressed) { if (record->event.pressed) {
keyboard_config.led_level++; keyboard_config.led_level++;
if (keyboard_config.led_level > 4) { if (keyboard_config.led_level > 4) {
keyboard_config.led_level = 0; keyboard_config.led_level = 0;
} }
ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4 ); ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4);
eeconfig_update_kb(keyboard_config.raw); eeconfig_update_kb(keyboard_config.raw);
layer_state_set_kb(layer_state); layer_state_set_kb(layer_state);
} }
break; break;
#ifdef RGB_MATRIX_ENABLE # ifdef RGB_MATRIX_ENABLE
case TOGGLE_LAYER_COLOR: case TOGGLE_LAYER_COLOR:
if (record->event.pressed) { if (record->event.pressed) {
keyboard_config.disable_layer_led ^= 1; keyboard_config.disable_layer_led ^= 1;
if (keyboard_config.disable_layer_led) if (keyboard_config.disable_layer_led) rgb_matrix_set_color_all(0, 0, 0);
rgb_matrix_set_color_all(0, 0, 0);
eeconfig_update_kb(keyboard_config.raw); eeconfig_update_kb(keyboard_config.raw);
} }
break; break;
case RGB_TOG: case RGB_TOG:
if (record->event.pressed) { if (record->event.pressed) {
switch (rgb_matrix_get_flags()) { switch (rgb_matrix_get_flags()) {
case LED_FLAG_ALL: { case LED_FLAG_ALL: {
rgb_matrix_set_flags(LED_FLAG_NONE); rgb_matrix_set_flags(LED_FLAG_NONE);
keyboard_config.rgb_matrix_enable = false; keyboard_config.rgb_matrix_enable = false;
rgb_matrix_set_color_all(0, 0, 0); rgb_matrix_set_color_all(0, 0, 0);
} } break;
break; default: {
default: { rgb_matrix_set_flags(LED_FLAG_ALL);
rgb_matrix_set_flags(LED_FLAG_ALL); keyboard_config.rgb_matrix_enable = true;
keyboard_config.rgb_matrix_enable = true; } break;
} }
break; eeconfig_update_kb(keyboard_config.raw);
}
eeconfig_update_kb(keyboard_config.raw);
} }
return false; return false;
#endif # endif
} }
return process_record_user(keycode, record); return process_record_user(keycode, record);
} }
#endif #endif
void eeconfig_init_kb(void) { // EEPROM is getting reset! void eeconfig_init_kb(void) { // EEPROM is getting reset!
keyboard_config.raw = 0; keyboard_config.raw = 0;
keyboard_config.led_level = 4; keyboard_config.led_level = 4;
keyboard_config.rgb_matrix_enable = true; keyboard_config.rgb_matrix_enable = true;
eeconfig_update_kb(keyboard_config.raw); eeconfig_update_kb(keyboard_config.raw);
eeconfig_init_user(); eeconfig_init_user();

View File

@ -2,20 +2,20 @@
#include "version.h" #include "version.h"
enum layers { enum layers {
BASE, // default layer BASE, // default layer
SYMB, // symbols SYMB, // symbols
MDIA, // media keys MDIA, // media keys
}; };
enum custom_keycodes { enum custom_keycodes {
#ifdef ORYX_CONFIGURATOR #ifdef ORYX_CONFIGURATOR
VRSN = EZ_SAFE_RANGE, VRSN = EZ_SAFE_RANGE,
#else #else
VRSN = SAFE_RANGE, VRSN = SAFE_RANGE,
#endif #endif
RGB_SLD
}; };
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer /* Keymap 0: Basic layer
* *
@ -77,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
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, 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,
EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS, EEP_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS,
RGB_MOD, KC_TRNS, RGB_TOG, RGB_SLD, RGB_MOD, KC_TRNS, RGB_TOG, RGB_M_P,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, RGB_HUD, RGB_HUI RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, RGB_HUD, RGB_HUI
), ),
@ -115,94 +115,90 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK
), ),
}; };
// clang-format on
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
switch (keycode) { switch (keycode) {
case VRSN: case VRSN:
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
return false; return false;
#ifdef RGBLIGHT_ENABLE }
case RGB_SLD:
rgblight_mode(1);
return false;
#endif
} }
} return true;
return true;
} }
// Runs just one time when the keyboard initializes. // Runs just one time when the keyboard initializes.
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
#ifdef RGBLIGHT_COLOR_LAYER_0 #ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#endif #endif
}; };
// Runs whenever there is a layer state change. // Runs whenever there is a layer state change.
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
ergodox_board_led_off(); ergodox_board_led_off();
ergodox_right_led_1_off(); ergodox_right_led_1_off();
ergodox_right_led_2_off(); ergodox_right_led_2_off();
ergodox_right_led_3_off(); ergodox_right_led_3_off();
uint8_t layer = get_highest_layer(state); uint8_t layer = get_highest_layer(state);
switch (layer) { switch (layer) {
case 0: case 0:
#ifdef RGBLIGHT_COLOR_LAYER_0 #ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#endif #endif
break; break;
case 1: case 1:
ergodox_right_led_1_on(); ergodox_right_led_1_on();
#ifdef RGBLIGHT_COLOR_LAYER_1 #ifdef RGBLIGHT_COLOR_LAYER_1
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
#endif #endif
break; break;
case 2: case 2:
ergodox_right_led_2_on(); ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_2 #ifdef RGBLIGHT_COLOR_LAYER_2
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
#endif #endif
break; break;
case 3: case 3:
ergodox_right_led_3_on(); ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_3 #ifdef RGBLIGHT_COLOR_LAYER_3
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
#endif #endif
break; break;
case 4: case 4:
ergodox_right_led_1_on(); ergodox_right_led_1_on();
ergodox_right_led_2_on(); ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_4 #ifdef RGBLIGHT_COLOR_LAYER_4
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
#endif #endif
break; break;
case 5: case 5:
ergodox_right_led_1_on(); ergodox_right_led_1_on();
ergodox_right_led_3_on(); ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_5 #ifdef RGBLIGHT_COLOR_LAYER_5
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
#endif #endif
break; break;
case 6: case 6:
ergodox_right_led_2_on(); ergodox_right_led_2_on();
ergodox_right_led_3_on(); ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_6 #ifdef RGBLIGHT_COLOR_LAYER_6
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
#endif #endif
break; break;
case 7: case 7:
ergodox_right_led_1_on(); ergodox_right_led_1_on();
ergodox_right_led_2_on(); ergodox_right_led_2_on();
ergodox_right_led_3_on(); ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_7 #ifdef RGBLIGHT_COLOR_LAYER_7
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7); rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7);
#endif #endif
break; break;
default: default:
break; break;
} }
return state; return state;
}; };

View File

@ -2,13 +2,6 @@
MCU = atmega32u4 MCU = atmega32u4
# Bootloader selection # Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
BOOTLOADER = halfkay BOOTLOADER = halfkay
# If you have Left LEDs (see # If you have Left LEDs (see

View File

@ -42,6 +42,8 @@
#ifdef RGB_DI_PIN #ifdef RGB_DI_PIN
# define RGBLIGHT_ANIMATIONS # define RGBLIGHT_ANIMATIONS
# define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_EFFECT_RAINBOW_MOOD + 6)
# define RGBLIGHT_DEFAULT_SPD 10
# define RGBLED_NUM 16 # define RGBLED_NUM 16
# define RGBLIGHT_HUE_STEP 8 # define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8 # define RGBLIGHT_SAT_STEP 8

View File

@ -1,6 +1,6 @@
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> /* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com> * Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> /* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com> * Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> /* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com> * Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> /* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com> * Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> /* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com> * Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -340,15 +340,6 @@ led_config_t g_led_config = { {
} }; } };
// clang-format on // clang-format on
void suspend_power_down_kb(void) {
rgb_matrix_set_suspend_state(true);
suspend_power_down_user();
}
void suspend_wakeup_init_kb(void) {
rgb_matrix_set_suspend_state(false);
suspend_wakeup_init_user();
}
#endif #endif
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE

View File

@ -1,6 +1,6 @@
/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> /* Copyright 2020 ZSA Technology Labs, Inc <@zsa>
* Copyright 2020 Jack Humbert <jack.humb@gmail.com> * Copyright 2020 Jack Humbert <jack.humb@gmail.com>
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna) * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -19,7 +19,23 @@ Flashing example for this keyboard:
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). 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).
## Oryx Configuation
## Moonlander Customization
### Indicator LEDs
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.
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.
### Oryx Configuration
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.
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.
### RGB Matrix Features
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`. 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`.

View File

@ -1,5 +1,6 @@
/* /* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
* Copyright 2018 Jack Humbert <jack.humb@gmail.com> * Copyright 2015 ZSA Technology Labs Inc (@zsa)
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,6 @@
/* Copyright 2018 Jack Humbert <jack.humb@gmail.com> /* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
* Copyright 2015 ZSA Technology Labs Inc (@zsa)
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,4 +1,6 @@
/* Copyright 2018 Jack Humbert <jack.humb@gmail.com> /* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
* Copyright 2015 ZSA Technology Labs Inc (@zsa)
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,6 @@
/* /* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
* Copyright 2018 Jack Humbert <jack.humb@gmail.com> * Copyright 2015 ZSA Technology Labs Inc (@zsa)
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1 +1,19 @@
/* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
* Copyright 2015 ZSA Technology Labs Inc (@zsa)
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "glow.h" #include "glow.h"

View File

@ -1,3 +1,21 @@
/* Copyright 2018 Jack Humbert <jack.humb@gmail.com>
* Copyright 2015 ZSA Technology Labs Inc (@zsa)
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#include "ez.h" #include "ez.h"

View File

@ -4,24 +4,26 @@
A variant of the Planck featuring a 2u spacebar and per-key RGB backlighting. A variant of the Planck featuring a 2u spacebar and per-key RGB backlighting.
Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert), [Drashna Jael're](https://github.com/drashna)
Hardware Supported: Planck EZ Hardware Supported: Planck EZ
Hardware Availability: [ergodox-ez.com](https://ergodox-ez.com/pages/planck) Hardware Availability: [ZSA](https://www.zsa.io/planck/)
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
make planck/ez:default make planck/ez:oryx
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).
# Planck EZ Glow
For the per key RGB version of this keyboard, you want to use the "glow" subdirectory. For example: For the per key RGB version of this keyboard, you want to use the "glow" subdirectory. For example:
make planck/ez/glow:default make planck/ez/glow:oryx
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).
## Planck EZ Configuration (from Oryx) ## Planck EZ Configuration (from Oryx)
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.
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.
### Indicator LEDs ### Indicator LEDs
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) 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)

View File

@ -1,16 +1,39 @@
/* Copyright 2020 ZSA Technology Inc
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once #pragma once
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND) # define STARTUP_SONG SONG(PLANCK_SOUND)
#endif #endif
#define MIDI_BASIC #define MIDI_BASIC
#define ENCODER_RESOLUTION 4 #define ENCODER_RESOLUTION 4
#define ORYX_CONFIGURATOR
/* /*
Set any config.h overrides for your specific keymap here. Set any config.h overrides for your specific keymap here.
See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file
*/ */
#define ORYX_CONFIGURATOR
#define USB_SUSPEND_WAKEUP_DELAY 0
#define FIRMWARE_VERSION u8"vAxxa/ZlQEV"
#define RGB_MATRIX_STARTUP_SPD 60
#define PLANCK_EZ_LED_LOWER 1
#define PLANCK_EZ_LED_RAISE 2
#define PLANCK_EZ_LED_ADJUST 3

View File

@ -1,373 +1,151 @@
/* Copyright 2020 ZSA Technology Inc
* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "muse.h"
#include "eeprom.h"
#include "keymap_german.h"
#include "keymap_nordic.h"
#include "keymap_french.h"
#include "keymap_spanish.h"
#include "keymap_hungarian.h"
#include "keymap_swedish.h"
//#include "keymap_br_abnt2.h"
#include "keymap_canadian_multilingual.h"
#include "keymap_german_ch.h"
#define KC_MAC_UNDO LGUI(KC_Z)
#define KC_MAC_CUT LGUI(KC_X)
#define KC_MAC_COPY LGUI(KC_C)
#define KC_MAC_PASTE LGUI(KC_V)
#define KC_PC_UNDO LCTL(KC_Z)
#define KC_PC_CUT LCTL(KC_X)
#define KC_PC_COPY LCTL(KC_C)
#define KC_PC_PASTE LCTL(KC_V)
#define NO_TH ALGR(KC_T)
#define NO_ETH ALGR(KC_D)
enum planck_layers {
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_PLOVER,
_ADJUST
};
enum planck_keycodes { enum planck_keycodes {
QWERTY = EZ_SAFE_RANGE, RGB_SLD = EZ_SAFE_RANGE,
COLEMAK,
DVORAK,
PLOVER,
BACKLIT,
EXT_PLV,
RGB_SLD
}; };
#define LOWER MO(_LOWER) enum planck_layers {
#define RAISE MO(_RAISE) _BASE,
_LOWER,
_RAISE,
_ADJUST,
};
# define LOWER MO(_LOWER)
# define RAISE MO(_RAISE)
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_planck_grid(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPACE,
KC_ESCAPE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE,
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_ENTER,
WEBUSB_PAIR, KC_LCTRL, KC_LALT, KC_LGUI, LOWER, KC_SPACE, KC_NO, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
),
/* Qwerty [_LOWER] = LAYOUT_planck_grid(
* ,-----------------------------------------------------------------------------------. KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
* |------+------+------+------+------+------+------+------+------+------+------+------| _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NONUS_BSLASH,KC_HOME, KC_END, _______,
* | Esc | A | S | D | F | G | H | J | K | L | ; | " | KC_COMMA, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_MEDIA_PLAY_PAUSE
* |------+------+------+------+------+------+------+------+------+------+------+------| ),
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_planck_grid(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Colemak [_RAISE] = LAYOUT_planck_grid(
* ,-----------------------------------------------------------------------------------. KC_GRAVE,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINUS, KC_EQUAL, KC_LBRACKET, KC_RBRACKET, KC_BSLASH,
* |------+------+------+------+------+------+------+------+------+------+------+------| _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NONUS_HASH, KC_NONUS_BSLASH,KC_PGUP, KC_PGDOWN, _______,
* | Esc | A | R | S | T | D | H | N | E | I | O | " | _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_MEDIA_NEXT_TRACK,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_MEDIA_PLAY_PAUSE
* |------+------+------+------+------+------+------+------+------+------+------+------| ),
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT_planck_grid(
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Dvorak [_ADJUST] = LAYOUT_planck_grid(
* ,-----------------------------------------------------------------------------------. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | KC_DEL, _______, AU_ON, AU_OFF, AU_TOG, _______, _______, RGB_TOG, RGB_VAI, RGB_VAD, LED_LEVEL, RESET,
* |------+------+------+------+------+------+------+------+------+------+------+------| _______, _______, MU_ON, MU_OFF, MU_TOG, _______, _______, RGB_MOD, RGB_HUI, RGB_HUD, TOGGLE_LAYER_COLOR, _______,
* | Esc | A | O | E | U | I | D | H | T | N | S | / | _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______
* |------+------+------+------+------+------+------+------+------+------+------+------| ),
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT_planck_grid(
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_planck_grid(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_planck_grid(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),
/* Plover layer (http://opensteno.org)
* ,-----------------------------------------------------------------------------------.
* | # | # | # | # | # | # | # | # | # | # | # | # |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | S | T | P | H | * | * | F | P | L | T | D |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | S | K | W | R | * | * | R | B | G | S | Z |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Exit | | | A | O | | E | U | | | |
* `-----------------------------------------------------------------------------------'
*/
[_PLOVER] = LAYOUT_planck_grid(
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
),
/* Adjust (Lower + Raise)
* v------------------------RGB CONTROL--------------------v
* ,-----------------------------------------------------------------------------------
* | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_planck_grid(
_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, TOGGLE_LAYER_COLOR, LED_LEVEL, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
}; };
// clang-format on
#ifdef AUDIO_ENABLE
float plover_song[][2] = SONG(PLOVER_SOUND);
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
#endif
layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
[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} }, [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}},
[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} }, [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}},
[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} }, [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}},
[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} },
}; };
void set_layer_color(int layer) { void set_layer_color(int layer) {
for (int i = 0; i < DRIVER_LED_TOTAL; i++) { for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
HSV hsv = { HSV hsv = {
.h = pgm_read_byte(&ledmap[layer][i][0]), .h = pgm_read_byte(&ledmap[layer][i][0]),
.s = pgm_read_byte(&ledmap[layer][i][1]), .s = pgm_read_byte(&ledmap[layer][i][1]),
.v = pgm_read_byte(&ledmap[layer][i][2]), .v = pgm_read_byte(&ledmap[layer][i][2]),
}; };
if (!hsv.h && !hsv.s && !hsv.v) { if (!hsv.h && !hsv.s && !hsv.v) {
rgb_matrix_set_color( i, 0, 0, 0 ); rgb_matrix_set_color(i, 0, 0, 0);
} else { } else {
RGB rgb = hsv_to_rgb( hsv ); RGB rgb = hsv_to_rgb(hsv);
float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX;
rgb_matrix_set_color( i, f * rgb.r, f * rgb.g, f * rgb.b ); rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b);
}
} }
}
} }
void rgb_matrix_indicators_user(void) { void rgb_matrix_indicators_user(void) {
if (g_suspend_state || keyboard_config.disable_layer_led) { return; } if (g_suspend_state || keyboard_config.disable_layer_led) {
switch (biton32(layer_state)) { return;
case 0: }
set_layer_color(0); switch (biton32(layer_state)) {
break; case 1:
case 3: set_layer_color(0);
set_layer_color(1); break;
break; case 2:
case 4: set_layer_color(1);
set_layer_color(2); break;
break; case 3:
case 6: set_layer_color(2);
set_layer_color(3); break;
break; default:
default: if (rgb_matrix_get_flags() == LED_FLAG_NONE) rgb_matrix_set_color_all(0, 0, 0);
if (rgb_matrix_get_flags() == LED_FLAG_NONE) break;
rgb_matrix_set_color_all(0, 0, 0); }
break;
}
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case RGB_SLD: case RGB_SLD:
if (record->event.pressed) { if (record->event.pressed) {
rgblight_mode(1); rgblight_mode(1);
}
return false;
case QWERTY:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
#ifdef KEYBOARD_planck_rev5
PORTE &= ~(1<<6);
#endif
} else {
unregister_code(KC_RSFT);
#ifdef KEYBOARD_planck_rev5
PORTE |= (1<<6);
#endif
}
return false;
break;
case PLOVER:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
PLAY_SONG(plover_song);
#endif
layer_off(_RAISE);
layer_off(_LOWER);
layer_off(_ADJUST);
layer_on(_PLOVER);
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
}
return false;
break;
case EXT_PLV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(plover_gb_song);
#endif
layer_off(_PLOVER);
}
return false;
break;
}
return true;
}
bool muse_mode = false;
uint8_t last_muse_note = 0;
uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 50;
bool encoder_update_user(uint8_t index, bool clockwise) {
if (muse_mode) {
if (IS_LAYER_ON(_RAISE)) {
if (clockwise) {
muse_offset++;
} else {
muse_offset--;
} }
} else { return false;
if (clockwise) {
muse_tempo+=1;
} else {
muse_tempo-=1;
}
}
} else {
if (clockwise) {
#ifdef MOUSEKEY_ENABLE
register_code(KC_MS_WH_DOWN);
unregister_code(KC_MS_WH_DOWN);
#else
register_code(KC_PGDN);
unregister_code(KC_PGDN);
#endif
} else {
#ifdef MOUSEKEY_ENABLE
register_code(KC_MS_WH_UP);
unregister_code(KC_MS_WH_UP);
#else
register_code(KC_PGUP);
unregister_code(KC_PGUP);
#endif
}
} }
return true; return true;
} }
void matrix_scan_user(void) { bool encoder_update_user(uint8_t index, bool clockwise) {
#ifdef AUDIO_ENABLE if (clockwise) {
if (muse_mode) { # ifdef MOUSEKEY_ENABLE
if (muse_counter == 0) { tap_code(KC_MS_WH_DOWN);
uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; # else
if (muse_note != last_muse_note) { tap_code(KC_PGDN);
stop_note(compute_freq_for_midi_note(last_muse_note)); # endif
play_note(compute_freq_for_midi_note(muse_note), 0xF); } else {
last_muse_note = muse_note; # ifdef MOUSEKEY_ENABLE
} tap_code(KC_MS_WH_UP);
} # else
muse_counter = (muse_counter + 1) % muse_tempo; tap_code(KC_PGUP);
# endif
} }
#endif return true;
} }
bool music_mask_user(uint16_t keycode) {
switch (keycode) {
case RAISE:
case LOWER:
return false;
default:
return true;
}
}
layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }

View File

@ -1,6 +1,7 @@
SRC += muse.c
# Set any rules.mk overrides for your specific keymap here. # Set any rules.mk overrides for your specific keymap here.
# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file # See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file
LTO_ENABLE = yes CONSOLE_ENABLE = no
COMMAND_ENABLE = no COMMAND_ENABLE = no
MOUSEKEY_ENABLE = no MOUSEKEY_ENABLE = no
WEBUSB_ENABLE = yes
ORYX_ENABLE = yes