[Keyboard] Updates to ZSA boards (#6513)
* Update Layer functions to use layer_state_t in ZSA Boards * Update Music Mask for ZSA boards Fixes an issue with the board getting stuck on Adjust layer when activating music mode * Add Support for SMART LED Toggle to Planck EZ * Add support for SMART LED toggle in Ergodox EZ * Ifdef swiss cheeze for Oryx Configurator * Documentation and updates * Add Oryx Keymap * Add option to configure the layers for the Layer Indicator * Update keymap with better examples * Make sure eeprom is initialized before reading from it * Force flush of LED matrix when suspending board This fixes an issue where the LEDs don't fully clear sometimes when the host system goes to sleep * Enable RGB Sleeping by default * Add clarification about planck ez led layer config
This commit is contained in:
parent
1c5b0cbbeb
commit
94efa18c28
12 changed files with 629 additions and 11 deletions
|
@ -22,6 +22,8 @@ extern inline void ergodox_right_led_set(uint8_t led, uint8_t n);
|
|||
|
||||
extern inline void ergodox_led_all_set(uint8_t n);
|
||||
|
||||
keyboard_config_t keyboard_config;
|
||||
|
||||
bool i2c_initialized = 0;
|
||||
i2c_status_t mcp23018_status = 0x20;
|
||||
|
||||
|
@ -43,6 +45,16 @@ void matrix_init_kb(void) {
|
|||
PORTD |= (1<<5 | 1<<4);
|
||||
PORTE |= (1<<6);
|
||||
|
||||
keyboard_config.raw = eeconfig_read_kb();
|
||||
ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4 );
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
if (keyboard_config.rgb_matrix_enable) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} else {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
}
|
||||
#endif
|
||||
|
||||
ergodox_blink_all_leds();
|
||||
|
||||
matrix_init_user();
|
||||
|
@ -305,6 +317,7 @@ led_config_t g_led_config = { {
|
|||
} };
|
||||
|
||||
void suspend_power_down_kb(void) {
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
rgb_matrix_set_suspend_state(true);
|
||||
suspend_power_down_user();
|
||||
}
|
||||
|
@ -314,4 +327,65 @@ void suspend_power_down_kb(void) {
|
|||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
||||
#ifdef ORYX_CONFIGURATOR
|
||||
void keyboard_post_init_kb(void) {
|
||||
rgb_matrix_enable_noeeprom();
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ORYX_CONFIGURATOR
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case LED_LEVEL:
|
||||
if (record->event.pressed) {
|
||||
keyboard_config.led_level++;
|
||||
if (keyboard_config.led_level > 4) {
|
||||
keyboard_config.led_level = 0;
|
||||
}
|
||||
ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4 );
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
layer_state_set_kb(layer_state);
|
||||
}
|
||||
break;
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case TOGGLE_LAYER_COLOR:
|
||||
if (record->event.pressed) {
|
||||
keyboard_config.disable_layer_led ^= 1;
|
||||
if (keyboard_config.disable_layer_led)
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
}
|
||||
break;
|
||||
case RGB_TOG:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
keyboard_config.rgb_matrix_enable = false;
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
#endif
|
||||
|
||||
void eeconfig_init_kb(void) { // EEPROM is getting reset!
|
||||
keyboard_config.raw = 0;
|
||||
keyboard_config.led_level = 4;
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
eeconfig_init_user();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue