Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keymap] Drashna keymap fixups #14140

Merged
merged 5 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions keyboards/handwired/tractyl_manuform/5x6_right/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_ONESHOT
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION

/* PMW3360 Settings */
#define PMW3360_CS_PIN B0
6 changes: 2 additions & 4 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_PAGE_SIZE 32
// #define EXTERNAL_EEPROM_ADDRESS_SIZE 2
#define DEBUG_EEPROM_OUTPUT
// #define DEBUG_EEPROM_OUTPUT

#define PMW_CS_PIN B0
#define SPI_MODE 0
#define SPI_DIVISOR 64
#define PMW3360_CS_PIN B0
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \
{ 10, 10 }
#define RGBLIGHT_LIMIT_VAL 80

#define DEBUG_LED_PIN D6

Expand All @@ -48,3 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{ D5 }
#define ENCODERS_PAD_B \
{ D4 }

/* PMW3360 Settings */
#define PMW3360_CS_PIN B0
15 changes: 8 additions & 7 deletions layouts/community/ortho_4x12/drashna/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_led = host_keyboard_leds();
uint8_t this_osm = get_oneshot_mods();
bool is_ez;
# ifdef KEYBOARD_planck_ez
is_ez = true;
# define THUMB_LED 41
# else
# define THUMB_LED 42
# endif

# define RGB_MATRIX_INDICATOR_SET_COLOR_wrapper(...) RGB_MATRIX_INDICATOR_SET_COLOR(__VA_ARGS__)
# if defined(RGBLIGHT_ENABLE)
if (!userspace_config.rgb_layer_change)
# else
Expand Down Expand Up @@ -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)) {
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;
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;
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;
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;
}

Expand Down
2 changes: 1 addition & 1 deletion users/drashna/drashna.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}

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

Expand Down
7 changes: 6 additions & 1 deletion users/drashna/drashna.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ enum userspace_layers {
#endif

#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_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(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
void matrix_init_keymap(void);
Expand Down
11 changes: 0 additions & 11 deletions users/drashna/transport_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ void keyboard_post_init_transport_sync(void) {

void user_transport_update(void) {
if (is_keyboard_master()) {
# ifdef OLED_ENABLE
user_state.oled_on = is_oled_on();
# endif

transport_keymap_config = keymap_config.raw;
transport_userspace_config = userspace_config.raw;
#ifdef AUDIO_ENABLE
Expand All @@ -89,13 +85,6 @@ void user_transport_update(void) {
#endif

} else {
# ifdef OLED_ENABLE
if (user_state.oled_on) {
oled_on();
} else {
oled_off();
}
# endif
keymap_config.raw = transport_keymap_config;
userspace_config.raw = transport_userspace_config;
#ifdef UNICODE_ENABLE
Expand Down