[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
This commit is contained in:
parent
99500243e1
commit
e01b2d518a
27 changed files with 250 additions and 1062 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue