diff options
27 files changed, 250 insertions, 1062 deletions
diff --git a/keyboards/sol/common/knob_v2.c b/keyboards/sol/common/knob_v2.c deleted file mode 100644 index f22f7c5d86..0000000000 --- a/keyboards/sol/common/knob_v2.c +++ /dev/null @@ -1,71 +0,0 @@ -#include "knob_v2.h" - -bool knob_prev_a = false; -static knob_report_t knob_report = {.dir = 0, .phase = 0}; - -void knob_init(void) { - // I use pins D1 (ISR1) & D4 for a knob. - - // Set pin mode for D4 as input. - DDRD &= ~(0UL << ENCODER_PIN_2); - - // Enable internal pull-up for D4. - // This is done by "writing" 1 to a pin that has its mode set to input. - PORTD |= (1 << ENCODER_PIN_2); - - // Enable interrupt for D1 - // For more info on the below flags see this awesome section 11.1 (pages 89-90) here: - // https://cdn-shop.adafruit.com/datasheets/atmel-7766-8-bit-avr-atmega16u4-32u4_datasheet.pdf - // Set pin mode & pull-up. - DDRD &= ~(0UL << ENCODER_PIN_1); - PORTD |= (1UL << ENCODER_PIN_1); - - // INT: 33221100 - EICRA |= 0b00010000; // 0b01 - any edge - // INT: 6 3210 - EIMSK |= 0b00000100; -} - -ISR(ENCODER_INT) { - bool a = PIND & (1 << ENCODER_PIN_1); - - if (knob_prev_a != a) { - // "A" channel has REALLY changed. - knob_report.phase = a; - knob_prev_a = a; - bool b = PIND & (1 << ENCODER_PIN_2); - if (a == b) { - // Halfway through CCW rotation (A == B) - // - // +---YOU ARE HERE (A=1, B=1) - // | +---OR HERE (A=0, B=0) - // | | - // v v - // A: _____/^^^^^\__ - // B: __/^^^^^\_____ - knob_report.dir++; - } else { - // Halfway through CW rotation (A != B) - // - // +---YOU ARE HERE (A=1, B=0) - // | +---OR HERE (A=0, B=1) - // | | - // v v - // A: _____/^^^^^\_____ - // B: ________/^^^^^\__ - knob_report.dir--; - } - } -} - -knob_report_t knob_report_read(void) { - // Return knob report. - return knob_report; -} - -void knob_report_reset(void) { - // Call this ASAP once you've processed the previous knob report. - // TODO: This should probably be called within `knob_report_read`. - knob_report.dir = 0; - knob_report.phase = 0; -} diff --git a/keyboards/sol/common/knob_v2.h b/keyboards/sol/common/knob_v2.h deleted file mode 100644 index 45196eb1a6..0000000000 --- a/keyboards/sol/common/knob_v2.h +++ /dev/null @@ -1,28 +0,0 @@ -// Rotary knob implementation - Version 2. -// Uses 2 digital pins - D2 (via interrupt) & D6. -// #include "rev1.h" -#include <avr/io.h> -#include <avr/interrupt.h> -#include <stdbool.h> - -#ifndef ENCODER_PIN_1 - #define ENCODER_PIN_1 PD2 -#endif -#ifndef ENCODER_PIN_2 - #define ENCODER_PIN_2 PD6 -#endif -#ifndef ENCODER_INT - #define ENCODER_INT INT2_vect -#endif - -typedef struct knob_report_t { - int8_t dir; // Contains number of rotations that happened - int8_t phase; // Contains 0 if last rotation happened on 90 degrees, 1 if on 270 -} knob_report_t; - -void knob_init(void); -knob_report_t knob_report_read(void); -void knob_report_reset(void); - -bool knob_prev_a; -int8_t knob_dir; diff --git a/keyboards/sol/config.h b/keyboards/sol/config.h index 93fd2261b1..a7317d9d9c 100644 --- a/keyboards/sol/config.h +++ b/keyboards/sol/config.h @@ -20,3 +20,73 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "config_common.h" +#define TAPPING_TERM 150 + +/* Select hand configuration */ +#define SOFT_SERIAL_PIN D3 +#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, E6} + +// wiring of each half +#define MATRIX_COLS 7 +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } + +// Encoder support +#define NUMBER_OF_ENCODERS 1 +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { D6 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B3 + +#ifdef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 40 +#elif RGBLIGHT_FULL_POWER + #define RGBLIGHT_LIMIT_VAL 255 +#else + #define RGBLIGHT_LIMIT_VAL 120 +#endif +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS RGBLIGHT_LIMIT_VAL + +#define LED_HITS_TO_REMEMBER 5 + +#define RGBLIGHT_ANIMATIONS + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for Helix keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 500 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION 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(); diff --git a/keyboards/sol/keymaps/brianweyer/rules.mk b/keyboards/sol/keymaps/brianweyer/rules.mk index 15b0c8fd23..12c8779467 100755 --- a/keyboards/sol/keymaps/brianweyer/rules.mk +++ b/keyboards/sol/keymaps/brianweyer/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = yes # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/danielhklein/keymap.c b/keyboards/sol/keymaps/danielhklein/keymap.c index 9bcc5761af..860361e810 100644 --- a/keyboards/sol/keymaps/danielhklein/keymap.c +++ b/keyboards/sol/keymaps/danielhklein/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 @@ -64,7 +62,7 @@ LAYOUT( \ KC_CAPS, _10, _11, _12, _13, _14, KC_LCBR, KC_RCBR, _15, _16, _17, _18, _19, KC_QUOT, \ KC_LSFT, _20, _21, _22, _23, _24, KC_GRV, KC_BSLS, _25, _26, _27, _28, _29, KC_RSFT, \ KC_LEFT, KC_DOWN, KC_LCTRL, KC_LALT, KC_LGUI, KC_BSPC, FN, ADJ, KC_SPC, KC_RGUI, KC_RALT, KC_RCTRL, KC_UP, KC_RIGHT, \ - KC_VOLU, KC_VOLD, KC_BSPC, FN, ADJ, KC_SPC, KC_VOLU, KC_VOLD \ + KC_BSPC, FN, ADJ, KC_SPC \ ) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -132,7 +130,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + XXXXXXX, _______, XXXXXXX, XXXXXXX \ ), /* ADJ @@ -157,7 +155,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, RGB_SAD, RGB_VAI, RGB_SAI, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PENT, XXXXXXX, XXXXXXX, \ XXXXXXX, RGB_HUD, RGB_VAD, RGB_HUI, XXXXXXX, XXXXXXX, QWERTY, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_SPC, XXXXXXX, XXXXXXX, \ XXXXXXX, RGBRST, RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_P0, KC_PDOT, KC_BSPC, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX \ + XXXXXXX, XXXXXXX, _______, XXXXXXX \ ) }; @@ -165,6 +163,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_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif + // Setting ADJ layer RGB back to default void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { @@ -308,7 +324,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (is_master) + if (is_keyboard_master()) render_status(); else render_logo(); diff --git a/keyboards/sol/keymaps/danielhklein/rules.mk b/keyboards/sol/keymaps/danielhklein/rules.mk index 526b72fe7f..09b0e201d5 100644 --- a/keyboards/sol/keymaps/danielhklein/rules.mk +++ b/keyboards/sol/keymaps/danielhklein/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/default/keymap.c b/keyboards/sol/keymaps/default/keymap.c index a40bc40b73..c101a9bd8e 100644 --- a/keyboards/sol/keymaps/default/keymap.c +++ b/keyboards/sol/keymaps/default/keymap.c @@ -12,8 +12,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 @@ -70,7 +68,7 @@ LAYOUT( \ FN_CAPS, _10, _11, _12, _13, _14, KC_LPRN, KC_RPRN, _15, _16, _17, _18, _19, KC_QUOT, \ KC_LSFT, _20, _21, _22, _23, _24, KC_LCBR, KC_RCBR, _25, _26, _27, _28, _29, KC_ENT, \ KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_DEL, KC_ENT, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, \ - KC_VOLU, KC_VOLD, KC_SPC, KC_DEL, KC_ENT, KC_SPC, KC_VOLU, KC_VOLD \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ ) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -138,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ - KC_VOLU, KC_VOLD, _______, _______, _______, _______, KC_VOLU, KC_VOLD \ + _______, _______, _______, _______ \ ), /* ADJ @@ -163,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, \ - KC_VOLU, KC_VOLD, _______, _______, _______, _______, KC_VOLU, KC_VOLD \ + _______, _______, _______, _______ \ ) }; @@ -173,6 +171,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_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif + // Setting ADJ layer RGB back to default void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { @@ -316,7 +332,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (is_master) + if (is_keyboard_master()) render_status(); else render_logo(); diff --git a/keyboards/sol/keymaps/default/rules.mk b/keyboards/sol/keymaps/default/rules.mk index 526b72fe7f..09b0e201d5 100644 --- a/keyboards/sol/keymaps/default/rules.mk +++ b/keyboards/sol/keymaps/default/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/kageurufu/keymap.c b/keyboards/sol/keymaps/kageurufu/keymap.c index 9ea89db058..b587ef2b3d 100644 --- a/keyboards/sol/keymaps/kageurufu/keymap.c +++ b/keyboards/sol/keymaps/kageurufu/keymap.c @@ -35,7 +35,7 @@ EXPAND_LAYOUT( \ FN_ESC, _10, _11, _12, _13, _14, RGB_SAI, RGB_VAI, _15, _16, _17, _18, _19, KC_QUOT, \ KC_LSPO, _20, _21, _22, _23, _24, RGB_SAD, RGB_VAD, _25, _26, _27, _28, _29, KC_RSPC, \ KC_LCTL, KC_LGUI, KC_LGUI, KC_LALT, FN, KC_SPC, FN, FN, KC_SPC, KC_MINS, KC_EQL, KC_DOWN, KC_PGUP, KC_PGDN, \ - KC_VOLD, KC_VOLU, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, KC_VOLD, KC_VOLU \ + KC_SPC, KC_BSPC, KC_ENT, KC_SPC \ ) #define BASE_LAYOUT(...) _BASE_LAYOUT(__VA_ARGS__) @@ -65,15 +65,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ________________FUNCTION_L3________________, _______, _______, ________________FUNCTION_R3________________, \ ________________FUNCTION_L4________________, _______, _______, ________________FUNCTION_R4________________, \ ________________FUNCTION_L5________________, ADJ, ADJ, ________________FUNCTION_R5________________, \ - KC_VOLD, KC_VOLU, _______, KC_DEL, _______, _______, KC_VOLD, KC_VOLU \ + _______, KC_DEL, _______, _______ \ ), - [_ADJ] = EXPAND_LAYOUT( \ + [_ADJ] = EXPAND_LAYOUT( \ _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, \ _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, \ _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________, \ - KC_VOLD, KC_VOLU, _______, _______, _______, _______, KC_VOLD, KC_VOLU \ + _______, _______, _______, _______ \ ) }; + +#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_VOLU); + } else { + tap_code(KC_VOLD); + } + } +} +#endif diff --git a/keyboards/sol/keymaps/kageurufu/rules.mk b/keyboards/sol/keymaps/kageurufu/rules.mk index 82816f960f..21dca0b116 100644 --- a/keyboards/sol/keymaps/kageurufu/rules.mk +++ b/keyboards/sol/keymaps/kageurufu/rules.mk @@ -17,18 +17,12 @@ RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = yes # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/keymaps/xulkal/keymap.c b/keyboards/sol/keymaps/xulkal/keymap.c index 4591034d21..111e8aa320 100644 --- a/keyboards/sol/keymaps/xulkal/keymap.c +++ b/keyboards/sol/keymaps/xulkal/keymap.c @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _________________QWERTY_L3_________________, KC_GRV, KC_QUOT, _________________QWERTY_R3_________________, \ _________________QWERTY_L4_________________, RGB_TOG, RGBRST, _________________QWERTY_R4_________________, \ _________________QWERTY_L5_________________, RGB_RMOD, RGB_MOD, _________________QWERTY_R5_________________, \ - KC_VOLU, KC_VOLD, KC_SPC, KC_DEL, KC_ENT, KC_SPC, KC_VOLU, KC_VOLD \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ ), #ifndef GAMELAYER_DISABLE @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ___________________GAME_L3_________________, KC_GRV, KC_QUOT, ___________________GAME_R3_________________, \ ___________________GAME_L4_________________, RGB_TOG, RGBRST, ___________________GAME_R4_________________, \ ___________________GAME_L5_________________, RGB_RMOD, RGB_MOD, ___________________GAME_R5_________________, \ - KC_VOLU, KC_VOLD, KC_SPC, KC_DEL, KC_ENT, KC_SPC, KC_VOLU, KC_VOLD \ + KC_SPC, KC_DEL, KC_ENT, KC_SPC \ ), #endif @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __________________LOWER_L3_________________, _______, _______, __________________LOWER_R3_________________, \ __________________LOWER_L4_________________, _______, _______, __________________LOWER_R4_________________, \ __________________LOWER_L5_________________, _______, _______, __________________LOWER_R5_________________, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______ \ ), [_RAISE] = EXPAND_LAYOUT( \ @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { __________________RAISE_L3_________________, _______, _______, __________________RAISE_R3_________________, \ __________________RAISE_L4_________________, _______, _______, __________________RAISE_R4_________________, \ __________________RAISE_L5_________________, _______, _______, __________________RAISE_R5_________________, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______ \ ), #ifdef TRILAYER_ENABLED @@ -75,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______ \ ), #endif }; @@ -158,7 +158,7 @@ static void render_status(void) { } void oled_task_user(void) { - if (has_usb()) { + if (is_keyboard_master()) { render_status(); } else { render_logo(); diff --git a/keyboards/sol/keymaps/xulkal/rules.mk b/keyboards/sol/keymaps/xulkal/rules.mk index 685b8ced9a..c3ed98edb6 100644 --- a/keyboards/sol/keymaps/xulkal/rules.mk +++ b/keyboards/sol/keymaps/xulkal/rules.mk @@ -16,17 +16,12 @@ RGB_MATRIX_KEYPRESSES = yes # Enable reactive per-key effects. Can be very l RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -ENCODER_ENABLE_CUSTOM = no # Enable rotary encoder (+90) OLED_DRIVER_ENABLE = yes # Enable the OLED Driver (+5000) +ENCODER_ENABLE = no # Enable rotary encoder (+90) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here -ifeq ($(strip $(ENCODER_ENABLE_CUSTOM)), yes) - OPT_DEFS += -DENCODER_ENABLE_CUSTOM - SRC += common/knob_v2.c -endif - ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) OPT_DEFS += -DIOS_DEVICE_ENABLE else ifeq ($(strip $(RGBLIGHT_FULL_POWER)), yes) diff --git a/keyboards/sol/rev1/config.h b/keyboards/sol/rev1/config.h index 1d8391f645..056869daa0 100644 --- a/keyboards/sol/rev1/config.h +++ b/keyboards/sol/rev1/config.h @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -27,117 +26,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define PRODUCT Sol #define DESCRIPTION "An RGB, split, ortho-esque keyboard" -#define PREVENT_STUCK_MODIFIERS -#define TAPPING_FORCE_HOLD -#define TAPPING_TERM 150 - -#define USE_I2C -#define USE_SERIAL -#define USE_SERIAL_PD3 - -/* Select hand configuration */ -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - -/* Select rows configuration */ -// Rows are 4 or 5 -// #define HELIX_ROWS 5 see ./rules.mk - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 12 -#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, E6} - -// wiring of each half -#define MATRIX_COLS 7 -#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } -// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -//#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -//#define LOCKING_RESYNC_ENABLE - -/* ws2812 RGB LED */ -#define RGB_DI_PIN B3 -#define RGBLIGHT_TIMER -//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -#define DRIVER_COUNT 1 -// #define RGB_MATRIX_KEYPRESSES -#define BACKLIGHT_PIN B7 -#define BACKLIGHT_LEVELS 5 - #ifdef LED_MIRRORED #define RGBLED_NUM 35 #else #define RGBLED_NUM 70 |