diff options
author | XScorpion2 <rcalt2vt@gmail.com> | 2019-05-06 17:06:43 -0500 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-05-06 15:06:43 -0700 |
commit | e01b2d518a1a08ce07278ef9a38c7a793c843749 (patch) | |
tree | bb63e0653e09308286d86df303c8d17a447df46c /keyboards/sol/keymaps/brianweyer/keymap.c | |
parent | 99500243e10c12c0a5005da49aa1986947b27153 (diff) |
[Keyboard] Sol keyboard conversion to split common (#5773)
* Split common conversion
* Updated serial and encoder pins
* Fixing default folder until r2
* Fixing oled driver on slave split common
* Fixing keymap compile errors
* Fixing oled inactivity timer on slave split common
* Hoisted oled driver task, init, & activity to keyboard.c
* Update keyboards/sol/config.h
Co-Authored-By: XScorpion2 <rcalt2vt@gmail.com>
* Remove TAPPING_FORCE_HOLD
Diffstat (limited to 'keyboards/sol/keymaps/brianweyer/keymap.c')
-rwxr-xr-x | keyboards/sol/keymaps/brianweyer/keymap.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/keyboards/sol/keymaps/brianweyer/keymap.c b/keyboards/sol/keymaps/brianweyer/keymap.c index 87d603d817..3ba52081d2 100755 --- a/keyboards/sol/keymaps/brianweyer/keymap.c +++ b/keyboards/sol/keymaps/brianweyer/keymap.c @@ -11,8 +11,6 @@ extern keymap_config_t keymap_config; extern rgblight_config_t rgblight_config; #endif -extern uint8_t is_master; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -59,8 +57,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| LCTL, LALT, FN, LGUI, RGB_MOD, SPC, DEL, BSPC, SPC, ADJ, LGUI, FN, LALT, LCTL, //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| - VOLD, VOLU, SPC, ENT, ENT, SPC, DOWN, UP - // Rotary Left |--------+--------| |--------+-----------+ Rotary Right + SPC, ENT, ENT, SPC + // |--------+--------| |--------+-----------+ ), /* FN @@ -90,8 +88,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| - VOLD, VOLU, _______, _______, _______, _______, UP, DOWN - // Rotary Left |--------+--------| |--------+-----------+ Rotary Right + _______, _______, _______, _______ + // |--------+--------| |--------+-----------+ ), /* ADJ @@ -122,8 +120,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--------+--+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______ \ - // Rotary Left |--------+--------| |--------+--------+ Rotary Right + _______, _______, _______, _______ \ + // |--------+--------| |--------+--------+ ) }; @@ -132,6 +130,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { bool TOG_STATUS = false; int RGB_current_mode; +#ifdef ENCODER_ENABLE +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder*/ + if (clockwise) { + tap_code(KC_UP); + } else { + tap_code(KC_DOWN); + } + } +} +#endif + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { @@ -182,7 +198,7 @@ void matrix_init_user(void) { #ifdef OLED_DRIVER_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!has_usb()) + if (!is_keyboard_master()) return OLED_ROTATION_180; // flip 180 for offhand return rotation; } @@ -244,7 +260,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (is_master) + if (is_keyboard_master()) render_status(); else render_logo(); |