1
0
Fork 0

[Keymap] Drashna keymap fixups (#14140)

This commit is contained in:
Drashna Jaelre 2021-08-24 01:37:14 -07:00 committed by GitHub
parent 4e1c5887c5
commit bc239cd520
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 27 deletions

View file

@ -50,6 +50,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_ONESHOT //#define NO_ACTION_ONESHOT
#define NO_ACTION_MACRO #define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION #define NO_ACTION_FUNCTION
/* PMW3360 Settings */
#define PMW3360_CS_PIN B0

View file

@ -91,8 +91,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define EXTERNAL_EEPROM_BYTE_COUNT 8196 // #define EXTERNAL_EEPROM_BYTE_COUNT 8196
// #define EXTERNAL_EEPROM_PAGE_SIZE 32 // #define EXTERNAL_EEPROM_PAGE_SIZE 32
// #define EXTERNAL_EEPROM_ADDRESS_SIZE 2 // #define EXTERNAL_EEPROM_ADDRESS_SIZE 2
#define DEBUG_EEPROM_OUTPUT // #define DEBUG_EEPROM_OUTPUT
#define PMW_CS_PIN B0 #define PMW3360_CS_PIN B0
#define SPI_MODE 0
#define SPI_DIVISOR 64

View file

@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_SPLIT #define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \ #define RGBLED_SPLIT \
{ 10, 10 } { 10, 10 }
#define RGBLIGHT_LIMIT_VAL 80
#define DEBUG_LED_PIN D6 #define DEBUG_LED_PIN D6
@ -48,3 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{ D5 } { D5 }
#define ENCODERS_PAD_B \ #define ENCODERS_PAD_B \
{ D4 } { D4 }
/* PMW3360 Settings */
#define PMW3360_CS_PIN B0

View file

@ -215,11 +215,12 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
uint8_t this_mod = get_mods(); uint8_t this_mod = get_mods();
uint8_t this_led = host_keyboard_leds(); uint8_t this_led = host_keyboard_leds();
uint8_t this_osm = get_oneshot_mods(); uint8_t this_osm = get_oneshot_mods();
bool is_ez;
# ifdef KEYBOARD_planck_ez # ifdef KEYBOARD_planck_ez
is_ez = true; # define THUMB_LED 41
# else
# define THUMB_LED 42
# endif # endif
# define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__)
# if defined(RGBLIGHT_ENABLE) # if defined(RGBLIGHT_ENABLE)
if (!userspace_config.rgb_layer_change) if (!userspace_config.rgb_layer_change)
# else # else
@ -265,16 +266,16 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
switch (get_highest_layer(default_layer_state)) { switch (get_highest_layer(default_layer_state)) {
case _DEFAULT_LAYER_1: case _DEFAULT_LAYER_1:
RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0x00, 0xFF, 0xFF); RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_1_RGB);
break; break;
case _DEFAULT_LAYER_2: case _DEFAULT_LAYER_2:
RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0xFF, 0x00, 0xFF); RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_2_RGB);
break; break;
case _DEFAULT_LAYER_3: case _DEFAULT_LAYER_3:
RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0x00, 0xFF, 0x00); RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_3_RGB);
break; break;
case _DEFAULT_LAYER_4: case _DEFAULT_LAYER_4:
RGB_MATRIX_INDICATOR_SET_COLOR((is_ez ? 41 : 42), 0xD9, 0xA5, 0x21); RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(THUMB_LED, DEFAULT_LAYER_4_RGB);
break; break;
} }

View file

@ -172,7 +172,6 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state; return state;
} }
state = layer_state_set_keymap(state);
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#if defined(RGBLIGHT_ENABLE) #if defined(RGBLIGHT_ENABLE)
state = layer_state_set_rgb_light(state); state = layer_state_set_rgb_light(state);
@ -188,6 +187,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
} }
} }
#endif #endif
state = layer_state_set_keymap(state);
return state; return state;
} }

View file

@ -76,10 +76,15 @@ enum userspace_layers {
#endif #endif
#define DEFAULT_LAYER_1_HSV HSV_CYAN #define DEFAULT_LAYER_1_HSV HSV_CYAN
#define DEFAULT_LAYER_2_HSV HSV_SPRINGGREEN #define DEFAULT_LAYER_2_HSV HSV_CHARTREUSE
#define DEFAULT_LAYER_3_HSV HSV_MAGENTA #define DEFAULT_LAYER_3_HSV HSV_MAGENTA
#define DEFAULT_LAYER_4_HSV HSV_GOLDENROD #define DEFAULT_LAYER_4_HSV HSV_GOLDENROD
#define DEFAULT_LAYER_1_RGB RGB_CYAN
#define DEFAULT_LAYER_2_RGB RGB_CHARTREUSE
#define DEFAULT_LAYER_3_RGB RGB_MAGENTA
#define DEFAULT_LAYER_4_RGB RGB_GOLDENROD
bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
void matrix_init_keymap(void); void matrix_init_keymap(void);

View file

@ -71,10 +71,6 @@ void keyboard_post_init_transport_sync(void) {
void user_transport_update(void) { void user_transport_update(void) {
if (is_keyboard_master()) { if (is_keyboard_master()) {
# ifdef OLED_ENABLE
user_state.oled_on = is_oled_on();
# endif
transport_keymap_config = keymap_config.raw; transport_keymap_config = keymap_config.raw;
transport_userspace_config = userspace_config.raw; transport_userspace_config = userspace_config.raw;
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
@ -89,13 +85,6 @@ void user_transport_update(void) {
#endif #endif
} else { } else {
# ifdef OLED_ENABLE
if (user_state.oled_on) {
oled_on();
} else {
oled_off();
}
# endif
keymap_config.raw = transport_keymap_config; keymap_config.raw = transport_keymap_config;
userspace_config.raw = transport_userspace_config; userspace_config.raw = transport_userspace_config;
#ifdef UNICODE_ENABLE #ifdef UNICODE_ENABLE