Add BDN9 rev2 (#9017)

This commit is contained in:
Danny
2020-06-09 22:32:46 -04:00
committed by GitHub
parent 1d1c0503b6
commit 184c362324
25 changed files with 1835 additions and 159 deletions

View File

@@ -31,9 +31,13 @@ void encoder_update_user(uint8_t index, bool clockwise) {
/* Top-right encoder (backlight brightness) */
case 1:
if (clockwise) {
#ifdef BACKLIGHT_ENABLE
backlight_increase();
#endif
} else {
#ifdef BACKLIGHT_ENABLE
backlight_decrease();
#endif
}
break;
}

View File

@@ -1,2 +1,4 @@
MOUSEKEY_ENABLE = yes
CTPC = yes
MOUSEKEY_ENABLE = yes
ifneq (, $(findstring rev1, $(KEYBOARD)))
CTPC = yes
endif

View File

@@ -0,0 +1,5 @@
#pragma once
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES
#endif

View File

@@ -15,6 +15,12 @@
*/
#include QMK_KEYBOARD_H
enum encoder_names {
_LEFT,
_RIGHT,
_MIDDLE,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
| Knob 1: Vol Dn/Up | | Knob 2: Page Dn/Up |
@@ -40,14 +46,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (index == _LEFT) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
else if (index == 1) {
else if (index == _MIDDLE) {
if (clockwise) {
tap_code(KC_DOWN);
} else {
tap_code(KC_UP);
}
}
else if (index == _RIGHT) {
if (clockwise) {
tap_code(KC_PGDN);
} else {

View File

@@ -0,0 +1,5 @@
#pragma once
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES
#endif

View File

@@ -0,0 +1,49 @@
#include QMK_KEYBOARD_H
enum encoder_names {
_LEFT,
_RIGHT,
_MIDDLE,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_A, KC_B, KC_C,
KC_D, KC_E, KC_F,
KC_G, KC_H, RGB_MOD
),
/*
| RESET | N/A | Media Stop |
| Held: Layer 2 | Home | RGB Mode |
| Media Previous | End | Media Next |
*/
[1] = LAYOUT(
RESET , BL_STEP, KC_STOP,
_______, KC_HOME, RGB_MOD,
KC_MPRV, KC_END , KC_MNXT
),
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == _LEFT) {
if (clockwise) {
rgblight_increase_hue();
} else {
rgblight_decrease_hue();
}
}
else if (index == _MIDDLE) {
if (clockwise) {
rgblight_increase_sat();
} else {
rgblight_decrease_sat();
}
}
else if (index == _RIGHT) {
if (clockwise) {
rgblight_increase_val();
} else {
rgblight_decrease_val();
}
}
}

View File

@@ -1,5 +1,5 @@
VIA_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
MOUSEKEY_ENABLE = yes
CONSOLE_ENABLE = no
CONSOLE_ENABLE = yes
COMMAND_ENABLE = no