diff options
Diffstat (limited to 'keyboards/rate')
-rw-r--r-- | keyboards/rate/pistachio/rev1/config.h | 6 | ||||
-rw-r--r-- | keyboards/rate/pistachio/rev1/info.json | 5 | ||||
-rw-r--r-- | keyboards/rate/pistachio/rev2/config.h | 6 | ||||
-rw-r--r-- | keyboards/rate/pistachio/rev2/info.json | 5 | ||||
-rw-r--r-- | keyboards/rate/pistachio_mp/config.h | 3 | ||||
-rw-r--r-- | keyboards/rate/pistachio_mp/info.json | 4 | ||||
-rw-r--r-- | keyboards/rate/pistachio_mp/keymaps/default/keymap.c | 13 | ||||
-rw-r--r-- | keyboards/rate/pistachio_mp/keymaps/via/keymap.c | 79 | ||||
-rw-r--r-- | keyboards/rate/pistachio_mp/keymaps/via/rules.mk | 3 | ||||
-rw-r--r-- | keyboards/rate/pistachio_pro/keymaps/default/keymap.c | 14 | ||||
-rw-r--r-- | keyboards/rate/pistachio_pro/keymaps/via/keymap.c | 79 | ||||
-rw-r--r-- | keyboards/rate/pistachio_pro/keymaps/via/rules.mk | 1 |
12 files changed, 47 insertions, 171 deletions
diff --git a/keyboards/rate/pistachio/rev1/config.h b/keyboards/rate/pistachio/rev1/config.h index cf7e2cdfb0..cad548df8e 100644 --- a/keyboards/rate/pistachio/rev1/config.h +++ b/keyboards/rate/pistachio/rev1/config.h @@ -19,13 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define USE_I2C -/* ws2812 RGB LED */ -#define RGBLIGHT_SPLIT -#define RGBLED_SPLIT { 1, 1 } -#define RGBLED_NUM 2 #define RGBLIGHT_LAYERS -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) #define USB_MAX_POWER_CONSUMPTION 400 diff --git a/keyboards/rate/pistachio/rev1/info.json b/keyboards/rate/pistachio/rev1/info.json index a50ae8b991..2bec0c52af 100644 --- a/keyboards/rate/pistachio/rev1/info.json +++ b/keyboards/rate/pistachio/rev1/info.json @@ -1,4 +1,9 @@ { + "rgblight": { + "hue_steps": 10, + "led_count": 2, + "split_count": [1, 1] + }, "ws2812": { "pin": "D2" }, diff --git a/keyboards/rate/pistachio/rev2/config.h b/keyboards/rate/pistachio/rev2/config.h index 5ac0b8fbfa..8b5dcbc9f4 100644 --- a/keyboards/rate/pistachio/rev2/config.h +++ b/keyboards/rate/pistachio/rev2/config.h @@ -22,13 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. /* Split hand configration */ #define SPLIT_HAND_MATRIX_GRID D4,D3 -/* ws2812 RGB LED */ -#define RGBLIGHT_SPLIT -#define RGBLED_SPLIT { 38, 46 } -#define RGBLED_NUM 84 #define RGBLIGHT_LAYERS -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) #define USB_MAX_POWER_CONSUMPTION 400 diff --git a/keyboards/rate/pistachio/rev2/info.json b/keyboards/rate/pistachio/rev2/info.json index a1ea3be3cb..9f0c169b87 100644 --- a/keyboards/rate/pistachio/rev2/info.json +++ b/keyboards/rate/pistachio/rev2/info.json @@ -3,7 +3,10 @@ "pin": "D2" }, "rgblight": { - "max_brightness": 195 + "hue_steps": 10, + "led_count": 84, + "max_brightness": 195, + "split_count": [38, 46] }, "matrix_pins": { "cols": ["B6", "B2", "B3", "B1", "F7", "F6", "F5", "F4", "D3"], diff --git a/keyboards/rate/pistachio_mp/config.h b/keyboards/rate/pistachio_mp/config.h index 25aac817da..eaa46500a1 100644 --- a/keyboards/rate/pistachio_mp/config.h +++ b/keyboards/rate/pistachio_mp/config.h @@ -17,9 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #pragma once -#define RGBLED_NUM 3 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) #define USB_MAX_POWER_CONSUMPTION 400 #else diff --git a/keyboards/rate/pistachio_mp/info.json b/keyboards/rate/pistachio_mp/info.json index 07943e5ca3..a37b55b6ab 100644 --- a/keyboards/rate/pistachio_mp/info.json +++ b/keyboards/rate/pistachio_mp/info.json @@ -9,6 +9,10 @@ "device_version": "0.0.1", "force_nkro": true }, + "rgblight": { + "hue_steps": 10, + "led_count": 3 + }, "ws2812": { "pin": "D2" }, diff --git a/keyboards/rate/pistachio_mp/keymaps/default/keymap.c b/keyboards/rate/pistachio_mp/keymaps/default/keymap.c index 86f88d9143..e73abd09eb 100644 --- a/keyboards/rate/pistachio_mp/keymaps/default/keymap.c +++ b/keyboards/rate/pistachio_mp/keymaps/default/keymap.c @@ -41,16 +41,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_NO, KC_NO ) }; -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - // Volume control - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} -#endif diff --git a/keyboards/rate/pistachio_mp/keymaps/via/keymap.c b/keyboards/rate/pistachio_mp/keymaps/via/keymap.c index f459a76970..5e4dc36887 100644 --- a/keyboards/rate/pistachio_mp/keymaps/via/keymap.c +++ b/keyboards/rate/pistachio_mp/keymaps/via/keymap.c @@ -23,29 +23,10 @@ enum layer_names { _RESERVE_1 }; -static uint8_t encoder_state = 0; -static const keypos_t ENC_CW = {.row = 3, .col = 3}; -static const keypos_t ENC_CCW = {.row = 4, .col = 1}; - -#define LAYOUT_via( \ - ECW,ECCW, K07, \ - K00, K01, K02, K03, \ - K04, K05, K06, \ - K08, K09, K10, K11, \ - K12, K13, K14, \ - K15, K16, K17 ) { \ - { K00, K01, K02, K03 }, \ - { K04, K05, K06, K07 }, \ - { K08, K09, K10, K11 }, \ - { K12, K13, K14, ECCW }, \ - { K15, ECW, K16, K17 }, \ -} - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base */ - [_BASE] = LAYOUT_via( - KC_VOLU,KC_VOLD,KC_MPLY, + [_BASE] = LAYOUT( + KC_MPLY, LT(_FN, KC_NUM), KC_PSLS, KC_PAST, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_P4, KC_P5, KC_P6, KC_PPLS, @@ -53,8 +34,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_P0, KC_PDOT, KC_PENT ), /* Fn */ - [_FN] = LAYOUT_via( - KC_VOLU,KC_VOLD,KC_NO, + [_FN] = LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_HUD, RGB_SAD, RGB_VAD, RGB_TOG, @@ -62,8 +43,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_NO, KC_NO, KC_NO ), /* Reserve */ - [_RESERVE_0] = LAYOUT_via( - KC_VOLU,KC_VOLD,KC_TRNS, + [_RESERVE_0] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -71,8 +52,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS ), /* Reserve */ - [_RESERVE_1] = LAYOUT_via( - KC_VOLU,KC_VOLD,KC_TRNS, + [_RESERVE_1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -81,43 +62,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -#ifdef ENCODER_ENABLE -void encoder_action_unregister(void) { - if (encoder_state) { - keyevent_t encoder_event = (keyevent_t) { - .key = encoder_state >> 1 ? ENC_CW : ENC_CCW, - .pressed = false, - .time = timer_read(), - .type = KEY_EVENT - }; - encoder_state = 0; - action_exec(encoder_event); - } - return; -} - -void encoder_action_register(uint8_t index, bool clockwise) { - keyevent_t encoder_event = (keyevent_t) { - .key = clockwise ? ENC_CW : ENC_CCW, - .pressed = true, - .time = timer_read(), - .type = KEY_EVENT - }; - encoder_state = (clockwise ^ 1) | (clockwise << 1); - action_exec(encoder_event); - return; -} - -void matrix_scan_kb(void) { - encoder_action_unregister(); - matrix_scan_user(); - return; -} - -bool encoder_update_kb(uint8_t index, bool clockwise) { - encoder_action_register(index, clockwise); - // don't return user actions, because they are in the keymap - // encoder_update_user(index, clockwise); - return true; +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______) }, }; #endif diff --git a/keyboards/rate/pistachio_mp/keymaps/via/rules.mk b/keyboards/rate/pistachio_mp/keymaps/via/rules.mk index 036bd6d1c3..f1adcab005 100644 --- a/keyboards/rate/pistachio_mp/keymaps/via/rules.mk +++ b/keyboards/rate/pistachio_mp/keymaps/via/rules.mk @@ -1 +1,2 @@ -VIA_ENABLE = yes
\ No newline at end of file +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/rate/pistachio_pro/keymaps/default/keymap.c b/keyboards/rate/pistachio_pro/keymaps/default/keymap.c index 5a543ef11c..a757bcce32 100644 --- a/keyboards/rate/pistachio_pro/keymaps/default/keymap.c +++ b/keyboards/rate/pistachio_pro/keymaps/default/keymap.c @@ -91,20 +91,6 @@ bool oled_task_user(void) { return false; } -/* Encoder */ -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { - // Volume control - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - - return true; -} - /* Keyboard */ void keyboard_post_init_user(void) { bme280_init(); diff --git a/keyboards/rate/pistachio_pro/keymaps/via/keymap.c b/keyboards/rate/pistachio_pro/keymaps/via/keymap.c index b5b8e3c440..30156f0898 100644 --- a/keyboards/rate/pistachio_pro/keymaps/via/keymap.c +++ b/keyboards/rate/pistachio_pro/keymaps/via/keymap.c @@ -26,54 +26,34 @@ enum layer_names { _RESERVE_1 }; -static uint8_t encoder_state = 0; -static const keypos_t ENC_CW = {.row = 0, .col = 14 }; -static const keypos_t ENC_CCW = {.row = 0, .col = 15 }; - -#define LAYOUT_via( \ - k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, ENC_CW, ENC_CCW, k013, \ - k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117, \ - k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, \ - k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, \ - k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, \ - k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513 ) { \ - { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, ENC_CW, ENC_CCW, KC_NO, KC_NO }, \ - { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, k114, k115, k116, k117 }, \ - { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k214, k215, KC_NO, KC_NO }, \ - { k300, k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { k400, k401, k402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k412, k413, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { k500, k501, k502, k503, k504, k505, k506, k507, k508, k509, k510, k511, k512, k513, KC_NO, KC_NO, KC_NO, KC_NO } \ -} - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base */ - [_BASE] = LAYOUT_via( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLU,KC_VOLD,KC_MPLY, + [_BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, JP_ZKHK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, JP_MINS, JP_CIRC, JP_YEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, KC_DEL, KC_END, KC_PGDN, JP_EISU, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_SCLN, JP_COLN, JP_RBRC, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM, JP_DOT, JP_SLSH, JP_BSLS, KC_RSFT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, JP_MHEN, KC_SPC, KC_SPC, LT(_FN, JP_HENK), JP_KANA, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - [_FN] = LAYOUT_via( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,KC_VOLD,KC_MPLY, + [_FN] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, JP_DOT, JP_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [_RESERVE_0] = LAYOUT_via( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,KC_VOLD,KC_MPLY, + [_RESERVE_0] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [_RESERVE_1] = LAYOUT_via( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,KC_VOLD,KC_MPLY, + [_RESERVE_1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -129,40 +109,6 @@ bool oled_task_user(void) { return false; } -/* Encoder */ -void encoder_action_unregister(void) { - if (encoder_state) { - keyevent_t encoder_event = (keyevent_t) { - .key = encoder_state >> 1 ? ENC_CW : ENC_CCW, - .pressed = false, - .time = timer_read(), - .type = KEY_EVENT - }; - encoder_state = 0; - action_exec(encoder_event); - } -} - -void encoder_action_register(uint8_t index, bool clockwise) { - keyevent_t encoder_event = (keyevent_t) { - .key = clockwise ? ENC_CW : ENC_CCW, - .pressed = true, - .time = timer_read(), - .type = KEY_EVENT - }; - encoder_state = (clockwise ^ 1) | (clockwise << 1); - action_exec(encoder_event); -} - -void matrix_scan_user(void) { - encoder_action_unregister(); -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - encoder_action_register(index, clockwise); - return false; -} - /* Keyboard */ void keyboard_post_init_user(void) { bme280_init(); @@ -179,3 +125,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______) }, +}; +#endif diff --git a/keyboards/rate/pistachio_pro/keymaps/via/rules.mk b/keyboards/rate/pistachio_pro/keymaps/via/rules.mk index 36b7ba9cbc..1189f4ad19 100644 --- a/keyboards/rate/pistachio_pro/keymaps/via/rules.mk +++ b/keyboards/rate/pistachio_pro/keymaps/via/rules.mk @@ -1,2 +1,3 @@ VIA_ENABLE = yes LTO_ENABLE = yes +ENCODER_MAP_ENABLE = yes |