forked from forks/qmk_firmware
Added support for version 2 PCB
New/corrected pin locations. (Backlight) LED pin now on B6. Up to 3 rotary encoder support.
This commit is contained in:
parent
efe2118437
commit
8623287dee
14
keyboards/pabile/p20/keymaps/ver2/config.h
Normal file
14
keyboards/pabile/p20/keymaps/ver2/config.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "../../config.h"
|
||||
|
||||
/* pins for PCB v2 */
|
||||
#undef MATRIX_ROW_PINS
|
||||
#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 }
|
||||
|
||||
#undef MATRIX_COL_PINS
|
||||
#define MATRIX_COL_PINS { D1, D0, D4, B2 }
|
||||
|
||||
#undef ENCODERS_PAD_A
|
||||
#define ENCODERS_PAD_A { F4, F7 }
|
||||
#undef ENCODERS_PAD_B
|
||||
#define ENCODERS_PAD_B { F5, B1 }
|
||||
#define ENCODERS_PAD_C { F6, B3 }
|
||||
32
keyboards/pabile/p20/keymaps/ver2/keymap.c
Normal file
32
keyboards/pabile/p20/keymaps/ver2/keymap.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_ortho_5x4(
|
||||
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_P4, KC_P5, KC_P6, KC_COMM,
|
||||
KC_P1, KC_P2, KC_P3, KC_EQL,
|
||||
KC_P0, KC_P0(KC_P0), KC_PDOT, KC_PENT)
|
||||
};
|
||||
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_WH_U); /*mouse wheel up*/
|
||||
} else {
|
||||
tap_code(KC_WH_D); /*mouse wheel down */
|
||||
}
|
||||
} else if (index == 1) { /* Second encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_MS_U); /*mouse up*/
|
||||
} else {
|
||||
tap_code(KC_MS_D); /*volume down*/
|
||||
}
|
||||
} else if (index == 2) { /* Second encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_MS_L); /*mouse left*/
|
||||
} else {
|
||||
tap_code(KC_MS_R); /*mouse right*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue